Skip to content

fix(cs-fixer): setRiskyAllowed(true)を追加#6568

Open
nanasess wants to merge 2 commits intoEC-CUBE:4.3-symfony7from
nanasess:fix/php-cs-fixer-risky-allowed
Open

fix(cs-fixer): setRiskyAllowed(true)を追加#6568
nanasess wants to merge 2 commits intoEC-CUBE:4.3-symfony7from
nanasess:fix/php-cs-fixer-risky-allowed

Conversation

@nanasess
Copy link
Contributor

@nanasess nanasess commented Jan 13, 2026

概要(Overview・Refs Issue)

PHP CS Fixerの設定に setRiskyAllowed(true) を追加し、riskyフィクサーを --allow-risky=yes オプションなしで実行可能にします。

現在の設定では phpdoc_to_param_type, phpdoc_to_return_type, phpdoc_to_property_type などのriskyフィクサーが有効になっていますが、setRiskyAllowed(true) が設定されていないため、huskyを利用したpre-commitフック実行時に以下の警告が発生していました:

The rules contain risky fixers ("phpdoc_to_return_type", "phpdoc_to_param_type" and "phpdoc_to_property_type"), but they are not allowed to run. Perhaps you forget to use --allow-risky=yes option?

方針(Policy)

  • PHP CS Fixer公式ドキュメントに従い、riskyフィクサーを使用する場合は setRiskyAllowed(true) を設定する必要があります
  • コマンドラインオプションではなく設定ファイルに追加することで、毎回オプションを指定する手間を省きます

実装に関する補足(Appendix)

.php-cs-fixer.dist.php->setRiskyAllowed(true) を1行追加しただけのシンプルな変更です。

テスト(Test)

  • vendor/bin/php-cs-fixer fix --dry-run でエラーなく実行できることを確認
  • huskyのpre-commitフックでエラーが発生しないことを確認

相談(Discussion)

特にありません。

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

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

🤖 Generated with Claude Code

phpdoc_to_param_type, phpdoc_to_return_type, phpdoc_to_property_type
などのriskyフィクサーを使用するために必要な設定を追加。
これにより--allow-risky=yesオプションなしで実行可能になる。

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@dotani1111 dotani1111 added this to the 4.4.0 milestone Jan 14, 2026
@codecov
Copy link

codecov bot commented Jan 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.46%. Comparing base (3c4c246) to head (c4def4f).
⚠️ Report is 1 commits behind head on 4.3-symfony7.

Additional details and impacted files
@@               Coverage Diff                @@
##           4.3-symfony7    #6568      +/-   ##
================================================
+ Coverage         82.33%   82.46%   +0.13%     
================================================
  Files               482      482              
  Lines             25691    25691              
================================================
+ Hits              21152    21187      +35     
+ Misses             4539     4504      -35     
Flag Coverage Δ
E2E 82.46% <ø> (+0.13%) ⬆️
Unit 82.46% <ø> (+0.13%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants