|
| 1 | +<?php |
| 2 | + |
| 3 | +declare(strict_types=1); |
| 4 | + |
| 5 | +use Rector\CodeQuality\Rector\FuncCall\BoolvalToTypeCastRector; |
| 6 | +use Rector\CodeQuality\Rector\FuncCall\FloatvalToTypeCastRector; |
| 7 | +use Rector\CodeQuality\Rector\FuncCall\IntvalToTypeCastRector; |
| 8 | +use Rector\CodeQuality\Rector\FuncCall\StrvalToTypeCastRector; |
| 9 | +use Rector\CodingStyle\Rector\Catch_\CatchExceptionNameMatchingTypeRector; |
| 10 | +use Rector\CodingStyle\Rector\FuncCall\ArraySpreadInsteadOfArrayMergeRector; |
| 11 | +use Rector\CodingStyle\Rector\Stmt\NewlineAfterStatementRector; |
| 12 | +use Rector\Config\RectorConfig; |
| 13 | +use Rector\EarlyReturn\Rector\If_\ChangeAndIfToEarlyReturnRector; |
| 14 | +use Rector\EarlyReturn\Rector\If_\ChangeOrIfContinueToMultiContinueRector; |
| 15 | +use Rector\Php74\Rector\Closure\ClosureToArrowFunctionRector; |
| 16 | +use Rector\Php81\Rector\Array_\FirstClassCallableRector; |
| 17 | +use Rector\Php81\Rector\Property\ReadOnlyPropertyRector; |
| 18 | +use Rector\Php82\Rector\Class_\ReadOnlyClassRector; |
| 19 | +use Rector\PHPUnit\Set\PHPUnitSetList; |
| 20 | + |
| 21 | +return RectorConfig::configure() |
| 22 | + ->withParallel() |
| 23 | + ->withPaths([ |
| 24 | + __DIR__.'/src', |
| 25 | + __DIR__.'/tests', |
| 26 | + ]) |
| 27 | + ->withImportNames( |
| 28 | + importDocBlockNames: false, |
| 29 | + removeUnusedImports: true, |
| 30 | + ) |
| 31 | + ->withPhpSets() |
| 32 | + ->withPreparedSets( |
| 33 | + deadCode: true, |
| 34 | + codingStyle: true, |
| 35 | + typeDeclarations: true, |
| 36 | + privatization: true, |
| 37 | + earlyReturn: true, |
| 38 | + strictBooleans: true, |
| 39 | + ) |
| 40 | + ->withSets([ |
| 41 | + PHPUnitSetList::PHPUNIT_80, |
| 42 | + PHPUnitSetList::PHPUNIT_90, |
| 43 | + PHPUnitSetList::PHPUNIT_100, |
| 44 | + ]) |
| 45 | + ->withRules([ |
| 46 | + BoolvalToTypeCastRector::class, |
| 47 | + FloatvalToTypeCastRector::class, |
| 48 | + IntvalToTypeCastRector::class, |
| 49 | + StrvalToTypeCastRector::class, |
| 50 | + ReadOnlyClassRector::class, |
| 51 | + ReadOnlyPropertyRector::class, |
| 52 | + ]) |
| 53 | + ->withSkip([ |
| 54 | + ArraySpreadInsteadOfArrayMergeRector::class, |
| 55 | + CatchExceptionNameMatchingTypeRector::class, |
| 56 | + ChangeAndIfToEarlyReturnRector::class, |
| 57 | + ChangeOrIfContinueToMultiContinueRector::class, |
| 58 | + ClosureToArrowFunctionRector::class, |
| 59 | + FirstClassCallableRector::class, |
| 60 | + NewlineAfterStatementRector::class, |
| 61 | + ]); |
0 commit comments