chore(deps): nanasess/bcmath-polyfill を 1.1.0 に更新 - #7030
Conversation
- 1.0.3 以降は RoundingMode の存在判定が class_exists になり、rector 2.4 以降が同梱する symfony/polyfill-php84 の class_alias と衝突しなくなる - 1.1.0 は RoundingMode を pure enum に変更し、ネイティブ PHP 8.4 の定義と挙動を揃える Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (1)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 4.4 #7030 +/- ##
==========================================
- Coverage 77.18% 77.17% -0.02%
==========================================
Files 564 564
Lines 28123 28082 -41
==========================================
- Hits 21707 21671 -36
+ Misses 6416 6411 -5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
概要(Overview・Refs Issue)
nanasess/bcmath-polyfillを 1.0.2 から 1.1.0 へ更新します。1.0.3 以降で
RoundingModeの存在判定がenum_exists()からclass_exists('RoundingMode', false)に変わっています。これにより、rector 2.4 以降が同梱する
symfony/polyfill-php84が PHP 8.4 未満でRoundingModeを class としてclass_aliasした場合でも、二重宣言による fatal が起きなくなります。現在の 1.0.2 では、PHP 8.2 / 8.3 で rector 2.4 以降を入れると以下で落ちます。
方針(Policy)
1.0.3 で止める案もありますが、最新の 1.1.0 を採用します。
1.1.0 では
RoundingModeが backed enum(RoundingMode: string)から pure enum に変更されており、PHP 8.4 のネイティブ実装と同じ形になります。8.1–8.3 と 8.4 以降で->valueやfrom()の可否が食い違わなくなるため、polyfill としてはこちらが正しい挙動です。composer.jsonの制約は"nanasess/bcmath-polyfill": "^1.0"のままで、composer.lockのみの変更です。実装に関する補足(Appendix)
pure enum への変更は、
RoundingModeを backed enum として扱っているコードには互換性のない変更です。本体(
src/app/tests/)にRoundingModeの参照はないため影響はありませんが、プラグインがRoundingMode::HalfUp->valueのような使い方をしている場合は影響を受けます。lib/bcmath.phpの関数群はext-bcmathが無い環境でのみ有効になるため、拡張が入っている環境では今回の更新による計算まわりの挙動変化はありません。テスト(Test)
ローカル(PHP 8.3.31)で以下を確認しています。
vendor/bin/rector process --dry-run: 変更検出なしvendor/bin/phpstan analyse src: エラーなしvendor/bin/rector --versionが正常動作すること(1.0.2 では fatal)PHPUnit はローカルで実行していません。CI の結果で確認をお願いします。
相談(Discussion)
pure enum 化の影響を避けたい場合は、1.0.3 に固定する形へ変更します。
マイナーバージョン互換性保持のための制限事項チェックリスト
レビュワー確認項目