diff --git a/CHANGELOG.md b/CHANGELOG.md index b637b12e..e64a8802 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,17 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), For a full diff see [`5.3.3...main`][5.3.3...main]. +### Changed + +- Updated `friendsofphp/php-cs-fixer` ([#746]), by [@dependabot] +- Enabled and configured the `single_space_around_construct` fixer as a replacement for the deprecated `single_space_after_construct` fixer ([#746]), by [@localheinz] + +### Fixed + +- Stopped configuring the deprecated `braces` fixer ([#746]), by [@localheinz] +- Stopped configuring the deprecated `single_space_after_construct` fixer ([#746]), by [@localheinz] +- Configured the newly added `force` option of the `php_unit_data_provider_static` fixer ([#746]), by [@localheinz] + ## [`5.3.3`][5.3.3] For a full diff see [`5.3.2...5.3.3`][5.3.2...5.3.3]. @@ -882,6 +893,7 @@ For a full diff see [`d899e77...1.0.0`][d899e77...1.0.0]. [#718]: https://github.com/ergebnis/php-cs-fixer-config/pull/718 [#737]: https://github.com/ergebnis/php-cs-fixer-config/pull/737 [#738]: https://github.com/ergebnis/php-cs-fixer-config/pull/738 +[#746]: https://github.com/ergebnis/php-cs-fixer-config/pull/746 [@dependabot]: https://github.com/apps/dependabot [@linuxjuggler]: https://github.com/linuxjuggler diff --git a/composer.json b/composer.json index 6efe78eb..8b8e85bb 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ "require": { "php": "~8.0.0 || ~8.1.0 || ~8.2.0", "ext-filter": "*", - "friendsofphp/php-cs-fixer": "~3.15.1" + "friendsofphp/php-cs-fixer": "~3.16.0" }, "require-dev": { "ergebnis/composer-normalize": "^2.30.2", diff --git a/composer.lock b/composer.lock index b1b615be..dc915448 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "1b3a2a41883235f38ba43a696d5ceca5", + "content-hash": "f72b51a164d400ce81c8cfc46bc97f6e", "packages": [ { "name": "composer/pcre", @@ -423,16 +423,16 @@ }, { "name": "friendsofphp/php-cs-fixer", - "version": "v3.15.1", + "version": "v3.16.0", "source": { "type": "git", "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", - "reference": "d48755372a113bddb99f749e34805d83f3acfe04" + "reference": "d40f9436e1c448d309fa995ab9c14c5c7a96f2dc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/d48755372a113bddb99f749e34805d83f3acfe04", - "reference": "d48755372a113bddb99f749e34805d83f3acfe04", + "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/d40f9436e1c448d309fa995ab9c14c5c7a96f2dc", + "reference": "d40f9436e1c448d309fa995ab9c14c5c7a96f2dc", "shasum": "" }, "require": { @@ -507,7 +507,7 @@ ], "support": { "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", - "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.15.1" + "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.16.0" }, "funding": [ { @@ -515,7 +515,7 @@ "type": "github" } ], - "time": "2023-03-13T23:26:30+00:00" + "time": "2023-04-02T19:30:06+00:00" }, { "name": "psr/cache", diff --git a/src/RuleSet/Php80.php b/src/RuleSet/Php80.php index d6cf52e8..e6243f34 100644 --- a/src/RuleSet/Php80.php +++ b/src/RuleSet/Php80.php @@ -61,13 +61,6 @@ final class Php80 extends AbstractRuleSet implements ExplicitRuleSet ], ], 'blank_line_between_import_groups' => false, - 'braces' => [ - 'allow_single_line_anonymous_class_with_empty_body' => true, - 'allow_single_line_closure' => false, - 'position_after_anonymous_constructs' => 'same', - 'position_after_control_structures' => 'same', - 'position_after_functions_and_oop_constructs' => 'next', - ], 'cast_spaces' => [ 'space' => 'single', ], @@ -448,7 +441,9 @@ final class Php80 extends AbstractRuleSet implements ExplicitRuleSet 'assertSame', ], ], - 'php_unit_data_provider_static' => true, + 'php_unit_data_provider_static' => [ + 'force' => false, + ], 'php_unit_dedicate_assert' => [ 'target' => 'newest', ], @@ -697,8 +692,9 @@ final class Php80 extends AbstractRuleSet implements ExplicitRuleSet 'single_quote' => [ 'strings_containing_single_quote_chars' => false, ], - 'single_space_after_construct' => [ - 'constructs' => [ + 'single_space_around_construct' => [ + 'constructs_contain_a_single_space' => [], + 'constructs_followed_by_a_single_space' => [ 'abstract', 'as', 'attribute', @@ -759,6 +755,7 @@ final class Php80 extends AbstractRuleSet implements ExplicitRuleSet 'yield', 'yield_from', ], + 'constructs_preceded_by_a_single_space' => [], ], 'single_trait_insert_per_statement' => true, 'space_after_semicolon' => [ diff --git a/src/RuleSet/Php81.php b/src/RuleSet/Php81.php index 4e5756ec..c0342130 100644 --- a/src/RuleSet/Php81.php +++ b/src/RuleSet/Php81.php @@ -61,13 +61,6 @@ final class Php81 extends AbstractRuleSet implements ExplicitRuleSet ], ], 'blank_line_between_import_groups' => false, - 'braces' => [ - 'allow_single_line_anonymous_class_with_empty_body' => true, - 'allow_single_line_closure' => false, - 'position_after_anonymous_constructs' => 'same', - 'position_after_control_structures' => 'same', - 'position_after_functions_and_oop_constructs' => 'next', - ], 'cast_spaces' => [ 'space' => 'single', ], @@ -449,7 +442,9 @@ final class Php81 extends AbstractRuleSet implements ExplicitRuleSet 'assertSame', ], ], - 'php_unit_data_provider_static' => true, + 'php_unit_data_provider_static' => [ + 'force' => false, + ], 'php_unit_dedicate_assert' => [ 'target' => 'newest', ], @@ -698,8 +693,9 @@ final class Php81 extends AbstractRuleSet implements ExplicitRuleSet 'single_quote' => [ 'strings_containing_single_quote_chars' => false, ], - 'single_space_after_construct' => [ - 'constructs' => [ + 'single_space_around_construct' => [ + 'constructs_contain_a_single_space' => [], + 'constructs_followed_by_a_single_space' => [ 'abstract', 'as', 'attribute', @@ -716,7 +712,6 @@ final class Php81 extends AbstractRuleSet implements ExplicitRuleSet 'echo', 'else', 'elseif', - 'enum', 'extends', 'final', 'finally', @@ -744,7 +739,6 @@ final class Php81 extends AbstractRuleSet implements ExplicitRuleSet 'private', 'protected', 'public', - 'readonly', 'require', 'require_once', 'return', @@ -762,6 +756,7 @@ final class Php81 extends AbstractRuleSet implements ExplicitRuleSet 'yield', 'yield_from', ], + 'constructs_preceded_by_a_single_space' => [], ], 'single_trait_insert_per_statement' => true, 'space_after_semicolon' => [ diff --git a/src/RuleSet/Php82.php b/src/RuleSet/Php82.php index fc654219..331189f0 100644 --- a/src/RuleSet/Php82.php +++ b/src/RuleSet/Php82.php @@ -61,13 +61,6 @@ final class Php82 extends AbstractRuleSet implements ExplicitRuleSet ], ], 'blank_line_between_import_groups' => false, - 'braces' => [ - 'allow_single_line_anonymous_class_with_empty_body' => true, - 'allow_single_line_closure' => false, - 'position_after_anonymous_constructs' => 'same', - 'position_after_control_structures' => 'same', - 'position_after_functions_and_oop_constructs' => 'next', - ], 'cast_spaces' => [ 'space' => 'single', ], @@ -449,7 +442,9 @@ final class Php82 extends AbstractRuleSet implements ExplicitRuleSet 'assertSame', ], ], - 'php_unit_data_provider_static' => true, + 'php_unit_data_provider_static' => [ + 'force' => false, + ], 'php_unit_dedicate_assert' => [ 'target' => 'newest', ], @@ -698,8 +693,9 @@ final class Php82 extends AbstractRuleSet implements ExplicitRuleSet 'single_quote' => [ 'strings_containing_single_quote_chars' => false, ], - 'single_space_after_construct' => [ - 'constructs' => [ + 'single_space_around_construct' => [ + 'constructs_contain_a_single_space' => [], + 'constructs_followed_by_a_single_space' => [ 'abstract', 'as', 'attribute', @@ -716,7 +712,6 @@ final class Php82 extends AbstractRuleSet implements ExplicitRuleSet 'echo', 'else', 'elseif', - 'enum', 'extends', 'final', 'finally', @@ -744,7 +739,6 @@ final class Php82 extends AbstractRuleSet implements ExplicitRuleSet 'private', 'protected', 'public', - 'readonly', 'require', 'require_once', 'return', @@ -762,6 +756,7 @@ final class Php82 extends AbstractRuleSet implements ExplicitRuleSet 'yield', 'yield_from', ], + 'constructs_preceded_by_a_single_space' => [], ], 'single_trait_insert_per_statement' => true, 'space_after_semicolon' => [ diff --git a/test/Unit/RuleSet/Php80Test.php b/test/Unit/RuleSet/Php80Test.php index 7cd74671..5003b9fd 100644 --- a/test/Unit/RuleSet/Php80Test.php +++ b/test/Unit/RuleSet/Php80Test.php @@ -67,13 +67,6 @@ final class Php80Test extends ExplicitRuleSetTestCase ], ], 'blank_line_between_import_groups' => false, - 'braces' => [ - 'allow_single_line_anonymous_class_with_empty_body' => true, - 'allow_single_line_closure' => false, - 'position_after_anonymous_constructs' => 'same', - 'position_after_control_structures' => 'same', - 'position_after_functions_and_oop_constructs' => 'next', - ], 'cast_spaces' => [ 'space' => 'single', ], @@ -454,7 +447,9 @@ final class Php80Test extends ExplicitRuleSetTestCase 'assertSame', ], ], - 'php_unit_data_provider_static' => true, + 'php_unit_data_provider_static' => [ + 'force' => false, + ], 'php_unit_dedicate_assert' => [ 'target' => 'newest', ], @@ -703,8 +698,9 @@ final class Php80Test extends ExplicitRuleSetTestCase 'single_quote' => [ 'strings_containing_single_quote_chars' => false, ], - 'single_space_after_construct' => [ - 'constructs' => [ + 'single_space_around_construct' => [ + 'constructs_contain_a_single_space' => [], + 'constructs_followed_by_a_single_space' => [ 'abstract', 'as', 'attribute', @@ -765,6 +761,7 @@ final class Php80Test extends ExplicitRuleSetTestCase 'yield', 'yield_from', ], + 'constructs_preceded_by_a_single_space' => [], ], 'single_trait_insert_per_statement' => true, 'space_after_semicolon' => [ diff --git a/test/Unit/RuleSet/Php81Test.php b/test/Unit/RuleSet/Php81Test.php index d351f46d..1c7b21d7 100644 --- a/test/Unit/RuleSet/Php81Test.php +++ b/test/Unit/RuleSet/Php81Test.php @@ -67,13 +67,6 @@ final class Php81Test extends ExplicitRuleSetTestCase ], ], 'blank_line_between_import_groups' => false, - 'braces' => [ - 'allow_single_line_anonymous_class_with_empty_body' => true, - 'allow_single_line_closure' => false, - 'position_after_anonymous_constructs' => 'same', - 'position_after_control_structures' => 'same', - 'position_after_functions_and_oop_constructs' => 'next', - ], 'cast_spaces' => [ 'space' => 'single', ], @@ -455,7 +448,9 @@ final class Php81Test extends ExplicitRuleSetTestCase 'assertSame', ], ], - 'php_unit_data_provider_static' => true, + 'php_unit_data_provider_static' => [ + 'force' => false, + ], 'php_unit_dedicate_assert' => [ 'target' => 'newest', ], @@ -704,8 +699,9 @@ final class Php81Test extends ExplicitRuleSetTestCase 'single_quote' => [ 'strings_containing_single_quote_chars' => false, ], - 'single_space_after_construct' => [ - 'constructs' => [ + 'single_space_around_construct' => [ + 'constructs_contain_a_single_space' => [], + 'constructs_followed_by_a_single_space' => [ 'abstract', 'as', 'attribute', @@ -722,7 +718,6 @@ final class Php81Test extends ExplicitRuleSetTestCase 'echo', 'else', 'elseif', - 'enum', 'extends', 'final', 'finally', @@ -750,7 +745,6 @@ final class Php81Test extends ExplicitRuleSetTestCase 'private', 'protected', 'public', - 'readonly', 'require', 'require_once', 'return', @@ -768,6 +762,7 @@ final class Php81Test extends ExplicitRuleSetTestCase 'yield', 'yield_from', ], + 'constructs_preceded_by_a_single_space' => [], ], 'single_trait_insert_per_statement' => true, 'space_after_semicolon' => [ diff --git a/test/Unit/RuleSet/Php82Test.php b/test/Unit/RuleSet/Php82Test.php index 98672e61..ac079913 100644 --- a/test/Unit/RuleSet/Php82Test.php +++ b/test/Unit/RuleSet/Php82Test.php @@ -67,13 +67,6 @@ final class Php82Test extends ExplicitRuleSetTestCase ], ], 'blank_line_between_import_groups' => false, - 'braces' => [ - 'allow_single_line_anonymous_class_with_empty_body' => true, - 'allow_single_line_closure' => false, - 'position_after_anonymous_constructs' => 'same', - 'position_after_control_structures' => 'same', - 'position_after_functions_and_oop_constructs' => 'next', - ], 'cast_spaces' => [ 'space' => 'single', ], @@ -455,7 +448,9 @@ final class Php82Test extends ExplicitRuleSetTestCase 'assertSame', ], ], - 'php_unit_data_provider_static' => true, + 'php_unit_data_provider_static' => [ + 'force' => false, + ], 'php_unit_dedicate_assert' => [ 'target' => 'newest', ], @@ -704,8 +699,9 @@ final class Php82Test extends ExplicitRuleSetTestCase 'single_quote' => [ 'strings_containing_single_quote_chars' => false, ], - 'single_space_after_construct' => [ - 'constructs' => [ + 'single_space_around_construct' => [ + 'constructs_contain_a_single_space' => [], + 'constructs_followed_by_a_single_space' => [ 'abstract', 'as', 'attribute', @@ -722,7 +718,6 @@ final class Php82Test extends ExplicitRuleSetTestCase 'echo', 'else', 'elseif', - 'enum', 'extends', 'final', 'finally', @@ -750,7 +745,6 @@ final class Php82Test extends ExplicitRuleSetTestCase 'private', 'protected', 'public', - 'readonly', 'require', 'require_once', 'return', @@ -768,6 +762,7 @@ final class Php82Test extends ExplicitRuleSetTestCase 'yield', 'yield_from', ], + 'constructs_preceded_by_a_single_space' => [], ], 'single_trait_insert_per_statement' => true, 'space_after_semicolon' => [