Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
補完したい話
Search
chiroruxx
June 27, 2018
Programming
1
240
補完したい話
第127回PHP勉強会
PHPカンファレンス福岡2018 AfterHack
で発表した資料です。
chiroruxx
June 27, 2018
Tweet
Share
More Decks by chiroruxx
See All by chiroruxx
今ならできる!PhpStormプラグイン開発
chiroruxx
0
49
Go Connectへの想い
chiroruxx
0
180
eBPF with PHPをさわる
chiroruxx
0
130
sl完全に理解したつもり
chiroruxx
0
120
命名をリントする
chiroruxx
1
830
良い命名かを調べるリンターを作った + α
chiroruxx
0
130
GoLandを布教する会
chiroruxx
0
41
PHPはいつから死んでいるかの調査
chiroruxx
3
670
元phperから見たGoの良いところ
chiroruxx
0
100
Other Decks in Programming
See All in Programming
もうちょっといいRubyプロファイラを作りたい (2025)
osyoyu
1
440
Laravel Boost 超入門
fire_arlo
3
220
為你自己學 Python - 冷知識篇
eddie
1
350
今から始めるClaude Code入門〜AIコーディングエージェントの歴史と導入〜
nokomoro3
0
180
「待たせ上手」なスケルトンスクリーン、 そのUXの裏側
teamlab
PRO
0
530
概念モデル→論理モデルで気をつけていること
sunnyone
2
210
Zendeskのチケットを Amazon Bedrockで 解析した
ryokosuge
3
310
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
380
AIと私たちの学習の変化を考える - Claude Codeの学習モードを例に
azukiazusa1
10
4.2k
今だからこそ入門する Server-Sent Events (SSE)
nearme_tech
PRO
3
220
Android 16 × Jetpack Composeで縦書きテキストエディタを作ろう / Vertical Text Editor with Compose on Android 16
cc4966
1
230
Design Foundational Data Engineering Observability
sucitw
3
200
Featured
See All Featured
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
1.6k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
29
1.9k
Building a Modern Day E-commerce SEO Strategy
aleyda
43
7.6k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
53
2.9k
4 Signs Your Business is Dying
shpigford
184
22k
The Language of Interfaces
destraynor
161
25k
Typedesign – Prime Four
hannesfritz
42
2.8k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
31
2.2k
Build your cross-platform service in a week with App Engine
jlugia
231
18k
Done Done
chrislema
185
16k
Producing Creativity
orderedlist
PRO
347
40k
Facilitating Awesome Meetings
lara
55
6.5k
Transcript
補完したい話 6/27 PHP勉強会@東京 前田 和人
PHP Conference スポンサー募集中
自己紹介 ▪ 前田 和人 ▪ @chiroruxxxx ▪ 弁護士ドットコム株式会社 ▪ 補完機能依存
補完機能依存 ▪ もはや補完がないと生きていけない – すべてPhpStormのせい ▪ シェルも補完がないとつらい – fish最高! ▪
今日はPhpStormの話をするよ(fishはまた今度)
補完が効かないやつら ▪ factory ▪ サービスコンテナ ▪ 「引数によって返す型が違う」メソッドから生成されたインスタンスが補完で きない $user =
factory(User::class)->create(); $api = resolve(API::class);
つらい
頑張れば補完できるけど・・・ ▪ PHPDocで型を明示してあげれば補完できるけど・・・ ▪ 毎回これ書くのはちょっとしんどい ▪ 補完のためにコード長くするのも・・・ /** @var ¥App¥User
$user */ $user = factory(User::class)->create();
.phpstorm.meta.php ▪ .phpstorm.meta.phpというファイルを作成することで対応できる! ▪ WI-6027により実装された機能 ▪ factory design patternを補完する
.phpstorm.meta.php <?php namespace PHPSTORM_META { override(¥ServiceLocatorInterface::get(0), map([ "special" => ¥Exception::class,
¥ExampleFactory::EXAMPLE_B => ExampleB::class, ¥EXAMPLE_B => ¥ExampleB::class, ])); }
.phpstorm.meta.php <?php namespace PHPSTORM_META { override(¥ServiceLocatorInterface::getByPattern(0), map([ '' => '@Iterator|¥Iterator',
])); }
まとめ ▪ 「.phpstorm.meta.php」というファイルを書けば補完ができる! ▪ 引数の型も補完してくれる! ▪ 書くの大変だから自動化できるといいね