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
230
補完したい話
第127回PHP勉強会
PHPカンファレンス福岡2018 AfterHack
で発表した資料です。
chiroruxx
June 27, 2018
Tweet
Share
More Decks by chiroruxx
See All by chiroruxx
Go Connectへの想い
chiroruxx
0
170
eBPF with PHPをさわる
chiroruxx
0
120
sl完全に理解したつもり
chiroruxx
0
100
命名をリントする
chiroruxx
1
790
良い命名かを調べるリンターを作った + α
chiroruxx
0
110
GoLandを布教する会
chiroruxx
0
37
PHPはいつから死んでいるかの調査
chiroruxx
3
650
元phperから見たGoの良いところ
chiroruxx
0
94
Go Connectへの想い
chiroruxx
0
480
Other Decks in Programming
See All in Programming
なんとなくわかった気になるブロックテーマ入門/contents.nagoya 2025 6.28
chiilog
1
270
なぜ適用するか、移行して理解するClean Architecture 〜構造を超えて設計を継承する〜 / Why Apply, Migrate and Understand Clean Architecture - Inherit Design Beyond Structure
seike460
PRO
3
770
Google Agent Development Kit でLINE Botを作ってみた
ymd65536
2
250
dbt民主化とLLMによる開発ブースト ~ AI Readyな分析サイクルを目指して ~
yoshyum
3
1k
5つのアンチパターンから学ぶLT設計
narihara
1
170
Rubyでやりたい駆動開発 / Ruby driven development
chobishiba
1
710
Systèmes distribués, pour le meilleur et pour le pire - BreizhCamp 2025 - Conférence
slecache
0
120
効率的な開発手段として VRTを活用する
ishkawa
0
140
AIと”コードの評価関数”を共有する / Share the "code evaluation function" with AI
euglena1215
1
170
イベントストーミング図からコードへの変換手順 / Procedure for Converting Event Storming Diagrams to Code
nrslib
2
820
PHP 8.4の新機能「プロパティフック」から学ぶオブジェクト指向設計とリスコフの置換原則
kentaroutakeda
2
900
すべてのコンテキストを、 ユーザー価値に変える
applism118
3
1.3k
Featured
See All Featured
Designing for humans not robots
tammielis
253
25k
Site-Speed That Sticks
csswizardry
10
690
How to Ace a Technical Interview
jacobian
278
23k
What’s in a name? Adding method to the madness
productmarketing
PRO
23
3.5k
The Straight Up "How To Draw Better" Workshop
denniskardys
234
140k
The Language of Interfaces
destraynor
158
25k
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Mobile First: as difficult as doing things right
swwweet
223
9.7k
Typedesign – Prime Four
hannesfritz
42
2.7k
Product Roadmaps are Hard
iamctodd
PRO
54
11k
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
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」というファイルを書けば補完ができる! ▪ 引数の型も補完してくれる! ▪ 書くの大変だから自動化できるといいね