-
Notifications
You must be signed in to change notification settings - Fork 646
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[4.2] Array shapes のサポート #5833
[4.2] Array shapes のサポート #5833
Conversation
Codecov Report
@@ Coverage Diff @@
## 4.2 #5833 +/- ##
============================================
- Coverage 78.75% 78.75% -0.01%
Complexity 6287 6287
============================================
Files 470 470
Lines 21096 21096
============================================
- Hits 16615 16614 -1
- Misses 4481 4482 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
* category_id?:Category, | ||
* name?:string, | ||
* pageno?:string, | ||
* disp_number?:ProductListMax, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nanasess
pageno, disp_numberは使ってなさそうです。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@chihiro-adachi SearchProductType には pageno, disp_number が含まれており、 $searchData
連想配列には含まれるため記載しました
ec-cube/src/Eccube/Form/Type/SearchProductType.php
Lines 76 to 80 in 97873e5
$builder->add('pageno', HiddenType::class, []); | |
$builder->add('disp_number', ProductListMaxType::class, [ | |
'label' => false, | |
'choices' => $this->entityManager->getRepository(ProductListMax::class)->findBy([], ['sort_no' => 'ASC']), | |
]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
なるほど。了解です。
概要(Overview・Refs Issue)
Array shapes を使用して、連想配列の変数を型定義する
see https://phpstan.org/writing-php-code/phpdoc-types#array-shapes
方針(Policy)
とり急ぎ利用頻度の高そうな Repository クラスの
$searchData
及び、 PluginManager クラスの$meta
を定義する実装に関する補足(Appendix)
Array shapes で型定義しておくと、連想配列でもコード補完が可能になる。 PHPStorm でも利用できるはず
テスト(Test)
PHPStan 及び PhpActor で型定義が有効になっていることを確認
相談(Discussion)
マイナーバージョン互換性保持のための制限事項チェックリスト
レビュワー確認項目