From d477b11d2c5881b70f901378e84d1e1306ecc0f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Tue, 19 Sep 2023 12:32:08 +0200 Subject: [PATCH 1/2] Enhancement: Require kubawerlos/php-cs-fixer-custom-fixers --- composer.json | 3 ++- composer.lock | 48 +++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 49 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 7afd36ee..bd588358 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,8 @@ "php": "~8.1.0 || ~8.2.0", "ext-filter": "*", "erickskrauch/php-cs-fixer-custom-fixers": "~1.2.0", - "friendsofphp/php-cs-fixer": "~3.27.0" + "friendsofphp/php-cs-fixer": "~3.27.0", + "kubawerlos/php-cs-fixer-custom-fixers": "~3.16.2" }, "require-dev": { "ergebnis/composer-normalize": "^2.37.0", diff --git a/composer.lock b/composer.lock index 4419e6d7..e61c07ec 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": "49af1a04f7de8d2b0c651f24dff890d4", + "content-hash": "86301cd73b1f0e560844287f606eab91", "packages": [ { "name": "composer/pcre", @@ -381,6 +381,52 @@ ], "time": "2023-09-17T14:37:54+00:00" }, + { + "name": "kubawerlos/php-cs-fixer-custom-fixers", + "version": "v3.16.2", + "source": { + "type": "git", + "url": "https://github.com/kubawerlos/php-cs-fixer-custom-fixers.git", + "reference": "d3f2590069d06ba49ad24cac03f802e8ad0aaeba" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/kubawerlos/php-cs-fixer-custom-fixers/zipball/d3f2590069d06ba49ad24cac03f802e8ad0aaeba", + "reference": "d3f2590069d06ba49ad24cac03f802e8ad0aaeba", + "shasum": "" + }, + "require": { + "ext-filter": "*", + "ext-tokenizer": "*", + "friendsofphp/php-cs-fixer": "^3.22", + "php": "^7.4 || ^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.6.4 || ^10.0.14" + }, + "type": "library", + "autoload": { + "psr-4": { + "PhpCsFixerCustomFixers\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kuba Werłos", + "email": "werlos@gmail.com" + } + ], + "description": "A set of custom fixers for PHP CS Fixer", + "support": { + "issues": "https://github.com/kubawerlos/php-cs-fixer-custom-fixers/issues", + "source": "https://github.com/kubawerlos/php-cs-fixer-custom-fixers/tree/v3.16.2" + }, + "time": "2023-08-06T13:50:15+00:00" + }, { "name": "psr/container", "version": "2.0.2", From ee5d93397a39edb728b732976322e9bc6c3b7583 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Tue, 19 Sep 2023 12:45:06 +0200 Subject: [PATCH 2/2] Enhancement: Enable PhpCsFixerCustomFixers/phpdoc_array_style fixer --- CHANGELOG.md | 5 +++++ README.md | 1 + src/RuleSet/Php53.php | 7 ++++++- src/RuleSet/Php54.php | 7 ++++++- src/RuleSet/Php55.php | 7 ++++++- src/RuleSet/Php56.php | 7 ++++++- src/RuleSet/Php70.php | 7 ++++++- src/RuleSet/Php71.php | 7 ++++++- src/RuleSet/Php72.php | 7 ++++++- src/RuleSet/Php73.php | 7 ++++++- src/RuleSet/Php74.php | 7 ++++++- src/RuleSet/Php80.php | 7 ++++++- src/RuleSet/Php81.php | 7 ++++++- src/RuleSet/Php82.php | 7 ++++++- test/Unit/RuleSet/Php53Test.php | 7 ++++++- test/Unit/RuleSet/Php54Test.php | 7 ++++++- test/Unit/RuleSet/Php55Test.php | 7 ++++++- test/Unit/RuleSet/Php56Test.php | 7 ++++++- test/Unit/RuleSet/Php70Test.php | 7 ++++++- test/Unit/RuleSet/Php71Test.php | 7 ++++++- test/Unit/RuleSet/Php72Test.php | 7 ++++++- test/Unit/RuleSet/Php73Test.php | 7 ++++++- test/Unit/RuleSet/Php74Test.php | 7 ++++++- test/Unit/RuleSet/Php80Test.php | 7 ++++++- test/Unit/RuleSet/Php81Test.php | 7 ++++++- test/Unit/RuleSet/Php82Test.php | 7 ++++++- 26 files changed, 150 insertions(+), 24 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dffeb73b..ed5ff879 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), For a full diff see [`6.1.0...main`][6.1.0...main]. +### Changed + +- Required [`kubawerlos/php-cs-fixer-custom-fixers`](https://github.com/kubawerlos/php-cs-fixer-custom-fixers) and enabled the [`PhpCsFixerCustomFixers/phpdoc_array_style`](https://github.com/kubawerlos/php-cs-fixer-custom-fixers/tree/v3.16.2#phpdocarraystylefixer) fixer ([#894]), by [@localheinz] + ## [`6.1.0`][6.1.0] For a full diff see [`6.0.0...6.1.0`][6.0.0...6.1.0]. @@ -1225,6 +1229,7 @@ For a full diff see [`d899e77...1.0.0`][d899e77...1.0.0]. [#891]: https://github.com/ergebnis/php-cs-fixer-config/pull/891 [#892]: https://github.com/ergebnis/php-cs-fixer-config/pull/892 [#893]: https://github.com/ergebnis/php-cs-fixer-config/pull/893 +[#894]: https://github.com/ergebnis/php-cs-fixer-config/pull/894 [@dependabot]: https://github.com/apps/dependabot [@linuxjuggler]: https://github.com/linuxjuggler diff --git a/README.md b/README.md index 95ee0ec2..652891b4 100644 --- a/README.md +++ b/README.md @@ -328,6 +328,7 @@ This package is inspired by and also replaces [`localheinz/php-cs-fixer-config`] This package requires and enables custom fixers from the following packages: - [`erickskrauch/php-cs-fixer-custom-fixers`](https://github.com/erickskrauch/php-cs-fixer-custom-fixers) +- [`kubawerlos/php-cs-fixer-custom-fixers`](https://github.com/kubawerlos/php-cs-fixer-custom-fixers) ## Social diff --git a/src/RuleSet/Php53.php b/src/RuleSet/Php53.php index 5a494e2d..3f1be1d7 100644 --- a/src/RuleSet/Php53.php +++ b/src/RuleSet/Php53.php @@ -19,6 +19,7 @@ use Ergebnis\PhpCsFixer\Config\Rules; use Ergebnis\PhpCsFixer\Config\RuleSet; use ErickSkrauch\PhpCsFixer; +use PhpCsFixerCustomFixers\Fixer; final class Php53 { @@ -31,7 +32,10 @@ public static function create(): RuleSet ); return RuleSet::create( - Fixers::fromFixers(new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer()), + Fixers::fromFixers( + new Fixer\PhpdocArrayStyleFixer(), + new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(), + ), Name::fromString(\sprintf( 'ergebnis (PHP %d.%d)', $phpVersion->major()->toInt(), @@ -40,6 +44,7 @@ public static function create(): RuleSet $phpVersion, Rules::fromArray([ 'ErickSkrauch/line_break_after_statements' => true, + 'PhpCsFixerCustomFixers/phpdoc_array_style' => true, 'align_multiline_comment' => [ 'comment_type' => 'all_multiline', ], diff --git a/src/RuleSet/Php54.php b/src/RuleSet/Php54.php index 78435499..a570866c 100644 --- a/src/RuleSet/Php54.php +++ b/src/RuleSet/Php54.php @@ -19,6 +19,7 @@ use Ergebnis\PhpCsFixer\Config\Rules; use Ergebnis\PhpCsFixer\Config\RuleSet; use ErickSkrauch\PhpCsFixer; +use PhpCsFixerCustomFixers\Fixer; final class Php54 { @@ -31,7 +32,10 @@ public static function create(): RuleSet ); return RuleSet::create( - Fixers::fromFixers(new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer()), + Fixers::fromFixers( + new Fixer\PhpdocArrayStyleFixer(), + new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(), + ), Name::fromString(\sprintf( 'ergebnis (PHP %d.%d)', $phpVersion->major()->toInt(), @@ -40,6 +44,7 @@ public static function create(): RuleSet $phpVersion, Rules::fromArray([ 'ErickSkrauch/line_break_after_statements' => true, + 'PhpCsFixerCustomFixers/phpdoc_array_style' => true, 'align_multiline_comment' => [ 'comment_type' => 'all_multiline', ], diff --git a/src/RuleSet/Php55.php b/src/RuleSet/Php55.php index 9674c644..ad2fdcc1 100644 --- a/src/RuleSet/Php55.php +++ b/src/RuleSet/Php55.php @@ -19,6 +19,7 @@ use Ergebnis\PhpCsFixer\Config\Rules; use Ergebnis\PhpCsFixer\Config\RuleSet; use ErickSkrauch\PhpCsFixer; +use PhpCsFixerCustomFixers\Fixer; final class Php55 { @@ -31,7 +32,10 @@ public static function create(): RuleSet ); return RuleSet::create( - Fixers::fromFixers(new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer()), + Fixers::fromFixers( + new Fixer\PhpdocArrayStyleFixer(), + new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(), + ), Name::fromString(\sprintf( 'ergebnis (PHP %d.%d)', $phpVersion->major()->toInt(), @@ -40,6 +44,7 @@ public static function create(): RuleSet $phpVersion, Rules::fromArray([ 'ErickSkrauch/line_break_after_statements' => true, + 'PhpCsFixerCustomFixers/phpdoc_array_style' => true, 'align_multiline_comment' => [ 'comment_type' => 'all_multiline', ], diff --git a/src/RuleSet/Php56.php b/src/RuleSet/Php56.php index 1cdf2361..23b722a5 100644 --- a/src/RuleSet/Php56.php +++ b/src/RuleSet/Php56.php @@ -19,6 +19,7 @@ use Ergebnis\PhpCsFixer\Config\Rules; use Ergebnis\PhpCsFixer\Config\RuleSet; use ErickSkrauch\PhpCsFixer; +use PhpCsFixerCustomFixers\Fixer; final class Php56 { @@ -31,7 +32,10 @@ public static function create(): RuleSet ); return RuleSet::create( - Fixers::fromFixers(new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer()), + Fixers::fromFixers( + new Fixer\PhpdocArrayStyleFixer(), + new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(), + ), Name::fromString(\sprintf( 'ergebnis (PHP %d.%d)', $phpVersion->major()->toInt(), @@ -40,6 +44,7 @@ public static function create(): RuleSet $phpVersion, Rules::fromArray([ 'ErickSkrauch/line_break_after_statements' => true, + 'PhpCsFixerCustomFixers/phpdoc_array_style' => true, 'align_multiline_comment' => [ 'comment_type' => 'all_multiline', ], diff --git a/src/RuleSet/Php70.php b/src/RuleSet/Php70.php index a482223b..ee70a850 100644 --- a/src/RuleSet/Php70.php +++ b/src/RuleSet/Php70.php @@ -19,6 +19,7 @@ use Ergebnis\PhpCsFixer\Config\Rules; use Ergebnis\PhpCsFixer\Config\RuleSet; use ErickSkrauch\PhpCsFixer; +use PhpCsFixerCustomFixers\Fixer; final class Php70 { @@ -31,7 +32,10 @@ public static function create(): RuleSet ); return RuleSet::create( - Fixers::fromFixers(new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer()), + Fixers::fromFixers( + new Fixer\PhpdocArrayStyleFixer(), + new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(), + ), Name::fromString(\sprintf( 'ergebnis (PHP %d.%d)', $phpVersion->major()->toInt(), @@ -40,6 +44,7 @@ public static function create(): RuleSet $phpVersion, Rules::fromArray([ 'ErickSkrauch/line_break_after_statements' => true, + 'PhpCsFixerCustomFixers/phpdoc_array_style' => true, 'align_multiline_comment' => [ 'comment_type' => 'all_multiline', ], diff --git a/src/RuleSet/Php71.php b/src/RuleSet/Php71.php index 09d0b75c..f46622bc 100644 --- a/src/RuleSet/Php71.php +++ b/src/RuleSet/Php71.php @@ -19,6 +19,7 @@ use Ergebnis\PhpCsFixer\Config\Rules; use Ergebnis\PhpCsFixer\Config\RuleSet; use ErickSkrauch\PhpCsFixer; +use PhpCsFixerCustomFixers\Fixer; final class Php71 { @@ -31,7 +32,10 @@ public static function create(): RuleSet ); return RuleSet::create( - Fixers::fromFixers(new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer()), + Fixers::fromFixers( + new Fixer\PhpdocArrayStyleFixer(), + new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(), + ), Name::fromString(\sprintf( 'ergebnis (PHP %d.%d)', $phpVersion->major()->toInt(), @@ -40,6 +44,7 @@ public static function create(): RuleSet $phpVersion, Rules::fromArray([ 'ErickSkrauch/line_break_after_statements' => true, + 'PhpCsFixerCustomFixers/phpdoc_array_style' => true, 'align_multiline_comment' => [ 'comment_type' => 'all_multiline', ], diff --git a/src/RuleSet/Php72.php b/src/RuleSet/Php72.php index 2d11c410..a1c85b0a 100644 --- a/src/RuleSet/Php72.php +++ b/src/RuleSet/Php72.php @@ -19,6 +19,7 @@ use Ergebnis\PhpCsFixer\Config\Rules; use Ergebnis\PhpCsFixer\Config\RuleSet; use ErickSkrauch\PhpCsFixer; +use PhpCsFixerCustomFixers\Fixer; final class Php72 { @@ -31,7 +32,10 @@ public static function create(): RuleSet ); return RuleSet::create( - Fixers::fromFixers(new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer()), + Fixers::fromFixers( + new Fixer\PhpdocArrayStyleFixer(), + new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(), + ), Name::fromString(\sprintf( 'ergebnis (PHP %d.%d)', $phpVersion->major()->toInt(), @@ -40,6 +44,7 @@ public static function create(): RuleSet $phpVersion, Rules::fromArray([ 'ErickSkrauch/line_break_after_statements' => true, + 'PhpCsFixerCustomFixers/phpdoc_array_style' => true, 'align_multiline_comment' => [ 'comment_type' => 'all_multiline', ], diff --git a/src/RuleSet/Php73.php b/src/RuleSet/Php73.php index 0056ffaa..04b46d1e 100644 --- a/src/RuleSet/Php73.php +++ b/src/RuleSet/Php73.php @@ -19,6 +19,7 @@ use Ergebnis\PhpCsFixer\Config\Rules; use Ergebnis\PhpCsFixer\Config\RuleSet; use ErickSkrauch\PhpCsFixer; +use PhpCsFixerCustomFixers\Fixer; final class Php73 { @@ -31,7 +32,10 @@ public static function create(): RuleSet ); return RuleSet::create( - Fixers::fromFixers(new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer()), + Fixers::fromFixers( + new Fixer\PhpdocArrayStyleFixer(), + new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(), + ), Name::fromString(\sprintf( 'ergebnis (PHP %d.%d)', $phpVersion->major()->toInt(), @@ -40,6 +44,7 @@ public static function create(): RuleSet $phpVersion, Rules::fromArray([ 'ErickSkrauch/line_break_after_statements' => true, + 'PhpCsFixerCustomFixers/phpdoc_array_style' => true, 'align_multiline_comment' => [ 'comment_type' => 'all_multiline', ], diff --git a/src/RuleSet/Php74.php b/src/RuleSet/Php74.php index d76851ac..8054b2f8 100644 --- a/src/RuleSet/Php74.php +++ b/src/RuleSet/Php74.php @@ -19,6 +19,7 @@ use Ergebnis\PhpCsFixer\Config\Rules; use Ergebnis\PhpCsFixer\Config\RuleSet; use ErickSkrauch\PhpCsFixer; +use PhpCsFixerCustomFixers\Fixer; final class Php74 { @@ -31,7 +32,10 @@ public static function create(): RuleSet ); return RuleSet::create( - Fixers::fromFixers(new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer()), + Fixers::fromFixers( + new Fixer\PhpdocArrayStyleFixer(), + new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(), + ), Name::fromString(\sprintf( 'ergebnis (PHP %d.%d)', $phpVersion->major()->toInt(), @@ -40,6 +44,7 @@ public static function create(): RuleSet $phpVersion, Rules::fromArray([ 'ErickSkrauch/line_break_after_statements' => true, + 'PhpCsFixerCustomFixers/phpdoc_array_style' => true, 'align_multiline_comment' => [ 'comment_type' => 'all_multiline', ], diff --git a/src/RuleSet/Php80.php b/src/RuleSet/Php80.php index b62cd5f2..8ec2a8ed 100644 --- a/src/RuleSet/Php80.php +++ b/src/RuleSet/Php80.php @@ -19,6 +19,7 @@ use Ergebnis\PhpCsFixer\Config\Rules; use Ergebnis\PhpCsFixer\Config\RuleSet; use ErickSkrauch\PhpCsFixer; +use PhpCsFixerCustomFixers\Fixer; final class Php80 { @@ -31,7 +32,10 @@ public static function create(): RuleSet ); return RuleSet::create( - Fixers::fromFixers(new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer()), + Fixers::fromFixers( + new Fixer\PhpdocArrayStyleFixer(), + new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(), + ), Name::fromString(\sprintf( 'ergebnis (PHP %d.%d)', $phpVersion->major()->toInt(), @@ -40,6 +44,7 @@ public static function create(): RuleSet $phpVersion, Rules::fromArray([ 'ErickSkrauch/line_break_after_statements' => true, + 'PhpCsFixerCustomFixers/phpdoc_array_style' => true, 'align_multiline_comment' => [ 'comment_type' => 'all_multiline', ], diff --git a/src/RuleSet/Php81.php b/src/RuleSet/Php81.php index 57623579..edf02727 100644 --- a/src/RuleSet/Php81.php +++ b/src/RuleSet/Php81.php @@ -19,6 +19,7 @@ use Ergebnis\PhpCsFixer\Config\Rules; use Ergebnis\PhpCsFixer\Config\RuleSet; use ErickSkrauch\PhpCsFixer; +use PhpCsFixerCustomFixers\Fixer; final class Php81 { @@ -31,7 +32,10 @@ public static function create(): RuleSet ); return RuleSet::create( - Fixers::fromFixers(new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer()), + Fixers::fromFixers( + new Fixer\PhpdocArrayStyleFixer(), + new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(), + ), Name::fromString(\sprintf( 'ergebnis (PHP %d.%d)', $phpVersion->major()->toInt(), @@ -40,6 +44,7 @@ public static function create(): RuleSet $phpVersion, Rules::fromArray([ 'ErickSkrauch/line_break_after_statements' => true, + 'PhpCsFixerCustomFixers/phpdoc_array_style' => true, 'align_multiline_comment' => [ 'comment_type' => 'all_multiline', ], diff --git a/src/RuleSet/Php82.php b/src/RuleSet/Php82.php index b380f394..19711a79 100644 --- a/src/RuleSet/Php82.php +++ b/src/RuleSet/Php82.php @@ -19,6 +19,7 @@ use Ergebnis\PhpCsFixer\Config\Rules; use Ergebnis\PhpCsFixer\Config\RuleSet; use ErickSkrauch\PhpCsFixer; +use PhpCsFixerCustomFixers\Fixer; final class Php82 { @@ -31,7 +32,10 @@ public static function create(): RuleSet ); return RuleSet::create( - Fixers::fromFixers(new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer()), + Fixers::fromFixers( + new Fixer\PhpdocArrayStyleFixer(), + new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(), + ), Name::fromString(\sprintf( 'ergebnis (PHP %d.%d)', $phpVersion->major()->toInt(), @@ -40,6 +44,7 @@ public static function create(): RuleSet $phpVersion, Rules::fromArray([ 'ErickSkrauch/line_break_after_statements' => true, + 'PhpCsFixerCustomFixers/phpdoc_array_style' => true, 'align_multiline_comment' => [ 'comment_type' => 'all_multiline', ], diff --git a/test/Unit/RuleSet/Php53Test.php b/test/Unit/RuleSet/Php53Test.php index f8f26636..8a9e48fc 100644 --- a/test/Unit/RuleSet/Php53Test.php +++ b/test/Unit/RuleSet/Php53Test.php @@ -20,6 +20,7 @@ use Ergebnis\PhpCsFixer\Config\Rules; use Ergebnis\PhpCsFixer\Config\RuleSet; use ErickSkrauch\PhpCsFixer; +use PhpCsFixerCustomFixers\Fixer; use PHPUnit\Framework; #[Framework\Attributes\CoversClass(RuleSet\Php53::class)] @@ -41,7 +42,10 @@ protected static function createRuleSet(): RuleSet protected function expectedCustomFixers(): Fixers { - return Fixers::fromFixers(new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer()); + return Fixers::fromFixers( + new Fixer\PhpdocArrayStyleFixer(), + new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(), + ); } protected function expectedName(): Name @@ -53,6 +57,7 @@ protected function expectedRules(): Rules { return Rules::fromArray([ 'ErickSkrauch/line_break_after_statements' => true, + 'PhpCsFixerCustomFixers/phpdoc_array_style' => true, 'align_multiline_comment' => [ 'comment_type' => 'all_multiline', ], diff --git a/test/Unit/RuleSet/Php54Test.php b/test/Unit/RuleSet/Php54Test.php index ef9c137a..1d24043b 100644 --- a/test/Unit/RuleSet/Php54Test.php +++ b/test/Unit/RuleSet/Php54Test.php @@ -20,6 +20,7 @@ use Ergebnis\PhpCsFixer\Config\Rules; use Ergebnis\PhpCsFixer\Config\RuleSet; use ErickSkrauch\PhpCsFixer; +use PhpCsFixerCustomFixers\Fixer; use PHPUnit\Framework; #[Framework\Attributes\CoversClass(RuleSet\Php54::class)] @@ -41,7 +42,10 @@ protected static function createRuleSet(): RuleSet protected function expectedCustomFixers(): Fixers { - return Fixers::fromFixers(new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer()); + return Fixers::fromFixers( + new Fixer\PhpdocArrayStyleFixer(), + new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(), + ); } protected function expectedName(): Name @@ -53,6 +57,7 @@ protected function expectedRules(): Rules { return Rules::fromArray([ 'ErickSkrauch/line_break_after_statements' => true, + 'PhpCsFixerCustomFixers/phpdoc_array_style' => true, 'align_multiline_comment' => [ 'comment_type' => 'all_multiline', ], diff --git a/test/Unit/RuleSet/Php55Test.php b/test/Unit/RuleSet/Php55Test.php index 2e9d1355..c22f1b2e 100644 --- a/test/Unit/RuleSet/Php55Test.php +++ b/test/Unit/RuleSet/Php55Test.php @@ -20,6 +20,7 @@ use Ergebnis\PhpCsFixer\Config\Rules; use Ergebnis\PhpCsFixer\Config\RuleSet; use ErickSkrauch\PhpCsFixer; +use PhpCsFixerCustomFixers\Fixer; use PHPUnit\Framework; #[Framework\Attributes\CoversClass(RuleSet\Php55::class)] @@ -36,7 +37,10 @@ final class Php55Test extends ExplicitRuleSetTestCase { protected function expectedCustomFixers(): Fixers { - return Fixers::fromFixers(new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer()); + return Fixers::fromFixers( + new Fixer\PhpdocArrayStyleFixer(), + new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(), + ); } protected static function createRuleSet(): RuleSet @@ -53,6 +57,7 @@ protected function expectedRules(): Rules { return Rules::fromArray([ 'ErickSkrauch/line_break_after_statements' => true, + 'PhpCsFixerCustomFixers/phpdoc_array_style' => true, 'align_multiline_comment' => [ 'comment_type' => 'all_multiline', ], diff --git a/test/Unit/RuleSet/Php56Test.php b/test/Unit/RuleSet/Php56Test.php index 012ac184..86935935 100644 --- a/test/Unit/RuleSet/Php56Test.php +++ b/test/Unit/RuleSet/Php56Test.php @@ -20,6 +20,7 @@ use Ergebnis\PhpCsFixer\Config\Rules; use Ergebnis\PhpCsFixer\Config\RuleSet; use ErickSkrauch\PhpCsFixer; +use PhpCsFixerCustomFixers\Fixer; use PHPUnit\Framework; #[Framework\Attributes\CoversClass(RuleSet\Php56::class)] @@ -41,7 +42,10 @@ protected static function createRuleSet(): RuleSet protected function expectedCustomFixers(): Fixers { - return Fixers::fromFixers(new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer()); + return Fixers::fromFixers( + new Fixer\PhpdocArrayStyleFixer(), + new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(), + ); } protected function expectedName(): Name @@ -53,6 +57,7 @@ protected function expectedRules(): Rules { return Rules::fromArray([ 'ErickSkrauch/line_break_after_statements' => true, + 'PhpCsFixerCustomFixers/phpdoc_array_style' => true, 'align_multiline_comment' => [ 'comment_type' => 'all_multiline', ], diff --git a/test/Unit/RuleSet/Php70Test.php b/test/Unit/RuleSet/Php70Test.php index ab9cac93..d50ec67b 100644 --- a/test/Unit/RuleSet/Php70Test.php +++ b/test/Unit/RuleSet/Php70Test.php @@ -20,6 +20,7 @@ use Ergebnis\PhpCsFixer\Config\Rules; use Ergebnis\PhpCsFixer\Config\RuleSet; use ErickSkrauch\PhpCsFixer; +use PhpCsFixerCustomFixers\Fixer; use PHPUnit\Framework; #[Framework\Attributes\CoversClass(RuleSet\Php70::class)] @@ -41,7 +42,10 @@ protected static function createRuleSet(): RuleSet protected function expectedCustomFixers(): Fixers { - return Fixers::fromFixers(new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer()); + return Fixers::fromFixers( + new Fixer\PhpdocArrayStyleFixer(), + new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(), + ); } protected function expectedName(): Name @@ -53,6 +57,7 @@ protected function expectedRules(): Rules { return Rules::fromArray([ 'ErickSkrauch/line_break_after_statements' => true, + 'PhpCsFixerCustomFixers/phpdoc_array_style' => true, 'align_multiline_comment' => [ 'comment_type' => 'all_multiline', ], diff --git a/test/Unit/RuleSet/Php71Test.php b/test/Unit/RuleSet/Php71Test.php index b870bb48..37ab2e47 100644 --- a/test/Unit/RuleSet/Php71Test.php +++ b/test/Unit/RuleSet/Php71Test.php @@ -20,6 +20,7 @@ use Ergebnis\PhpCsFixer\Config\Rules; use Ergebnis\PhpCsFixer\Config\RuleSet; use ErickSkrauch\PhpCsFixer; +use PhpCsFixerCustomFixers\Fixer; use PHPUnit\Framework; #[Framework\Attributes\CoversClass(RuleSet\Php71::class)] @@ -41,7 +42,10 @@ protected static function createRuleSet(): RuleSet protected function expectedCustomFixers(): Fixers { - return Fixers::fromFixers(new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer()); + return Fixers::fromFixers( + new Fixer\PhpdocArrayStyleFixer(), + new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(), + ); } protected function expectedName(): Name @@ -53,6 +57,7 @@ protected function expectedRules(): Rules { return Rules::fromArray([ 'ErickSkrauch/line_break_after_statements' => true, + 'PhpCsFixerCustomFixers/phpdoc_array_style' => true, 'align_multiline_comment' => [ 'comment_type' => 'all_multiline', ], diff --git a/test/Unit/RuleSet/Php72Test.php b/test/Unit/RuleSet/Php72Test.php index e842dacf..8deb1b37 100644 --- a/test/Unit/RuleSet/Php72Test.php +++ b/test/Unit/RuleSet/Php72Test.php @@ -20,6 +20,7 @@ use Ergebnis\PhpCsFixer\Config\Rules; use Ergebnis\PhpCsFixer\Config\RuleSet; use ErickSkrauch\PhpCsFixer; +use PhpCsFixerCustomFixers\Fixer; use PHPUnit\Framework; #[Framework\Attributes\CoversClass(RuleSet\Php72::class)] @@ -41,7 +42,10 @@ protected static function createRuleSet(): RuleSet protected function expectedCustomFixers(): Fixers { - return Fixers::fromFixers(new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer()); + return Fixers::fromFixers( + new Fixer\PhpdocArrayStyleFixer(), + new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(), + ); } protected function expectedName(): Name @@ -53,6 +57,7 @@ protected function expectedRules(): Rules { return Rules::fromArray([ 'ErickSkrauch/line_break_after_statements' => true, + 'PhpCsFixerCustomFixers/phpdoc_array_style' => true, 'align_multiline_comment' => [ 'comment_type' => 'all_multiline', ], diff --git a/test/Unit/RuleSet/Php73Test.php b/test/Unit/RuleSet/Php73Test.php index 1bb17058..91563afb 100644 --- a/test/Unit/RuleSet/Php73Test.php +++ b/test/Unit/RuleSet/Php73Test.php @@ -20,6 +20,7 @@ use Ergebnis\PhpCsFixer\Config\Rules; use Ergebnis\PhpCsFixer\Config\RuleSet; use ErickSkrauch\PhpCsFixer; +use PhpCsFixerCustomFixers\Fixer; use PHPUnit\Framework; #[Framework\Attributes\CoversClass(RuleSet\Php73::class)] @@ -41,7 +42,10 @@ protected static function createRuleSet(): RuleSet protected function expectedCustomFixers(): Fixers { - return Fixers::fromFixers(new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer()); + return Fixers::fromFixers( + new Fixer\PhpdocArrayStyleFixer(), + new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(), + ); } protected function expectedName(): Name @@ -53,6 +57,7 @@ protected function expectedRules(): Rules { return Rules::fromArray([ 'ErickSkrauch/line_break_after_statements' => true, + 'PhpCsFixerCustomFixers/phpdoc_array_style' => true, 'align_multiline_comment' => [ 'comment_type' => 'all_multiline', ], diff --git a/test/Unit/RuleSet/Php74Test.php b/test/Unit/RuleSet/Php74Test.php index fc48bcfd..668c9337 100644 --- a/test/Unit/RuleSet/Php74Test.php +++ b/test/Unit/RuleSet/Php74Test.php @@ -20,6 +20,7 @@ use Ergebnis\PhpCsFixer\Config\Rules; use Ergebnis\PhpCsFixer\Config\RuleSet; use ErickSkrauch\PhpCsFixer; +use PhpCsFixerCustomFixers\Fixer; use PHPUnit\Framework; #[Framework\Attributes\CoversClass(RuleSet\Php74::class)] @@ -41,7 +42,10 @@ protected static function createRuleSet(): RuleSet protected function expectedCustomFixers(): Fixers { - return Fixers::fromFixers(new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer()); + return Fixers::fromFixers( + new Fixer\PhpdocArrayStyleFixer(), + new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(), + ); } protected function expectedName(): Name @@ -53,6 +57,7 @@ protected function expectedRules(): Rules { return Rules::fromArray([ 'ErickSkrauch/line_break_after_statements' => true, + 'PhpCsFixerCustomFixers/phpdoc_array_style' => true, 'align_multiline_comment' => [ 'comment_type' => 'all_multiline', ], diff --git a/test/Unit/RuleSet/Php80Test.php b/test/Unit/RuleSet/Php80Test.php index cfc63d59..91112461 100644 --- a/test/Unit/RuleSet/Php80Test.php +++ b/test/Unit/RuleSet/Php80Test.php @@ -20,6 +20,7 @@ use Ergebnis\PhpCsFixer\Config\Rules; use Ergebnis\PhpCsFixer\Config\RuleSet; use ErickSkrauch\PhpCsFixer; +use PhpCsFixerCustomFixers\Fixer; use PHPUnit\Framework; #[Framework\Attributes\CoversClass(RuleSet\Php80::class)] @@ -41,7 +42,10 @@ protected static function createRuleSet(): RuleSet protected function expectedCustomFixers(): Fixers { - return Fixers::fromFixers(new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer()); + return Fixers::fromFixers( + new Fixer\PhpdocArrayStyleFixer(), + new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(), + ); } protected function expectedName(): Name @@ -53,6 +57,7 @@ protected function expectedRules(): Rules { return Rules::fromArray([ 'ErickSkrauch/line_break_after_statements' => true, + 'PhpCsFixerCustomFixers/phpdoc_array_style' => true, 'align_multiline_comment' => [ 'comment_type' => 'all_multiline', ], diff --git a/test/Unit/RuleSet/Php81Test.php b/test/Unit/RuleSet/Php81Test.php index 6d2174d2..1cf916c1 100644 --- a/test/Unit/RuleSet/Php81Test.php +++ b/test/Unit/RuleSet/Php81Test.php @@ -20,6 +20,7 @@ use Ergebnis\PhpCsFixer\Config\Rules; use Ergebnis\PhpCsFixer\Config\RuleSet; use ErickSkrauch\PhpCsFixer; +use PhpCsFixerCustomFixers\Fixer; use PHPUnit\Framework; #[Framework\Attributes\CoversClass(RuleSet\Php81::class)] @@ -41,7 +42,10 @@ protected static function createRuleSet(): RuleSet protected function expectedCustomFixers(): Fixers { - return Fixers::fromFixers(new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer()); + return Fixers::fromFixers( + new Fixer\PhpdocArrayStyleFixer(), + new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(), + ); } protected function expectedName(): Name @@ -53,6 +57,7 @@ protected function expectedRules(): Rules { return Rules::fromArray([ 'ErickSkrauch/line_break_after_statements' => true, + 'PhpCsFixerCustomFixers/phpdoc_array_style' => true, 'align_multiline_comment' => [ 'comment_type' => 'all_multiline', ], diff --git a/test/Unit/RuleSet/Php82Test.php b/test/Unit/RuleSet/Php82Test.php index 5ef77dd5..d2964383 100644 --- a/test/Unit/RuleSet/Php82Test.php +++ b/test/Unit/RuleSet/Php82Test.php @@ -20,6 +20,7 @@ use Ergebnis\PhpCsFixer\Config\Rules; use Ergebnis\PhpCsFixer\Config\RuleSet; use ErickSkrauch\PhpCsFixer; +use PhpCsFixerCustomFixers\Fixer; use PHPUnit\Framework; #[Framework\Attributes\CoversClass(RuleSet\Php82::class)] @@ -41,7 +42,10 @@ protected static function createRuleSet(): RuleSet protected function expectedCustomFixers(): Fixers { - return Fixers::fromFixers(new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer()); + return Fixers::fromFixers( + new Fixer\PhpdocArrayStyleFixer(), + new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(), + ); } protected function expectedName(): Name @@ -53,6 +57,7 @@ protected function expectedRules(): Rules { return Rules::fromArray([ 'ErickSkrauch/line_break_after_statements' => true, + 'PhpCsFixerCustomFixers/phpdoc_array_style' => true, 'align_multiline_comment' => [ 'comment_type' => 'all_multiline', ],