Skip to content

chore(deps): nanasess/bcmath-polyfill を 1.1.0 に更新 - #7030

Open
dotani1111 wants to merge 1 commit into
EC-CUBE:4.4from
dotani1111:chore/bump-bcmath-polyfill-1.1.0
Open

chore(deps): nanasess/bcmath-polyfill を 1.1.0 に更新#7030
dotani1111 wants to merge 1 commit into
EC-CUBE:4.4from
dotani1111:chore/bump-bcmath-polyfill-1.1.0

Conversation

@dotani1111

Copy link
Copy Markdown
Contributor

概要(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 以降を入れると以下で落ちます。

Fatal error: Cannot declare enum RoundingMode, because the name is already in use
  in vendor/nanasess/bcmath-polyfill/lib/RoundingMode.php on line 16

方針(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 以降で ->valuefrom() の可否が食い違わなくなるため、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: エラーなし
  • rector 2.5.9 と組み合わせた場合に vendor/bin/rector --version が正常動作すること(1.0.2 では fatal)

PHPUnit はローカルで実行していません。CI の結果で確認をお願いします。

相談(Discussion)

pure enum 化の影響を避けたい場合は、1.0.3 に固定する形へ変更します。

マイナーバージョン互換性保持のための制限事項チェックリスト

  • 既存機能の仕様変更はありません
  • フックポイントの呼び出しタイミングの変更はありません
  • フックポイントのパラメータの削除・データ型の変更はありません
  • twigファイルに渡しているパラメータの削除・データ型の変更はありません
  • Serviceクラスの公開関数の、引数の削除・データ型の変更はありません
  • 入出力ファイル(CSVなど)のフォーマット変更はありません

レビュワー確認項目

  • 動作確認
  • コードレビュー
  • E2E/Unit テスト確認(テストの追加・変更が必要かどうか)
  • 互換性が保持されているか
  • セキュリティ上の問題がないか
    • 権限を超えた操作が可能にならないか
    • 不要なファイルアップロードがないか
    • 外部へ公開されるファイルや機能の追加ではないか
    • テンプレートでのエスケープ漏れがないか

- 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>
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (1)
  • composer.lock is excluded by !**/*.lock

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: ec280da7-0d84-4426-bf0a-4a8c33a37993

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nanasess nanasess left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@codecov

codecov Bot commented Aug 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.17%. Comparing base (f8925c0) to head (07a8d17).
⚠️ Report is 17 commits behind head on 4.4.

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     
Flag Coverage Δ
Unit 77.17% <ø> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants