diff --git a/composer.json b/composer.json index 2034fa1..8e92467 100644 --- a/composer.json +++ b/composer.json @@ -36,9 +36,9 @@ "scripts": { "cs": "./vendor/bin/php-cs-fixer fix --dry-run --diff --config codestyle.php", "csf": "./vendor/bin/php-cs-fixer fix --diff --config codestyle.php", - "test": "./vendor/bin/phpunit tests --colors always", - "unit": "./vendor/bin/phpunit tests/unit --colors always", - "e2e": "./vendor/bin/phpunit tests/codestyle --colors always" + "test": "./vendor/bin/phpunit tests --colors=always", + "unit": "./vendor/bin/phpunit tests/unit --colors=always", + "e2e": "./vendor/bin/phpunit tests/codestyle --colors=always" }, "bin": [ "bin/codestyle" diff --git a/src/Configuration/Defaults/CommonRules.php b/src/Configuration/Defaults/CommonRules.php index 21e9f49..a9cb402 100644 --- a/src/Configuration/Defaults/CommonRules.php +++ b/src/Configuration/Defaults/CommonRules.php @@ -7,6 +7,7 @@ use Blumilk\Codestyle\Fixers\DoubleQuoteFixer; use Blumilk\Codestyle\Fixers\NoLaravelMigrationsGeneratedCommentFixer; use PhpCsFixer\Fixer\ArrayNotation\ArraySyntaxFixer; +use PhpCsFixer\Fixer\ArrayNotation\NoMultilineWhitespaceAroundDoubleArrowFixer; use PhpCsFixer\Fixer\ArrayNotation\NoWhitespaceBeforeCommaInArrayFixer; use PhpCsFixer\Fixer\ArrayNotation\TrimArraySpacesFixer; use PhpCsFixer\Fixer\ArrayNotation\WhitespaceAfterCommaInArrayFixer; @@ -330,5 +331,6 @@ class CommonRules extends Rules "anonymous_functions_opening_brace" => "same_line", ], LowercaseKeywordsFixer::class => true, + NoMultilineWhitespaceAroundDoubleArrowFixer::class => true, ]; } diff --git a/tests/fixtures/noMultilineWhitespaceAroundDoubleArrow/actual.php b/tests/fixtures/noMultilineWhitespaceAroundDoubleArrow/actual.php new file mode 100644 index 0000000..072b681 --- /dev/null +++ b/tests/fixtures/noMultilineWhitespaceAroundDoubleArrow/actual.php @@ -0,0 +1,24 @@ + 2]; + } + + public function getClosure(): Closure + { + return fn() => + []; + } +} diff --git a/tests/fixtures/noMultilineWhitespaceAroundDoubleArrow/expected.php b/tests/fixtures/noMultilineWhitespaceAroundDoubleArrow/expected.php new file mode 100644 index 0000000..93d8acf --- /dev/null +++ b/tests/fixtures/noMultilineWhitespaceAroundDoubleArrow/expected.php @@ -0,0 +1,21 @@ + 2]; + } + + public function getClosure(): Closure + { + return fn() => []; + } +}