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
OSS Gateに参加したら Larastanに コントリビュートできた - Kobe Lar...
Search
akatsuka
April 09, 2024
0
140
OSS Gateに参加したら Larastanに コントリビュートできた - Kobe Laravel
akatsuka
April 09, 2024
Tweet
Share
More Decks by akatsuka
See All by akatsuka
スクラムをちゃんとやる勇気
akinoriakatsuka
0
0
キャリアを拓く! 登壇のススメ - PHPカンファレンス関西アフターパーティー in スマレジ
akinoriakatsuka
1
120
カンファレンスに参加したあなたが明日からできること
akinoriakatsuka
1
190
DIってなんだか難しい? 依存という概念を「使う・使われる」 という言葉で整理しよう
akinoriakatsuka
1
950
なぜ、パスワードハッシュのソルトはハッシュと同じ場所に置いて良いのか
akinoriakatsuka
0
470
PHPカンファレンス関西2025 コアスタッフ説明会
akinoriakatsuka
0
110
PHPで物理エンジン(PHPysics)を作ってみた - PHPカンファレンス沖縄2024
akinoriakatsuka
0
160
依存を意識して安定した変更に強いコードを書こう
akinoriakatsuka
0
180
password_hash に詳しくなりたい - PHPオレカンファレンス
akinoriakatsuka
0
410
Featured
See All Featured
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
ReactJS: Keep Simple. Everything can be a component!
pedronauck
667
120k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
114
20k
Building a Modern Day E-commerce SEO Strategy
aleyda
43
7.7k
Balancing Empowerment & Direction
lara
4
670
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
15
1.7k
The Power of CSS Pseudo Elements
geoffreycrofte
78
6k
The Invisible Side of Design
smashingmag
301
51k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.4k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
45
2.5k
Transcript
OSS Gate に参加したら Larastan に コントリビュートできた あかつか 2024/04/11 Kobe Laravel
自己紹介
自己紹介 あかつか 神戸の会社でバックエンドエンジニアをしています PHP とLaravel が好きです 最近はGo も好き new Larastan
コントリビューター https:/ /github.com/larastan/larastan/releases/tag/v2.9.1 (とはいえ、一個しかPR やってない)
Larastan とは
Larastan とは PHPStan のLaravel 向けラッパー PHPStan PHP の静的解析ツール 定義されていない変数を使おうとした時に警告し てくれる
関数の戻り値の方が間違っている時に警告してく れる Larastan はLaravel の特有の機能にも対応している
OSS Gate とは
OSS Gate とは 「OSS Gate 」は、OSS 開発に参加する「入り口」を提供 する取り組みです。 OSS 開発に未参加の人を参加する
人へ、少し参加したことがある人を継続的に参加する 人へ。そうやってOSS 開発に参加する人を継続的に増や していく。それが「OSS Gate 」の目的です。 https:/ /oss-gate.github.io/
今回追加したもの
追加したもの サポートされているEloquent Builder メソッドに withWhereHas を追加 https:/ /github.com/larastan/larastan/issues/1523 https:/ /github.com/larastan/larastan/pull/1853
withWhereHas use App\Models\User; $users = User::withWhereHas('posts', function ($query) { $query->where('featured',
true); })->get();
実際に動きを見てみよう 私の変更が入ったのは2.9.1 から 2.9.0 と2.9.2 で違いを見てみよう $ composer show -i
| grep larastan $ ./vendor/bin/phpstan analyse
実際に動きを見てみよう before(2.9.0) after(2.9.2)
参加した時の私 OSS の経験はほぼなし ドキュメント修正のプルリクを送った程度 それでもコントリビュートできた🎉
どうやって追加した 1. Laravel とLarastan をインストールして 再現用のコードを書く 2. 手元のLarastan でissue の再現を確認
3. Larastan のリポジトリをフォーク 4. 修正を追加 5. テストを追加 + 通ることを確認 6. ドキュメントの修正 7. PR を送る
大変だったところ テストの書き方が最初わからなかった PHPUnit のTestCase を継承しているPHPStan の テストクラスを使っていた コミュニケーションが英語 CI がうまく通らないことがあって不安になった
OSS コントリビュートの始め方 OSS Gate に参加してみる 次回はオンラインで4/27 に開催される いろんなOSS を使ってみる PHP
やLaravel もOSS 使うことも貢献の一つの形 使っていてバグを見つけたり、うまく動かなかった りしたら報告しよう https:/ /github.com/laravel/framework/issues/50862
宣伝 PHP カンファレンス福岡で登壇します よかったらきてください!
Thank you!