|
69 | 69 | use PhpCsFixer\Fixer\FunctionNotation\LambdaNotUsedImportFixer;
|
70 | 70 | use PhpCsFixer\Fixer\FunctionNotation\NoUnreachableDefaultArgumentValueFixer;
|
71 | 71 | use PhpCsFixer\Fixer\FunctionNotation\NoUselessSprintfFixer;
|
| 72 | +use PhpCsFixer\Fixer\FunctionNotation\PhpdocToParamTypeFixer; |
| 73 | +use PhpCsFixer\Fixer\FunctionNotation\PhpdocToPropertyTypeFixer; |
| 74 | +use PhpCsFixer\Fixer\FunctionNotation\PhpdocToReturnTypeFixer; |
72 | 75 | use PhpCsFixer\Fixer\FunctionNotation\ReturnTypeDeclarationFixer;
|
73 | 76 | use PhpCsFixer\Fixer\FunctionNotation\VoidReturnFixer;
|
74 | 77 | use PhpCsFixer\Fixer\Import\NoLeadingImportSlashFixer;
|
|
130 | 133 | use PhpCsFixer\Fixer\Whitespace\NoExtraBlankLinesFixer;
|
131 | 134 | use PhpCsFixer\Fixer\Whitespace\NoWhitespaceInBlankLineFixer;
|
132 | 135 | use PhpCsFixer\Fixer\Whitespace\TypeDeclarationSpacesFixer;
|
| 136 | +use SlevomatCodingStandard\Sniffs\Classes\RequireConstructorPropertyPromotionSniff; |
133 | 137 | use SlevomatCodingStandard\Sniffs\ControlStructures\RequireNullSafeObjectOperatorSniff;
|
134 | 138 | use SlevomatCodingStandard\Sniffs\Exceptions\ReferenceThrowableOnlySniff;
|
135 | 139 | use SlevomatCodingStandard\Sniffs\Functions\RequireTrailingCommaInCallSniff;
|
136 | 140 | use SlevomatCodingStandard\Sniffs\Functions\RequireTrailingCommaInDeclarationSniff;
|
| 141 | +use SlevomatCodingStandard\Sniffs\TypeHints\ParameterTypeHintSniff; |
| 142 | +use SlevomatCodingStandard\Sniffs\TypeHints\PropertyTypeHintSniff; |
| 143 | +use SlevomatCodingStandard\Sniffs\TypeHints\ReturnTypeHintSniff; |
137 | 144 | use SlevomatCodingStandard\Sniffs\TypeHints\UnionTypeHintFormatSniff;
|
138 | 145 | use Symplify\CodingStandard\Fixer\Commenting\ParamReturnAndVarTagMalformsFixer;
|
139 | 146 | use Symplify\EasyCodingStandard\Config\ECSConfig;
|
|
370 | 377 | ReferenceThrowableOnlySniff::class,
|
371 | 378 | // The @param, @return, @var and inline @var annotations should keep standard format
|
372 | 379 | ParamReturnAndVarTagMalformsFixer::class,
|
| 380 | + // Takes `@var` annotation of non-mixed types and adjusts accordingly the property signature to a native PHP 7.4+ type-hint. |
| 381 | + PhpdocToPropertyTypeFixer::class, |
| 382 | + PropertyTypeHintSniff::class, |
| 383 | + // Takes `@param` annotations of non-mixed types and adjusts accordingly the function signature to a native type-hints. |
| 384 | + PhpdocToParamTypeFixer::class, |
| 385 | + ParameterTypeHintSniff::class, |
| 386 | + // Takes `@return` annotation of non-mixed types and adjusts accordingly the function signature. |
| 387 | + PhpdocToReturnTypeFixer::class, |
| 388 | + ReturnTypeHintSniff::class, |
| 389 | + // Promote constructor properties |
| 390 | + // For php-cs-fixer implementation @see https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues/5956 |
| 391 | + RequireConstructorPropertyPromotionSniff::class, |
373 | 392 |
|
374 | 393 | // switch -> match
|
375 | 394 | // @see https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues/5894
|
|
511 | 530 | // Allow single line closures
|
512 | 531 | ScopeClosingBraceSniff::class . '.ContentBefore' => null,
|
513 | 532 |
|
| 533 | + // Skip unwanted rules from PropertyTypeHintSniff |
| 534 | + PropertyTypeHintSniff::class . '.' . PropertyTypeHintSniff::CODE_MISSING_TRAVERSABLE_TYPE_HINT_SPECIFICATION => null, |
| 535 | + PropertyTypeHintSniff::class . '.' . PropertyTypeHintSniff::CODE_MISSING_ANY_TYPE_HINT => null, |
| 536 | + |
| 537 | + // Skip unwanted rules from ParameterTypeHintSniff |
| 538 | + ParameterTypeHintSniff::class . '.' . ParameterTypeHintSniff::CODE_MISSING_TRAVERSABLE_TYPE_HINT_SPECIFICATION => null, |
| 539 | + ParameterTypeHintSniff::class . '.' . ParameterTypeHintSniff::CODE_MISSING_ANY_TYPE_HINT => null, |
| 540 | + |
| 541 | + // Skip unwanted rules from ReturnTypeHintSniff |
| 542 | + ReturnTypeHintSniff::class . '.' . ReturnTypeHintSniff::CODE_MISSING_TRAVERSABLE_TYPE_HINT_SPECIFICATION => null, |
| 543 | + ReturnTypeHintSniff::class . '.' . ReturnTypeHintSniff::CODE_MISSING_ANY_TYPE_HINT => null, |
| 544 | + |
514 | 545 | // We use declare(strict_types=1); after opening tag
|
515 | 546 | BlankLineAfterOpeningTagFixer::class => null,
|
516 | 547 | ]);
|
0 commit comments