|
149 | 149 | use SlevomatCodingStandard\Sniffs\ControlStructures\RequireNullSafeObjectOperatorSniff;
|
150 | 150 | use SlevomatCodingStandard\Sniffs\Exceptions\ReferenceThrowableOnlySniff;
|
151 | 151 | use SlevomatCodingStandard\Sniffs\Functions\RequireTrailingCommaInCallSniff;
|
152 |
| -use SlevomatCodingStandard\Sniffs\Functions\RequireTrailingCommaInDeclarationSniff; |
153 | 152 | use SlevomatCodingStandard\Sniffs\TypeHints\ParameterTypeHintSniff;
|
154 | 153 | use SlevomatCodingStandard\Sniffs\TypeHints\PropertyTypeHintSniff;
|
155 | 154 | use SlevomatCodingStandard\Sniffs\TypeHints\ReturnTypeHintSniff;
|
|
234 | 233 | SingleLineEmptyBodyFixer::class, // Defined in PER 2.0
|
235 | 234 | // Values separated by a comma on a single line should not have a trailing comma.
|
236 | 235 | NoTrailingCommaInSinglelineFixer::class,
|
237 |
| - // Multi-line arrays, arguments list and parameters list must have a trailing comma |
238 |
| - TrailingCommaInMultilineFixer::class, |
239 | 236 | // Arrays should be formatted like function/method arguments
|
240 | 237 | TrimArraySpacesFixer::class,
|
241 | 238 | // In array declaration, there MUST be a whitespace after each comma
|
|
422 | 419 | // > it may probably be a phpstan rule, more than cs rule - since it needs a class hierarchy to solve this
|
423 | 420 | // @see https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues/6235
|
424 | 421 |
|
425 |
| - // Multi-line arguments list in function/method declaration must have a trailing comma |
426 |
| - RequireTrailingCommaInDeclarationSniff::class, |
427 | 422 | // Multi-line arguments list in function/method call must have a trailing comma
|
428 |
| - RequireTrailingCommaInCallSniff::class, |
| 423 | + RequireTrailingCommaInCallSniff::class, // TODO: will be redundant after https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/pull/7989 is merged and released |
429 | 424 |
|
430 | 425 | // Use `null-safe` operator `?->` where possible
|
431 | 426 | RequireNullSafeObjectOperatorSniff::class,
|
|
552 | 547 | FunctionDeclarationFixer::class,
|
553 | 548 | ['closure_fn_spacing' => 'none'], // Defined in PER 2.0
|
554 | 549 | )
|
| 550 | + // Multi-line arrays, arguments list and parameters list must have a trailing comma |
| 551 | + ->withConfiguredRule( |
| 552 | + TrailingCommaInMultilineFixer::class, |
| 553 | + ['after_heredoc' => true, 'elements' => ['arguments', 'arrays', 'match', 'parameters']], // Defined in PER 2.0 |
| 554 | + ) |
555 | 555 | ->withSkip([
|
556 | 556 | // We allow empty catch statements (but they must have comment - see EmptyCatchCommentSniff)
|
557 | 557 | EmptyStatementSniff::class . '.DetectedCatch' => null,
|
|
0 commit comments