chore(deps-dev): bump the php-dev-tools group with 5 updates - #6986
chore(deps-dev): bump the php-dev-tools group with 5 updates#6986dependabot[bot] wants to merge 4 commits into
Conversation
Bumps the php-dev-tools group with 5 updates: | Package | From | To | | --- | --- | --- | | [phpstan/phpstan](https://github.com/phpstan/phpstan-phar-composer-source) | `2.1.44` | `2.2.5` | | [phpstan/phpstan-doctrine](https://github.com/phpstan/phpstan-doctrine) | `2.0.20` | `2.0.28` | | [rector/rector](https://github.com/rectorphp/rector) | `2.3.9` | `2.5.7` | | [codeception/lib-innerbrowser](https://github.com/Codeception/lib-innerbrowser) | `4.1.0` | `4.1.1` | | [symfony/polyfill-iconv](https://github.com/symfony/polyfill-iconv) | `1.33.0` | `1.37.0` | Updates `phpstan/phpstan` from 2.1.44 to 2.2.5 - [Commits](https://github.com/phpstan/phpstan-phar-composer-source/commits) Updates `phpstan/phpstan-doctrine` from 2.0.20 to 2.0.28 - [Release notes](https://github.com/phpstan/phpstan-doctrine/releases) - [Commits](phpstan/phpstan-doctrine@2.0.20...2.0.28) Updates `rector/rector` from 2.3.9 to 2.5.7 - [Release notes](https://github.com/rectorphp/rector/releases) - [Commits](rectorphp/rector@2.3.9...2.5.7) Updates `codeception/lib-innerbrowser` from 4.1.0 to 4.1.1 - [Release notes](https://github.com/Codeception/lib-innerbrowser/releases) - [Commits](Codeception/lib-innerbrowser@4.1.0...4.1.1) Updates `symfony/polyfill-iconv` from 1.33.0 to 1.37.0 - [Release notes](https://github.com/symfony/polyfill-iconv/releases) - [Commits](symfony/polyfill-iconv@v1.33.0...v1.37.0) --- updated-dependencies: - dependency-name: phpstan/phpstan dependency-version: 2.2.5 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: php-dev-tools - dependency-name: phpstan/phpstan-doctrine dependency-version: 2.0.28 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: php-dev-tools - dependency-name: rector/rector dependency-version: 2.5.7 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: php-dev-tools - dependency-name: codeception/lib-innerbrowser dependency-version: 4.1.1 dependency-type: indirect update-type: version-update:semver-patch dependency-group: php-dev-tools - dependency-name: symfony/polyfill-iconv dependency-version: 1.37.0 dependency-type: indirect update-type: version-update:semver-minor dependency-group: php-dev-tools ... Signed-off-by: dependabot[bot] <support@github.com>
rector 2.5.7 は phpstan 2.2 で削除された `PHPStan\Parser\RichParser` の private プロパティ `$container` を PrivatesAccessor 経由で参照するため, DI コンテナ構築時に MissingPrivatePropertyException で fatal error になり Rector ジョブが失敗していた. composer の制約上は矛盾がない (rector 2.5.7 の要求は phpstan ^2.2.2) ため dependabot が壊れた組み合わせの lock を生成していた. rector 2.5.8 (rectorphp/rector-src#8208 "Bump to PHPStan ^2.2.6 and Fix its Container compatibility in RichParser") で `$nodeVisitors` を参照する実装に 修正されているため 2.5.8 へ更新する. rector 2.3.9 への据え置きは phpstan を ^2.1.40 に固定する意味になり本 PR の phpstan 2.2 更新と両立しない. あわせて 2.3.9 → 2.5.8 で追加された新ルールの指摘に追従する. RemoveDefaultValueFromAssignedPropertyRector は以下の理由でスキップする. - Entity (Order::$delivery_fee_total, Customer::$buy_times 等) の初期化子は `#[ORM\Column(options: ['default' => 0])]` と対になる初期値の表明である - LoggerFacade / TranslatorFacade の static プロパティは init() 前にも参照され得るため, 初期化子を消すと nullable 型なのに未初期化アクセスの Error になる TwigInitializeListener では `@var Page $Page` の削除により `$Page->getPageLayouts()` の native 型が解決されるようになり, 不正確な `@var PageLayout[]` が PHPStan で検出されたため削除した (`Page::getPageLayouts()` は `@return Collection<int, PageLayout>` を持つ). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…php-dev-tools-b148682b6d
upstream/4.4 のマージで取り込んだ RefundRequestControllerTest の
`setUp(){parent::setUp();}` を RemoveParentDelegatingClassMethodRector の
指摘どおり削除する。
CI は PR のマージ ref (base との合成) を解析するため, base 4.4 にしか存在しない
ファイルの指摘はブランチ側のローカル実行では再現しなかった。upstream/4.4 を
マージした状態で rector を実行し, CI と同一の 1 件を再現・解消している。
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
dependabot の lock 更新だけでは Rector ジョブが fatal error で落ちるため、手動で追加修正しました。追加した内容と判断理由を残します。 1. なぜ追加修正が必要だったか
Rector は composer の制約上は矛盾がない(Rector 2.5.7 の要求は 2.
|
| rector/rector | 要求する phpstan/phpstan |
|---|---|
| 2.3.9(更新前) | ^2.1.40 |
| 2.4.0 〜 2.5.7 | ^2.2.2 ← 壊れている範囲 |
| 2.5.8 | ^2.2.6 |
3. Rector 2.3.9 → 2.5.8 で追加された新ルールの指摘に追従
fatal が解消すると新ルールの指摘が出るため、適用しました。発火したルールと適用ファイル数:
| ルール | 適用ファイル数 |
|---|---|
RemoveUselessVarTagRector |
34 |
RemoveDuplicatedReturnSelfDocblockRector |
21 |
RemoveParentDelegatingClassMethodRector |
13 |
RemoveNullNamedArgOnNullDefaultParamRector |
5 |
RemoveUselessTernaryRector |
4 |
CommandConfigureToAttributeRector |
4 |
TernaryToNullCoalescingRector |
3 |
RemoveUselessUnionReturnDocblockRector |
3 |
RemoveUselessReturnTagRector |
1 |
RemoveDoubleSelfAssignRector |
1 |
差分の大半は docblock と未使用 import の削除です。実行時挙動に関わる変更は全件確認しており、いずれも意味的に等価です。
? true : falseの除去 5 箇所。うちPluginService::enable()の$plugin->setEnabled($enable ? true : false)はenable(Plugin $plugin, bool $enable = true)とbool型宣言なのでキャスト効果がなく安全is_null($x) ? $x : $y→??4 箇所- 空の
#[\Override] configure(): void {}の削除 2 箇所(親Command::configure()が空実装) setUp(){parent::setUp();}8 箇所 /tearDown(){parent::tearDown();}7 箇所の削除(13 ファイル、すべてtests/配下)$Order = $Order = $this->getLastOrder();の二重代入除去
4. RemoveDefaultValueFromAssignedPropertyRector は rector.php で skip
2.5.8 の新ルールですが、次の 2 点で不都合が出るため理由コメント付きで skip しました。
- エンティティ:
Order::$delivery_fee_total = '0'/Customer::$buy_times = '0'/$buy_total = '0'の初期化子を削除する提案でした。コンストラクタでsetDeliveryFeeTotal('0')等を呼ぶためnew経路の実害はありませんが、#[ORM\Column(..., options: ['default' => 0])]と対になる初期値の表明を崩します - static Facade:
LoggerFacade/TranslatorFacadeのprivate static ?ContainerInterface $Container = null;から初期化子を消すと、nullable 型なのに未初期化状態になります。getLoggerBy()はself::$Container->get()を無条件に参照するため、init()前アクセスが未初期化アクセスの Error に変わります
5. TwigInitializeListener の @var PageLayout[] を削除
Rector が /** @var Page $Page */ を削除した結果、PHPStan が $Page->getPageLayouts() の native 型 Collection を解決できるようになり、次行の /** @var PageLayout[] $PageLayouts */ が矛盾として検出されました。
PHPDoc tag @var with type array<Eccube\Entity\PageLayout> is not subtype of
native type Doctrine\Common\Collections\Collection. (varTag.nativeType)
PHPStan 2.2 の新チェックによるものか Rector 由来かを切り分けるため、該当ファイルのみ変更前に戻して PHPStan を再実行し No errors を確認しています(= Rector 由来)。Page::getPageLayouts() は既に @return Collection<int, PageLayout> を持っているため、不正確な @var を削除して解決しました(@phpstan-ignore やベースラインは使っていません)。
6. upstream/4.4 をマージ
CI は PR のマージ ref(base との合成)を解析するため、base 4.4 にしか存在しないファイルの指摘がブランチ側のローカル実行では再現しません。本ブランチは base から 87 コミット遅れており、tests/Eccube/Tests/Web/Admin/Order/RefundRequestControllerTest.php(b9934b1e30 で追加)の指摘が CI でのみ残っていました。
upstream/4.4 をマージ(コンフリクトなし)した状態で Rector を実行し、CI と同一の 1 件を再現・解消しています。
検証
ローカルで CI と同じゲートを実行しています(PHP 8.5 / SQLite)。
| ゲート | 結果 |
|---|---|
rector process --dry-run --config=rector.php |
[OK] Rector is done!(exit 0) |
php-cs-fixer fix --dry-run |
Found 0 of 1229 files that can be fixed |
phpstan analyze src/(level 6) |
[OK] No errors |
phpunit(CI と同じ 4 グループ除外) |
Tests: 3041, Assertions: 6736 失敗・エラー 0 |
CI では Rector / PHPStan / PHP CS Fixer / dockerbuild(8.2–8.5)/ installer E2E が pass しています。
申し送り
- 手動 push したため dependabot の自動更新(rebase)は停止しています。 以降 lock を再生成させる場合は
@dependabot rebaseが必要です rector.phpのDoctrineSetList::DOCTRINE_DBAL_30が deprecated 警告を出しています(withComposerBased()推奨)。fatal とは無関係で本 PR では触っていません。別途対応が必要です
|
Looks like these dependencies are updatable in another way, so this is no longer needed. |
Bumps the php-dev-tools group with 5 updates:
2.1.442.2.52.0.202.0.282.3.92.5.74.1.04.1.11.33.01.37.0Updates
phpstan/phpstanfrom 2.1.44 to 2.2.5Commits
Updates
phpstan/phpstan-doctrinefrom 2.0.20 to 2.0.28Release notes
Sourced from phpstan/phpstan-doctrine's releases.
Commits
b462395Support query inference with multiple entity managers (#756)da187ceUpdate actions/cache action to v6 (#775)9660770Fix build on PHPStan 2.2.3 (#773)c17f92dUpdate github-actions to v3.0.1 (#771)65a399fUpdate github-actions to v7 (#772)39b4ca4Fix incorrect stub change of criteria arg (#768)edea68bUpdate github-actions (#765)22cd60bSync ObjectRepository stub types with Doctrine (#767)cff83bfFix one more test78df87cUpdate more testsUpdates
rector/rectorfrom 2.3.9 to 2.5.7Release notes
Sourced from rector/rector's releases.
... (truncated)
Commits
ba22f8cRector 2.5.71109537Updated Rector to commit 653ec233fa55057fb11a6c133ed5c8d57dec9ff2e363554Updated Rector to commit 3c481b689cd746323dfad98782cd7939f28035e4fb62051Updated Rector to commit 3c481b689cd746323dfad98782cd7939f28035e4561c81cUpdated Rector to commit 51d61737c5fbaed10c5f711bbc8074720452417e9f3ea3aUpdated Rector to commit e713102f40682bc65311d3a50e5490e6acc452f378b5c28Updated Rector to commit 306b852af3e4d0045034a6865bffe311ccdf38c94bb232cUpdated Rector to commit 0e269a0d17470ec8331efb518efcfd5fa6e7162deab289bUpdated Rector to commit cc1a748e25adb989f2cf42f0329792810d79d2164ebe4bcUpdated Rector to commit ed944a11e6e3a83bac0f9e1f4a413bcc7153fca7Updates
codeception/lib-innerbrowserfrom 4.1.0 to 4.1.1Release notes
Sourced from codeception/lib-innerbrowser's releases.
Commits
0fa80deFix moveBack() history pointer + add symmetric moveForward() (#87)Updates
symfony/polyfill-iconvfrom 1.33.0 to 1.37.0Release notes
Sourced from symfony/polyfill-iconv's releases.
Commits
2c5729fCS fixesDependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebasewill rebase this PR@dependabot recreatewill recreate this PR, overwriting any edits that have been made to it@dependabot show <dependency name> ignore conditionswill show all of the ignore conditions of the specified dependency@dependabot ignore <dependency name> major versionwill close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself)@dependabot ignore <dependency name> minor versionwill close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself)@dependabot ignore <dependency name>will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself)@dependabot unignore <dependency name>will remove all of the ignore conditions of the specified dependency@dependabot unignore <dependency name> <ignore condition>will remove the ignore condition of the specified dependency and ignore conditions