概要
.php-cs-fixer.dist.php が現行の php-cs-fixer (3.95.11) で deprecated になったルール名を使っており、composer cs-check / cs-fix 実行時に以下の警告が出ます。次のメジャーリリースで動かなくなるため、後継名へ更新しておくのが望ましいです(現時点では動作影響なし・CI も pass)。
実際の警告出力
Detected deprecations in use (they will stop working in next major release):
- Rule "visibility_required" is deprecated. Use "modifier_keywords" instead.
- Rule set "@PHP83Migration" is deprecated. Use "@PHP8x3Migration" instead.
(php-cs-fixer fix --dry-run -vvv で確認)
対応
.php-cs-fixer.dist.php を次のように更新:
'@PHP83Migration' => true, → '@PHP8x3Migration' => true,
'visibility_required' => ['elements' => ['method', 'property']], → 'modifier_keywords' => ['elements' => ['method', 'property']],
更新後に composer cs-fix を流し、src/ ・ tests/ に差分が出ないこと(=適用結果が同一であること)を確認する。
補足
@PHP8x3Migration は php-cs-fixer 側で「8.3 系」を表す新しい命名。プロジェクトの PHP 要件は ^8.3 なのでこのまま 8.3 系を指定する。
- 深刻度: 低(動作影響なし、将来のメジャー更新への備え)。
Claude-Session: https://claude.ai/code/session_017XTM7pxbWPVNLV639i5WgK
概要
.php-cs-fixer.dist.phpが現行の php-cs-fixer (3.95.11) で deprecated になったルール名を使っており、composer cs-check/cs-fix実行時に以下の警告が出ます。次のメジャーリリースで動かなくなるため、後継名へ更新しておくのが望ましいです(現時点では動作影響なし・CI も pass)。実際の警告出力
(
php-cs-fixer fix --dry-run -vvvで確認)対応
.php-cs-fixer.dist.phpを次のように更新:'@PHP83Migration' => true,→'@PHP8x3Migration' => true,'visibility_required' => ['elements' => ['method', 'property']],→'modifier_keywords' => ['elements' => ['method', 'property']],更新後に
composer cs-fixを流し、src/ ・ tests/ に差分が出ないこと(=適用結果が同一であること)を確認する。補足
@PHP8x3Migrationは php-cs-fixer 側で「8.3 系」を表す新しい命名。プロジェクトの PHP 要件は^8.3なのでこのまま 8.3 系を指定する。Claude-Session: https://claude.ai/code/session_017XTM7pxbWPVNLV639i5WgK