From 41c2c520466b12302bc83b667b69f906b6953e1b Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Thu, 23 Oct 2025 13:00:55 +0200 Subject: [PATCH 01/12] [Composer] Bumped friendsofphp/php-cs-fixer to v3.89.0 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 50b06d4..2f04eef 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ }, "require": { "php": ">=7.4", - "friendsofphp/php-cs-fixer": "v3.75.0", + "friendsofphp/php-cs-fixer": "v3.89.0", "composer-runtime-api": ">=2.0" }, "require-dev": { From 10bd18a78fc94b9f5617f4fda6bd532851fbb73f Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Thu, 23 Oct 2025 13:01:30 +0200 Subject: [PATCH 02/12] [CS] Updated rule set to use '@PER-CS2x0' instead of '@PER-CS2.0' --- src/lib/PhpCsFixer/Sets/Ibexa50RuleSet.php | 2 +- .../PhpCsFixer/Sets/expected_rules/5_0_rule_set/local_rules.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/PhpCsFixer/Sets/Ibexa50RuleSet.php b/src/lib/PhpCsFixer/Sets/Ibexa50RuleSet.php index 7e00b69..6d2a99e 100644 --- a/src/lib/PhpCsFixer/Sets/Ibexa50RuleSet.php +++ b/src/lib/PhpCsFixer/Sets/Ibexa50RuleSet.php @@ -14,7 +14,7 @@ public function getRules(): array { return array_merge( [ - '@PER-CS2.0' => true, + '@PER-CS2x0' => true, ], parent::getRules(), [ diff --git a/tests/lib/PhpCsFixer/Sets/expected_rules/5_0_rule_set/local_rules.php b/tests/lib/PhpCsFixer/Sets/expected_rules/5_0_rule_set/local_rules.php index c790c8f..7b482e9 100644 --- a/tests/lib/PhpCsFixer/Sets/expected_rules/5_0_rule_set/local_rules.php +++ b/tests/lib/PhpCsFixer/Sets/expected_rules/5_0_rule_set/local_rules.php @@ -9,7 +9,7 @@ use Ibexa\CodeStyle\PhpCsFixer\Sets\AbstractIbexaRuleSet; return [ - '@PER-CS2.0' => true, + '@PER-CS2x0' => true, '@PSR12' => false, 'array_syntax' => [ 'syntax' => 'short', From ade5ac3db8c0995e52bdf2e1504ab4e0e90f21d6 Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Thu, 23 Oct 2025 13:59:45 +0200 Subject: [PATCH 03/12] Fixed non-static call to getRules in `AbstractIbexaRuleSet::buildConfig` --- src/lib/PhpCsFixer/Sets/AbstractIbexaRuleSet.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/PhpCsFixer/Sets/AbstractIbexaRuleSet.php b/src/lib/PhpCsFixer/Sets/AbstractIbexaRuleSet.php index 8c20f9f..334999c 100644 --- a/src/lib/PhpCsFixer/Sets/AbstractIbexaRuleSet.php +++ b/src/lib/PhpCsFixer/Sets/AbstractIbexaRuleSet.php @@ -211,7 +211,7 @@ public function buildConfig(): Config $config->setRules(array_merge( $config->getRules(), - static::getRules(), + $this->getRules(), )); $config->setRiskyAllowed(true); From f22ae97ef788851de560725c802a8fc3199183a8 Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Thu, 23 Oct 2025 14:01:47 +0200 Subject: [PATCH 04/12] Replaced deprecated rules configuration sets - Rule "braces" is deprecated. Use "single_space_around_construct", "control_structure_braces", "control_structure_continuation_position", "declare_parentheses", "no_multiple_statements_per_line", "braces_position", "statement_indentation" and "no_extra_blank_lines" instead. - Rule "native_function_type_declaration_casing" is deprecated. Use "native_type_declaration_casing" instead. - Rule "new_with_braces" is deprecated. Use "new_with_parentheses" instead. - Rule "no_unneeded_curly_braces" is deprecated. Use "no_unneeded_braces" instead. --- .../PhpCsFixer/Sets/AbstractIbexaRuleSet.php | 2 +- src/lib/PhpCsFixer/Sets/Ibexa46RuleSet.php | 33 +++++++++++++------ src/lib/PhpCsFixer/Sets/Ibexa50RuleSet.php | 10 +++--- 3 files changed, 28 insertions(+), 17 deletions(-) diff --git a/src/lib/PhpCsFixer/Sets/AbstractIbexaRuleSet.php b/src/lib/PhpCsFixer/Sets/AbstractIbexaRuleSet.php index 334999c..f85aad0 100644 --- a/src/lib/PhpCsFixer/Sets/AbstractIbexaRuleSet.php +++ b/src/lib/PhpCsFixer/Sets/AbstractIbexaRuleSet.php @@ -195,7 +195,7 @@ public function getRules(): array 'trailing_comma_in_multiline' => true, 'trim_array_spaces' => true, 'unary_operator_spaces' => true, - 'visibility_required' => true, + 'modifier_keywords' => true, 'whitespace_after_comma_in_array' => true, 'yoda_style' => false, 'fully_qualified_strict_types' => [ diff --git a/src/lib/PhpCsFixer/Sets/Ibexa46RuleSet.php b/src/lib/PhpCsFixer/Sets/Ibexa46RuleSet.php index 3955f1b..7829161 100644 --- a/src/lib/PhpCsFixer/Sets/Ibexa46RuleSet.php +++ b/src/lib/PhpCsFixer/Sets/Ibexa46RuleSet.php @@ -15,17 +15,30 @@ public function getRules(): array return array_merge( parent::getRules(), [ - 'no_spaces_inside_parenthesis' => true, - 'braces' => [ - 'allow_single_line_closure' => true, + 'spaces_inside_parentheses' => true, + 'single_space_around_construct' => true, + 'control_structure_braces' => true, + 'control_structure_continuation_position' => true, + 'no_multiple_statements_per_line' => true, + 'declare_parentheses' => true, + 'braces_position' => true, + 'statement_indentation' => false, + 'type_declaration_spaces' => true, + 'native_type_declaration_casing' => true, + 'new_with_parentheses' => true, + 'no_trailing_comma_in_singleline' => true, + 'no_unneeded_braces' => true, + 'no_extra_blank_lines' => [ + 'tokens' => [ + 'curly_brace_block', + 'extra', + 'parenthesis_brace_block', + 'square_brace_block', + 'throw', + 'use', + ], ], - 'function_typehint_space' => true, - 'native_function_type_declaration_casing' => true, - 'new_with_braces' => true, - 'no_trailing_comma_in_list_call' => true, - 'no_trailing_comma_in_singleline_array' => true, - 'no_unneeded_curly_braces' => true, - 'single_blank_line_before_namespace' => true, + 'blank_lines_before_namespace' => true, ], ); } diff --git a/src/lib/PhpCsFixer/Sets/Ibexa50RuleSet.php b/src/lib/PhpCsFixer/Sets/Ibexa50RuleSet.php index 6d2a99e..e56fe57 100644 --- a/src/lib/PhpCsFixer/Sets/Ibexa50RuleSet.php +++ b/src/lib/PhpCsFixer/Sets/Ibexa50RuleSet.php @@ -21,17 +21,15 @@ public function getRules(): array 'spaces_inside_parentheses' => [ 'space' => 'none', ], - 'braces' => [ - 'allow_single_line_closure' => true, - ], + 'declare_parentheses' => true, 'type_declaration_spaces' => [ 'elements' => [ 'function', 'property', ], ], - 'native_function_type_declaration_casing' => true, - 'new_with_braces' => true, + 'native_type_declaration_casing' => true, + 'new_with_parentheses' => true, 'no_trailing_comma_in_singleline' => [ 'elements' => [ 'arguments', @@ -40,7 +38,7 @@ public function getRules(): array 'group_import', ], ], - 'no_unneeded_curly_braces' => true, + 'no_unneeded_braces' => true, 'blank_lines_before_namespace' => true, 'class_definition' => [ 'single_item_single_line' => true, From b863ba12ec9ac3d8fc26e979290ffe18ffddcad6 Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Thu, 23 Oct 2025 14:02:33 +0200 Subject: [PATCH 05/12] [Tests] Aligned test snapshots with replacement of deprecated rules --- .../4_6_rule_set/local_rules.php | 27 ++++++++++--------- .../4_6_rule_set/php_cs_fixer_rules.php | 26 +++++++++--------- .../5_0_rule_set/local_rules.php | 12 ++++----- .../5_0_rule_set/php_cs_fixer_rules.php | 12 ++++----- 4 files changed, 39 insertions(+), 38 deletions(-) diff --git a/tests/lib/PhpCsFixer/Sets/expected_rules/4_6_rule_set/local_rules.php b/tests/lib/PhpCsFixer/Sets/expected_rules/4_6_rule_set/local_rules.php index a0d84e8..bbdc5e0 100644 --- a/tests/lib/PhpCsFixer/Sets/expected_rules/4_6_rule_set/local_rules.php +++ b/tests/lib/PhpCsFixer/Sets/expected_rules/4_6_rule_set/local_rules.php @@ -21,9 +21,13 @@ 'return', ], ], - 'braces' => [ - 'allow_single_line_closure' => true, - ], + 'single_space_around_construct' => true, + 'control_structure_braces' => true, + 'control_structure_continuation_position' => true, + 'no_multiple_statements_per_line' => true, + 'declare_parentheses' => true, + 'braces_position' => true, + 'statement_indentation' => false, 'cast_spaces' => false, 'class_attributes_separation' => [ 'elements' => [ @@ -49,7 +53,7 @@ 'full_opening_tag' => true, 'function_declaration' => true, 'function_to_constant' => true, - 'function_typehint_space' => true, + 'type_declaration_spaces' => true, 'general_phpdoc_tag_rename' => true, 'header_comment' => [ 'comment_type' => 'PHPDoc', @@ -82,8 +86,8 @@ ], 'native_function_casing' => true, 'native_function_invocation' => false, - 'native_function_type_declaration_casing' => true, - 'new_with_braces' => true, + 'native_type_declaration_casing' => true, + 'new_with_parentheses' => true, 'no_alias_functions' => true, 'no_blank_lines_after_class_opening' => true, 'no_blank_lines_after_phpdoc' => true, @@ -111,13 +115,12 @@ 'no_singleline_whitespace_before_semicolons' => true, 'no_spaces_after_function_name' => true, 'no_spaces_around_offset' => true, - 'no_spaces_inside_parenthesis' => true, - 'no_trailing_comma_in_list_call' => true, - 'no_trailing_comma_in_singleline_array' => true, + 'spaces_inside_parentheses' => true, + 'no_trailing_comma_in_singleline' => true, 'no_trailing_whitespace' => true, 'no_trailing_whitespace_in_comment' => true, 'no_unneeded_control_parentheses' => true, - 'no_unneeded_curly_braces' => true, + 'no_unneeded_braces' => true, 'no_unneeded_final_method' => true, 'no_unused_imports' => true, 'no_whitespace_before_comma_in_array' => true, @@ -170,7 +173,7 @@ 'short_scalar_cast' => true, 'simplified_null_return' => false, 'single_blank_line_at_eof' => true, - 'single_blank_line_before_namespace' => true, + 'blank_lines_before_namespace' => true, 'single_class_element_per_statement' => true, 'single_import_per_statement' => true, 'single_line_after_imports' => true, @@ -191,7 +194,7 @@ 'trailing_comma_in_multiline' => true, 'trim_array_spaces' => true, 'unary_operator_spaces' => true, - 'visibility_required' => true, + 'modifier_keywords' => true, 'whitespace_after_comma_in_array' => true, 'yoda_style' => false, 'Ibexa/multiline_parameters' => true, diff --git a/tests/lib/PhpCsFixer/Sets/expected_rules/4_6_rule_set/php_cs_fixer_rules.php b/tests/lib/PhpCsFixer/Sets/expected_rules/4_6_rule_set/php_cs_fixer_rules.php index b67d1b4..1976a86 100644 --- a/tests/lib/PhpCsFixer/Sets/expected_rules/4_6_rule_set/php_cs_fixer_rules.php +++ b/tests/lib/PhpCsFixer/Sets/expected_rules/4_6_rule_set/php_cs_fixer_rules.php @@ -11,7 +11,7 @@ 'declare_equal_normalize' => true, 'lowercase_cast' => true, 'lowercase_static_reference' => true, - 'new_with_braces' => true, + 'new_with_parentheses' => true, 'no_blank_lines_after_class_opening' => true, 'no_leading_import_slash' => true, 'no_whitespace_in_blank_line' => true, @@ -21,7 +21,7 @@ 'single_import_per_statement' => true, 'single_trait_insert_per_statement' => true, 'ternary_operator_spaces' => true, - 'visibility_required' => true, + 'modifier_keywords' => true, 'blank_line_after_namespace' => true, 'constant_case' => [ 'case' => 'lower', @@ -168,16 +168,18 @@ 'concat_space' => [ 'spacing' => 'one', ], - 'braces' => [ - 'allow_single_line_closure' => true, - ], - 'no_spaces_inside_parenthesis' => true, - 'function_typehint_space' => true, - 'native_function_type_declaration_casing' => true, - 'no_trailing_comma_in_list_call' => true, - 'no_trailing_comma_in_singleline_array' => true, - 'no_unneeded_curly_braces' => true, - 'single_blank_line_before_namespace' => true, + 'braces_position' => true, + 'single_space_around_construct' => true, + 'control_structure_braces' => true, + 'control_structure_continuation_position' => true, + 'no_multiple_statements_per_line' => true, + 'declare_parentheses' => true, + 'spaces_inside_parentheses' => true, + 'type_declaration_spaces' => true, + 'native_type_declaration_casing' => true, + 'no_trailing_comma_in_singleline' => true, + 'no_unneeded_braces' => true, + 'blank_lines_before_namespace' => true, 'Ibexa/multiline_parameters' => true, 'fully_qualified_strict_types' => [ 'import_symbols' => true, diff --git a/tests/lib/PhpCsFixer/Sets/expected_rules/5_0_rule_set/local_rules.php b/tests/lib/PhpCsFixer/Sets/expected_rules/5_0_rule_set/local_rules.php index 7b482e9..b254e30 100644 --- a/tests/lib/PhpCsFixer/Sets/expected_rules/5_0_rule_set/local_rules.php +++ b/tests/lib/PhpCsFixer/Sets/expected_rules/5_0_rule_set/local_rules.php @@ -23,9 +23,8 @@ ], ], 'blank_lines_before_namespace' => true, - 'braces' => [ - 'allow_single_line_closure' => true, - ], + 'declare_parentheses' => true, + 'no_unneeded_braces' => true, 'cast_spaces' => false, 'class_attributes_separation' => [ 'elements' => [ @@ -86,8 +85,8 @@ ], 'native_function_casing' => true, 'native_function_invocation' => false, - 'native_function_type_declaration_casing' => true, - 'new_with_braces' => true, + 'native_type_declaration_casing' => true, + 'new_with_parentheses' => true, 'no_alias_functions' => true, 'no_blank_lines_after_class_opening' => true, 'no_blank_lines_after_phpdoc' => true, @@ -126,7 +125,6 @@ 'no_trailing_whitespace' => true, 'no_trailing_whitespace_in_comment' => true, 'no_unneeded_control_parentheses' => true, - 'no_unneeded_curly_braces' => true, 'no_unneeded_final_method' => true, 'no_unused_imports' => true, 'no_whitespace_before_comma_in_array' => true, @@ -214,7 +212,7 @@ 'space' => 'single', ], 'unary_operator_spaces' => true, - 'visibility_required' => true, + 'modifier_keywords' => true, 'whitespace_after_comma_in_array' => true, 'yoda_style' => false, 'Ibexa/multiline_parameters' => true, diff --git a/tests/lib/PhpCsFixer/Sets/expected_rules/5_0_rule_set/php_cs_fixer_rules.php b/tests/lib/PhpCsFixer/Sets/expected_rules/5_0_rule_set/php_cs_fixer_rules.php index aad8dbb..3232db4 100644 --- a/tests/lib/PhpCsFixer/Sets/expected_rules/5_0_rule_set/php_cs_fixer_rules.php +++ b/tests/lib/PhpCsFixer/Sets/expected_rules/5_0_rule_set/php_cs_fixer_rules.php @@ -21,7 +21,6 @@ 'declare_equal_normalize' => true, 'lowercase_cast' => true, 'lowercase_static_reference' => true, - 'new_with_braces' => true, 'no_blank_lines_after_class_opening' => true, 'no_leading_import_slash' => true, 'no_whitespace_in_blank_line' => true, @@ -31,7 +30,7 @@ 'single_import_per_statement' => true, 'single_trait_insert_per_statement' => true, 'ternary_operator_spaces' => true, - 'visibility_required' => true, + 'modifier_keywords' => true, 'blank_line_after_namespace' => true, 'constant_case' => [ 'case' => 'lower', @@ -178,16 +177,15 @@ 'trim_array_spaces' => true, 'unary_operator_spaces' => true, 'whitespace_after_comma_in_array' => true, - 'braces' => [ - 'allow_single_line_closure' => true, - ], + 'declare_parentheses' => true, + 'new_with_parentheses' => true, 'type_declaration_spaces' => [ 'elements' => [ 'function', 'property', ], ], - 'native_function_type_declaration_casing' => true, + 'native_type_declaration_casing' => true, 'no_trailing_comma_in_singleline' => [ 'elements' => [ 'arguments', @@ -196,7 +194,7 @@ 'group_import', ], ], - 'no_unneeded_curly_braces' => true, + 'no_unneeded_braces' => true, 'php_unit_test_case_static_method_calls' => [ 'call_type' => 'self', ], From def867a7fd1607ec9416081e1e0086198eb1e7e7 Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Thu, 23 Oct 2025 14:28:59 +0200 Subject: [PATCH 06/12] [CI] Fixed SonarCloud code duplication exclusion config --- .sonarcloud.properties | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.sonarcloud.properties b/.sonarcloud.properties index dc34389..904c403 100644 --- a/.sonarcloud.properties +++ b/.sonarcloud.properties @@ -1 +1,2 @@ -sonar.exclusions=tests/lib/Sets/expected_rules/**/* +# Exclude files from duplication detection +sonar.cpd.exclusions=tests/lib/PhpCsFixer/Sets/expected_rules/** From 6b5097a2dfa7aa6e98bc580fd42f7edba2746089 Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Mon, 27 Oct 2025 12:45:49 +0100 Subject: [PATCH 07/12] Explicitly configured `braces_position` rule for 4.6 set --- src/lib/PhpCsFixer/Sets/Ibexa46RuleSet.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib/PhpCsFixer/Sets/Ibexa46RuleSet.php b/src/lib/PhpCsFixer/Sets/Ibexa46RuleSet.php index 7829161..0bb2a73 100644 --- a/src/lib/PhpCsFixer/Sets/Ibexa46RuleSet.php +++ b/src/lib/PhpCsFixer/Sets/Ibexa46RuleSet.php @@ -21,7 +21,10 @@ public function getRules(): array 'control_structure_continuation_position' => true, 'no_multiple_statements_per_line' => true, 'declare_parentheses' => true, - 'braces_position' => true, + 'braces_position' => [ + 'allow_single_line_empty_anonymous_classes' => true, + 'allow_single_line_anonymous_functions' => true, + ], 'statement_indentation' => false, 'type_declaration_spaces' => true, 'native_type_declaration_casing' => true, From e72b0e1d2b8f2cd862d64fc53670adadcf184ae5 Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Mon, 27 Oct 2025 12:47:51 +0100 Subject: [PATCH 08/12] Dropped redundant `no_extra_blank_lines` rule * The rule is configured in the `AbstractIbexaRuleSet` --- src/lib/PhpCsFixer/Sets/Ibexa46RuleSet.php | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/lib/PhpCsFixer/Sets/Ibexa46RuleSet.php b/src/lib/PhpCsFixer/Sets/Ibexa46RuleSet.php index 0bb2a73..f941053 100644 --- a/src/lib/PhpCsFixer/Sets/Ibexa46RuleSet.php +++ b/src/lib/PhpCsFixer/Sets/Ibexa46RuleSet.php @@ -31,16 +31,6 @@ public function getRules(): array 'new_with_parentheses' => true, 'no_trailing_comma_in_singleline' => true, 'no_unneeded_braces' => true, - 'no_extra_blank_lines' => [ - 'tokens' => [ - 'curly_brace_block', - 'extra', - 'parenthesis_brace_block', - 'square_brace_block', - 'throw', - 'use', - ], - ], 'blank_lines_before_namespace' => true, ], ); From 0023336f88768e1fd51ab250b713049f54ebadfe Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Mon, 27 Oct 2025 12:48:13 +0100 Subject: [PATCH 09/12] Explicitly enabled `single_line_empty_body` rule after `braces_position` `single_line_empty_body` tends to conflict with `braces_position` on some environments --- src/lib/PhpCsFixer/Sets/Ibexa46RuleSet.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/PhpCsFixer/Sets/Ibexa46RuleSet.php b/src/lib/PhpCsFixer/Sets/Ibexa46RuleSet.php index f941053..225ff97 100644 --- a/src/lib/PhpCsFixer/Sets/Ibexa46RuleSet.php +++ b/src/lib/PhpCsFixer/Sets/Ibexa46RuleSet.php @@ -32,6 +32,7 @@ public function getRules(): array 'no_trailing_comma_in_singleline' => true, 'no_unneeded_braces' => true, 'blank_lines_before_namespace' => true, + 'single_line_empty_body' => true, ], ); } From ca5c63b9ce93395c9099fda43734cd16fd997351 Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Mon, 27 Oct 2025 12:49:01 +0100 Subject: [PATCH 10/12] Explicitly enabled `blank_line_between_import_groups` rule after `no_extra_blank_lines` `blank_line_between_import_groups` tends to conflict with `no_extra_blank_lines` on some environments --- src/lib/PhpCsFixer/Sets/Ibexa46RuleSet.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/PhpCsFixer/Sets/Ibexa46RuleSet.php b/src/lib/PhpCsFixer/Sets/Ibexa46RuleSet.php index 225ff97..9233d6d 100644 --- a/src/lib/PhpCsFixer/Sets/Ibexa46RuleSet.php +++ b/src/lib/PhpCsFixer/Sets/Ibexa46RuleSet.php @@ -33,6 +33,7 @@ public function getRules(): array 'no_unneeded_braces' => true, 'blank_lines_before_namespace' => true, 'single_line_empty_body' => true, + 'blank_line_between_import_groups' => true, ], ); } From 9e33c24074b36535509f4a4cc8f6760669e7883a Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Mon, 27 Oct 2025 13:43:13 +0100 Subject: [PATCH 11/12] [Composer] Bumped friendsofphp/php-cs-fixer to v3.89.1 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 2f04eef..5f81127 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ }, "require": { "php": ">=7.4", - "friendsofphp/php-cs-fixer": "v3.89.0", + "friendsofphp/php-cs-fixer": "v3.89.1", "composer-runtime-api": ">=2.0" }, "require-dev": { From 3af3fa97b2b9fc359a41eb187c0a78587ed06973 Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Mon, 27 Oct 2025 13:48:26 +0100 Subject: [PATCH 12/12] [Tests] Aligned 4.6 expected rule set with the changes --- .../Sets/expected_rules/4_6_rule_set/local_rules.php | 7 ++++++- .../expected_rules/4_6_rule_set/php_cs_fixer_rules.php | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/tests/lib/PhpCsFixer/Sets/expected_rules/4_6_rule_set/local_rules.php b/tests/lib/PhpCsFixer/Sets/expected_rules/4_6_rule_set/local_rules.php index bbdc5e0..076043f 100644 --- a/tests/lib/PhpCsFixer/Sets/expected_rules/4_6_rule_set/local_rules.php +++ b/tests/lib/PhpCsFixer/Sets/expected_rules/4_6_rule_set/local_rules.php @@ -26,7 +26,10 @@ 'control_structure_continuation_position' => true, 'no_multiple_statements_per_line' => true, 'declare_parentheses' => true, - 'braces_position' => true, + 'braces_position' => [ + 'allow_single_line_empty_anonymous_classes' => true, + 'allow_single_line_anonymous_functions' => true, + ], 'statement_indentation' => false, 'cast_spaces' => false, 'class_attributes_separation' => [ @@ -201,4 +204,6 @@ 'fully_qualified_strict_types' => [ 'import_symbols' => true, ], + 'single_line_empty_body' => true, + 'blank_line_between_import_groups' => true, ]; diff --git a/tests/lib/PhpCsFixer/Sets/expected_rules/4_6_rule_set/php_cs_fixer_rules.php b/tests/lib/PhpCsFixer/Sets/expected_rules/4_6_rule_set/php_cs_fixer_rules.php index 1976a86..b5f4b39 100644 --- a/tests/lib/PhpCsFixer/Sets/expected_rules/4_6_rule_set/php_cs_fixer_rules.php +++ b/tests/lib/PhpCsFixer/Sets/expected_rules/4_6_rule_set/php_cs_fixer_rules.php @@ -168,7 +168,10 @@ 'concat_space' => [ 'spacing' => 'one', ], - 'braces_position' => true, + 'braces_position' => [ + 'allow_single_line_empty_anonymous_classes' => true, + 'allow_single_line_anonymous_functions' => true, + ], 'single_space_around_construct' => true, 'control_structure_braces' => true, 'control_structure_continuation_position' => true, @@ -184,4 +187,6 @@ 'fully_qualified_strict_types' => [ 'import_symbols' => true, ], + 'single_line_empty_body' => true, + 'blank_line_between_import_groups' => true, ];