|
43 | 43 | use PhpCsFixer\Fixer\ArrayNotation\NormalizeIndexBraceFixer;
|
44 | 44 | use PhpCsFixer\Fixer\ArrayNotation\TrimArraySpacesFixer;
|
45 | 45 | use PhpCsFixer\Fixer\ArrayNotation\WhitespaceAfterCommaInArrayFixer;
|
| 46 | +use PhpCsFixer\Fixer\AttributeNotation\AttributeEmptyParenthesesFixer; |
46 | 47 | use PhpCsFixer\Fixer\Basic\BracesFixer;
|
47 | 48 | use PhpCsFixer\Fixer\Basic\NoTrailingCommaInSinglelineFixer;
|
48 | 49 | use PhpCsFixer\Fixer\Basic\PsrAutoloadingFixer;
|
|
72 | 73 | use PhpCsFixer\Fixer\FunctionNotation\FunctionDeclarationFixer;
|
73 | 74 | use PhpCsFixer\Fixer\FunctionNotation\ImplodeCallFixer;
|
74 | 75 | use PhpCsFixer\Fixer\FunctionNotation\LambdaNotUsedImportFixer;
|
| 76 | +use PhpCsFixer\Fixer\FunctionNotation\MethodArgumentSpaceFixer; |
75 | 77 | use PhpCsFixer\Fixer\FunctionNotation\NoUnreachableDefaultArgumentValueFixer;
|
76 | 78 | use PhpCsFixer\Fixer\FunctionNotation\NoUselessSprintfFixer;
|
77 | 79 | use PhpCsFixer\Fixer\FunctionNotation\PhpdocToParamTypeFixer;
|
|
147 | 149 | use PhpCsFixer\Fixer\Whitespace\NoWhitespaceInBlankLineFixer;
|
148 | 150 | use PhpCsFixer\Fixer\Whitespace\TypeDeclarationSpacesFixer;
|
149 | 151 | use PhpCsFixer\Fixer\Whitespace\TypesSpacesFixer;
|
| 152 | +use SlevomatCodingStandard\Sniffs\Attributes\DisallowAttributesJoiningSniff; |
| 153 | +use SlevomatCodingStandard\Sniffs\Attributes\DisallowMultipleAttributesPerLineSniff; |
150 | 154 | use SlevomatCodingStandard\Sniffs\Classes\RequireConstructorPropertyPromotionSniff;
|
151 | 155 | use SlevomatCodingStandard\Sniffs\ControlStructures\RequireNullSafeObjectOperatorSniff;
|
152 | 156 | use SlevomatCodingStandard\Sniffs\Exceptions\ReferenceThrowableOnlySniff;
|
|
229 | 233 | RandomApiMigrationFixer::class,
|
230 | 234 | // Cast shall be used, not `settype()`
|
231 | 235 | SetTypeToCastFixer::class,
|
| 236 | + // Attributes declared without arguments must not be followed by empty parentheses. |
| 237 | + AttributeEmptyParenthesesFixer::class, |
232 | 238 | // Array index should always be written by using square braces
|
233 | 239 | NormalizeIndexBraceFixer::class,
|
234 | 240 | // Empty body of class, interface, trait, enum or function must be abbreviated as {} and placed on the same line as the previous symbol, separated by a single space.
|
|
409 | 415 | PhpdocToParamTypeFixer::class,
|
410 | 416 | // Takes `@return` annotation of non-mixed types and adjusts accordingly the function signature.
|
411 | 417 | PhpdocToReturnTypeFixer::class,
|
| 418 | + // Requires that only one attribute can be placed inside #[]. |
| 419 | + DisallowAttributesJoiningSniff::class, |
| 420 | + // Disallows multiple attributes of some target on same line. |
| 421 | + DisallowMultipleAttributesPerLineSniff::class, |
412 | 422 | // Promote constructor properties
|
413 | 423 | // @see https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues/5956
|
414 | 424 | RequireConstructorPropertyPromotionSniff::class,
|
|
562 | 572 | FullyQualifiedStrictTypesFixer::class,
|
563 | 573 | ['import_symbols' => true], // Also import symbols from other namespaces than in current file
|
564 | 574 | )
|
| 575 | + // Spaces and newlines in method arguments and attributes |
| 576 | + ->withConfiguredRule( |
| 577 | + MethodArgumentSpaceFixer::class, |
| 578 | + ['attribute_placement' => 'standalone', 'on_multiline' => 'ensure_fully_multiline'], |
| 579 | + ) |
565 | 580 | ->withSkip([
|
566 | 581 | // We allow empty catch statements (but they must have comment - see EmptyCatchCommentSniff)
|
567 | 582 | EmptyStatementSniff::class . '.DetectedCatch' => null,
|
|
0 commit comments