From 72a10d20ee2360c18d6c69be6fd7d6d74a3be499 Mon Sep 17 00:00:00 2001 From: Jake Hotson Date: Mon, 20 Jan 2025 22:44:44 +0000 Subject: [PATCH] [TASK] Disable PHP CS Fixer `statement_indentation` rule Unfortunately, this has been broken for comments preceding a `case` within a `switch` since PHP CS Fixer version 3.9.1. See - https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/6572 - https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/pull/6490 - https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/pull/6490#issuecomment-1874110032 - https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/pull/7624 A configuration option `stick_comment_to_next_continuous_control_statement` was added, but this has not yet been extended to cover `case` within a `switch`. So, for the time being, we cannot use this rule if we want to comment `case`s within a `swtich`. --- config/php-cs-fixer.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/config/php-cs-fixer.php b/config/php-cs-fixer.php index 0a1224ee..96b39bbb 100644 --- a/config/php-cs-fixer.php +++ b/config/php-cs-fixer.php @@ -96,5 +96,8 @@ // string notation 'single_quote' => true, 'string_implicit_backslashes' => ['single_quoted' => 'escape'], + + // whitespace + 'statement_indentation' => false, ] );