From 27f6d414bf16bbbfd582fde9fe9b90a3ceeb7b36 Mon Sep 17 00:00:00 2001 From: lubiana Date: Wed, 25 Jan 2023 22:33:15 +0100 Subject: [PATCH] Add Attribute Spacing sniff --- config/ecs.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/config/ecs.php b/config/ecs.php index 76f1333..0f2a3e2 100644 --- a/config/ecs.php +++ b/config/ecs.php @@ -6,6 +6,7 @@ use PhpCsFixer\Fixer\Operator\NewWithBracesFixer; use PhpCsFixer\Fixer\PhpTag\BlankLineAfterOpeningTagFixer; use PhpCsFixer\Fixer\Whitespace\NoExtraBlankLinesFixer; use PhpCsFixer\Fixer\Whitespace\NoWhitespaceInBlankLineFixer; +use SlevomatCodingStandard\Sniffs\Attributes\AttributeAndTargetSpacingSniff; use SlevomatCodingStandard\Sniffs\Classes\ClassConstantVisibilitySniff; use SlevomatCodingStandard\Sniffs\ControlStructures\NewWithoutParenthesesSniff; use SlevomatCodingStandard\Sniffs\Namespaces\AlphabeticallySortedUsesSniff; @@ -110,4 +111,9 @@ return static function (ECSConfig $c): void { ); $c->rule(NoWhitespaceInBlankLineFixer::class); + + // make sure that the attribute target is on the line after the attribute + $c->ruleWithConfiguration(AttributeAndTargetSpacingSniff::class, [ + 'linesCount' => 0, + ]); };