|
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; |
|
131 | 134 | use PhpCsFixer\Fixer\Whitespace\NoExtraBlankLinesFixer; |
132 | 135 | use PhpCsFixer\Fixer\Whitespace\NoWhitespaceInBlankLineFixer; |
133 | 136 | use PhpCsFixer\Fixer\Whitespace\TypeDeclarationSpacesFixer; |
| 137 | +use SlevomatCodingStandard\Sniffs\Classes\RequireConstructorPropertyPromotionSniff; |
134 | 138 | use SlevomatCodingStandard\Sniffs\ControlStructures\RequireNullSafeObjectOperatorSniff; |
135 | 139 | use SlevomatCodingStandard\Sniffs\Exceptions\ReferenceThrowableOnlySniff; |
136 | 140 | use SlevomatCodingStandard\Sniffs\Functions\RequireTrailingCommaInCallSniff; |
137 | 141 | use SlevomatCodingStandard\Sniffs\Functions\RequireTrailingCommaInDeclarationSniff; |
| 142 | +use SlevomatCodingStandard\Sniffs\TypeHints\ParameterTypeHintSniff; |
| 143 | +use SlevomatCodingStandard\Sniffs\TypeHints\PropertyTypeHintSniff; |
| 144 | +use SlevomatCodingStandard\Sniffs\TypeHints\ReturnTypeHintSniff; |
138 | 145 | use SlevomatCodingStandard\Sniffs\TypeHints\UnionTypeHintFormatSniff; |
139 | 146 | use Symplify\CodingStandard\Fixer\Commenting\ParamReturnAndVarTagMalformsFixer; |
140 | 147 | use Symplify\EasyCodingStandard\Config\ECSConfig; |
|
373 | 380 | ReferenceThrowableOnlySniff::class, |
374 | 381 | // The @param, @return, @var and inline @var annotations should keep standard format |
375 | 382 | ParamReturnAndVarTagMalformsFixer::class, |
| 383 | + // Takes `@var` annotation of non-mixed types and adjusts accordingly the property signature to a native PHP 7.4+ type-hint. |
| 384 | + PhpdocToPropertyTypeFixer::class, |
| 385 | + PropertyTypeHintSniff::class, |
| 386 | + // Takes `@param` annotations of non-mixed types and adjusts accordingly the function signature to a native type-hints. |
| 387 | + PhpdocToParamTypeFixer::class, |
| 388 | + ParameterTypeHintSniff::class, |
| 389 | + // Takes `@return` annotation of non-mixed types and adjusts accordingly the function signature. |
| 390 | + PhpdocToReturnTypeFixer::class, |
| 391 | + ReturnTypeHintSniff::class, |
| 392 | + // Promote constructor properties |
| 393 | + // For php-cs-fixer implementation @see https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues/5956 |
| 394 | + RequireConstructorPropertyPromotionSniff::class, |
376 | 395 |
|
377 | 396 | // switch -> match |
378 | 397 | // @see https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues/5894 |
|
519 | 538 | // Allow single line closures |
520 | 539 | ScopeClosingBraceSniff::class . '.ContentBefore' => null, |
521 | 540 |
|
| 541 | + // Skip unwanted rules from PropertyTypeHintSniff |
| 542 | + PropertyTypeHintSniff::class . '.' . PropertyTypeHintSniff::CODE_MISSING_TRAVERSABLE_TYPE_HINT_SPECIFICATION => null, |
| 543 | + PropertyTypeHintSniff::class . '.' . PropertyTypeHintSniff::CODE_MISSING_ANY_TYPE_HINT => null, |
| 544 | + |
| 545 | + // Skip unwanted rules from ParameterTypeHintSniff |
| 546 | + ParameterTypeHintSniff::class . '.' . ParameterTypeHintSniff::CODE_MISSING_TRAVERSABLE_TYPE_HINT_SPECIFICATION => null, |
| 547 | + ParameterTypeHintSniff::class . '.' . ParameterTypeHintSniff::CODE_MISSING_ANY_TYPE_HINT => null, |
| 548 | + |
| 549 | + // Skip unwanted rules from ReturnTypeHintSniff |
| 550 | + ReturnTypeHintSniff::class . '.' . ReturnTypeHintSniff::CODE_MISSING_TRAVERSABLE_TYPE_HINT_SPECIFICATION => null, |
| 551 | + ReturnTypeHintSniff::class . '.' . ReturnTypeHintSniff::CODE_MISSING_ANY_TYPE_HINT => null, |
| 552 | + |
522 | 553 | // We use declare(strict_types=1); after opening tag |
523 | 554 | BlankLineAfterOpeningTagFixer::class => null, |
524 | 555 | ]); |
0 commit comments