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
250
補完したい話
第127回PHP勉強会
PHPカンファレンス福岡2018 AfterHack
で発表した資料です。
chiroruxx
June 27, 2018
Tweet
Share
More Decks by chiroruxx
See All by chiroruxx
初心者エンジニアから中級者エンジニアになるためにオススメの1冊
chiroruxx
0
110
Laravelのパッケージ全部紹介する
chiroruxx
2
99
Gopher のための「自由な話し合い」ワークショップ
chiroruxx
0
28
PHPをGoで動かす
chiroruxx
0
81
Goを使ってTDDを体験しよう!
chiroruxx
1
900
今ならできる!PhpStormプラグイン開発
chiroruxx
0
82
Go Connectへの想い
chiroruxx
0
210
eBPF with PHPをさわる
chiroruxx
0
160
sl完全に理解したつもり
chiroruxx
0
150
Other Decks in Programming
See All in Programming
RAGでハマりがちな"Excelの罠"を、データの構造化で突破する
harumiweb
9
2.8k
Claude Code の Skill で複雑な既存仕様をすっきり整理しよう
yuichirokato
1
380
AIとペアプロして処理時間を97%削減した話 #pyconshizu
kashewnuts
1
240
どんと来い、データベース信頼性エンジニアリング / Introduction to DBRE
nnaka2992
1
290
What Spring Developers Should Know About Jakarta EE
ivargrimstad
0
290
守る「だけ」の優しいEMを抜けて、 事業とチームを両方見る視点を身につけた話
maroon8021
3
910
LangChain4jとは一味違うLangChain4j-CDI
kazumura
1
180
The Ralph Wiggum Loop: First Principles of Autonomous Development
sembayui
0
3.7k
Codex の「自走力」を高める
yorifuji
0
1.2k
maplibre-gl-layers - 地図に移動体たくさん表示したい
kekyo
PRO
0
270
Ruby x Terminal
a_matsuda
7
600
Swift ConcurrencyでよりSwiftyに
yuukiw00w
0
270
Featured
See All Featured
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
100
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.2k
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
260
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
140
GitHub's CSS Performance
jonrohan
1032
470k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
780
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.5k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
140
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
110
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
200
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
120
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」というファイルを書けば補完ができる! ▪ 引数の型も補完してくれる! ▪ 書くの大変だから自動化できるといいね