|
| 1 | +<?php |
| 2 | + |
| 3 | +declare(strict_types=1); |
| 4 | + |
| 5 | +use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector; |
| 6 | +use Rector\Config\RectorConfig; |
| 7 | +use Rector\Php71\Rector\FuncCall\RemoveExtraParametersRector; |
| 8 | +use Rector\Php74\Rector\Assign\NullCoalescingOperatorRector; |
| 9 | +use Rector\Php74\Rector\Property\TypedPropertyRector; |
| 10 | +use Rector\Set\ValueObject\LevelSetList; |
| 11 | +use Rector\TypeDeclaration\Rector\ClassMethod\AddMethodCallBasedStrictParamTypeRector; |
| 12 | +use Rector\TypeDeclaration\Rector\ClassMethod\AddParamTypeDeclarationRector; |
| 13 | +use Rector\TypeDeclaration\Rector\ClassMethod\AddReturnTypeDeclarationRector; |
| 14 | +use Rector\TypeDeclaration\Rector\ClassMethod\AddVoidReturnTypeWhereNoReturnRector; |
| 15 | +use Rector\TypeDeclaration\Rector\Property\AddPropertyTypeDeclarationRector; |
| 16 | + |
| 17 | +return static function(RectorConfig $rectorConfig): void { |
| 18 | + $rectorConfig->paths([ |
| 19 | + __DIR__ . '/src' |
| 20 | + ]); |
| 21 | + |
| 22 | + // register a single rule |
| 23 | + $rectorConfig->rule(InlineConstructorDefaultToPropertyRector::class); |
| 24 | + $rectorConfig->rule(NullCoalescingOperatorRector::class); |
| 25 | + $rectorConfig->rule(RemoveExtraParametersRector::class); |
| 26 | + |
| 27 | + $rectorConfig->rule(AddMethodCallBasedStrictParamTypeRector::class); |
| 28 | + $rectorConfig->rule(AddVoidReturnTypeWhereNoReturnRector::class); |
| 29 | + |
| 30 | + $rectorConfig->ruleWithConfiguration(TypedPropertyRector::class, [ |
| 31 | + TypedPropertyRector::INLINE_PUBLIC => true, |
| 32 | + ]); |
| 33 | + |
| 34 | + // define sets of rules |
| 35 | + $rectorConfig->sets([ |
| 36 | + LevelSetList::UP_TO_PHP_80 |
| 37 | + ]); |
| 38 | + |
| 39 | + $rectorConfig->phpstanConfig(__DIR__ . '/phpstan.neon'); |
| 40 | +}; |
0 commit comments