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
Gopher のための「自由な話し合い」ワークショップ
chiroruxx
0
17
PHPをGoで動かす
chiroruxx
0
69
Goを使ってTDDを体験しよう!
chiroruxx
1
770
今ならできる!PhpStormプラグイン開発
chiroruxx
0
68
Go Connectへの想い
chiroruxx
0
190
eBPF with PHPをさわる
chiroruxx
0
150
sl完全に理解したつもり
chiroruxx
0
140
命名をリントする
chiroruxx
1
940
良い命名かを調べるリンターを作った + α
chiroruxx
0
140
Other Decks in Programming
See All in Programming
GISエンジニアから見たLINKSデータ
nokonoko1203
0
190
Deno Tunnel を使ってみた話
kamekyame
0
320
ThorVG Viewer In VS Code
nors
0
660
Unicodeどうしてる? PHPから見たUnicode対応と他言語での対応についてのお伺い
youkidearitai
PRO
0
440
Graviton と Nitro と私
maroon1st
0
160
ゆくKotlin くるRust
exoego
1
200
AtCoder Conference 2025
shindannin
0
920
CSC307 Lecture 03
javiergs
PRO
1
470
AI Agent Tool のためのバックエンドアーキテクチャを考える #encraft
izumin5210
6
1.6k
Vibe codingでおすすめの言語と開発手法
uyuki234
0
170
Basic Architectures
denyspoltorak
0
180
CSC307 Lecture 02
javiergs
PRO
1
760
Featured
See All Featured
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
540
Crafting Experiences
bethany
0
28
How to build a perfect <img>
jonoalderson
1
4.8k
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.7k
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
1
50
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
52
jQuery: Nuts, Bolts and Bling
dougneiner
65
8.4k
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.1k
SEO for Brand Visibility & Recognition
aleyda
0
4.2k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
122
21k
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
190
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
41
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」というファイルを書けば補完ができる! ▪ 引数の型も補完してくれる! ▪ 書くの大変だから自動化できるといいね