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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
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
初心者エンジニアから中級者エンジニアになるためにオススメの1冊
chiroruxx
0
99
Laravelのパッケージ全部紹介する
chiroruxx
2
86
Gopher のための「自由な話し合い」ワークショップ
chiroruxx
0
22
PHPをGoで動かす
chiroruxx
0
76
Goを使ってTDDを体験しよう!
chiroruxx
1
840
今ならできる!PhpStormプラグイン開発
chiroruxx
0
75
Go Connectへの想い
chiroruxx
0
200
eBPF with PHPをさわる
chiroruxx
0
150
sl完全に理解したつもり
chiroruxx
0
140
Other Decks in Programming
See All in Programming
CSC307 Lecture 07
javiergs
PRO
1
550
AI Agent の開発と運用を支える Durable Execution #AgentsInProd
izumin5210
7
2.3k
Patterns of Patterns
denyspoltorak
0
1.4k
KIKI_MBSD Cybersecurity Challenges 2025
ikema
0
1.3k
AIフル活用時代だからこそ学んでおきたい働き方の心得
shinoyu
0
140
AIエージェントのキホンから学ぶ「エージェンティックコーディング」実践入門
masahiro_nishimi
5
480
AtCoder Conference 2025
shindannin
0
1.1k
CSC307 Lecture 01
javiergs
PRO
0
690
AIによる開発の民主化を支える コンテキスト管理のこれまでとこれから
mulyu
3
380
余白を設計しフロントエンド開発を 加速させる
tsukuha
7
2.1k
AI時代の認知負荷との向き合い方
optfit
0
160
Grafana:建立系統全知視角的捷徑
blueswen
0
330
Featured
See All Featured
From π to Pie charts
rasagy
0
120
Into the Great Unknown - MozCon
thekraken
40
2.3k
The Invisible Side of Design
smashingmag
302
51k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
0
260
The #1 spot is gone: here's how to win anyway
tamaranovitovic
2
940
Music & Morning Musume
bryan
47
7.1k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
jQuery: Nuts, Bolts and Bling
dougneiner
65
8.4k
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
2
420
Imperfection Machines: The Place of Print at Facebook
scottboms
269
14k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
1
300
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」というファイルを書けば補完ができる! ▪ 引数の型も補完してくれる! ▪ 書くの大変だから自動化できるといいね