Add Attribute Spacing sniff

This commit is contained in:
lubiana 2023-01-25 22:33:15 +01:00
parent b470778d3f
commit 27f6d414bf
No known key found for this signature in database

View file

@ -6,6 +6,7 @@ use PhpCsFixer\Fixer\Operator\NewWithBracesFixer;
use PhpCsFixer\Fixer\PhpTag\BlankLineAfterOpeningTagFixer; use PhpCsFixer\Fixer\PhpTag\BlankLineAfterOpeningTagFixer;
use PhpCsFixer\Fixer\Whitespace\NoExtraBlankLinesFixer; use PhpCsFixer\Fixer\Whitespace\NoExtraBlankLinesFixer;
use PhpCsFixer\Fixer\Whitespace\NoWhitespaceInBlankLineFixer; use PhpCsFixer\Fixer\Whitespace\NoWhitespaceInBlankLineFixer;
use SlevomatCodingStandard\Sniffs\Attributes\AttributeAndTargetSpacingSniff;
use SlevomatCodingStandard\Sniffs\Classes\ClassConstantVisibilitySniff; use SlevomatCodingStandard\Sniffs\Classes\ClassConstantVisibilitySniff;
use SlevomatCodingStandard\Sniffs\ControlStructures\NewWithoutParenthesesSniff; use SlevomatCodingStandard\Sniffs\ControlStructures\NewWithoutParenthesesSniff;
use SlevomatCodingStandard\Sniffs\Namespaces\AlphabeticallySortedUsesSniff; use SlevomatCodingStandard\Sniffs\Namespaces\AlphabeticallySortedUsesSniff;
@ -110,4 +111,9 @@ return static function (ECSConfig $c): void {
); );
$c->rule(NoWhitespaceInBlankLineFixer::class); $c->rule(NoWhitespaceInBlankLineFixer::class);
// make sure that the attribute target is on the line after the attribute
$c->ruleWithConfiguration(AttributeAndTargetSpacingSniff::class, [
'linesCount' => 0,
]);
}; };