|
| 1 | +<?php |
| 2 | +declare(strict_types=1); |
| 3 | + |
| 4 | +use Rector\Caching\ValueObject\Storage\FileCacheStorage; |
| 5 | +use Rector\CodeQuality\Rector\Empty_\SimplifyEmptyCheckOnEmptyArrayRector; |
| 6 | +use Rector\CodeQuality\Rector\FuncCall\CompactToVariablesRector; |
| 7 | +use Rector\CodeQuality\Rector\If_\ExplicitBoolCompareRector; |
| 8 | +use Rector\CodingStyle\Rector\Assign\SplitDoubleAssignRector; |
| 9 | +use Rector\CodingStyle\Rector\Catch_\CatchExceptionNameMatchingTypeRector; |
| 10 | +use Rector\CodingStyle\Rector\ClassMethod\NewlineBeforeNewAssignSetRector; |
| 11 | +use Rector\CodingStyle\Rector\Stmt\NewlineAfterStatementRector; |
| 12 | +use Rector\Config\RectorConfig; |
| 13 | +use Rector\DeadCode\Rector\ClassMethod\RemoveUselessParamTagRector; |
| 14 | +use Rector\DeadCode\Rector\ClassMethod\RemoveUselessReturnTagRector; |
| 15 | +use Rector\EarlyReturn\Rector\If_\ChangeOrIfContinueToMultiContinueRector; |
| 16 | +use Rector\Php55\Rector\String_\StringClassNameToClassConstantRector; |
| 17 | +use Rector\Php74\Rector\Closure\ClosureToArrowFunctionRector; |
| 18 | +use Rector\Php80\Rector\Class_\ClassPropertyAssignToConstructorPromotionRector; |
| 19 | +use Rector\Php80\Rector\Class_\StringableForToStringRector; |
| 20 | +use Rector\Set\ValueObject\SetList; |
| 21 | +use Rector\Strict\Rector\Empty_\DisallowedEmptyRuleFixerRector; |
| 22 | +use Rector\TypeDeclaration\Rector\ClassMethod\ParamTypeByMethodCallTypeRector; |
| 23 | +use Rector\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromStrictFluentReturnRector; |
| 24 | +use Rector\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromStrictTypedCallRector; |
| 25 | +use Rector\TypeDeclaration\Rector\Function_\AddFunctionVoidReturnTypeWhereNoReturnRector; |
| 26 | + |
| 27 | +$cacheDir = getenv('RECTOR_CACHE_DIR') ?: sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'rector'; |
| 28 | + |
| 29 | +return RectorConfig::configure() |
| 30 | + ->withPaths([ |
| 31 | + __DIR__ . '/config', |
| 32 | + __DIR__ . '/src', |
| 33 | + __DIR__ . '/tests', |
| 34 | + ]) |
| 35 | + |
| 36 | + ->withCache( |
| 37 | + cacheClass: FileCacheStorage::class, |
| 38 | + cacheDirectory: $cacheDir, |
| 39 | + ) |
| 40 | + |
| 41 | + ->withPhpSets() |
| 42 | + ->withAttributesSets() |
| 43 | + |
| 44 | + ->withSets([ |
| 45 | + SetList::CODE_QUALITY, |
| 46 | + SetList::CODING_STYLE, |
| 47 | + SetList::DEAD_CODE, |
| 48 | + SetList::EARLY_RETURN, |
| 49 | + SetList::INSTANCEOF, |
| 50 | + SetList::TYPE_DECLARATION, |
| 51 | + ]) |
| 52 | + |
| 53 | + ->withSkip([ |
| 54 | + ClassPropertyAssignToConstructorPromotionRector::class, |
| 55 | + CatchExceptionNameMatchingTypeRector::class, |
| 56 | + ClosureToArrowFunctionRector::class, |
| 57 | + RemoveUselessReturnTagRector::class, |
| 58 | + ReturnTypeFromStrictFluentReturnRector::class, |
| 59 | + NewlineAfterStatementRector::class, |
| 60 | + StringClassNameToClassConstantRector::class, |
| 61 | + ReturnTypeFromStrictTypedCallRector::class, |
| 62 | + ParamTypeByMethodCallTypeRector::class, |
| 63 | + CompactToVariablesRector::class, |
| 64 | + SplitDoubleAssignRector::class, |
| 65 | + ChangeOrIfContinueToMultiContinueRector::class, |
| 66 | + ExplicitBoolCompareRector::class, |
| 67 | + NewlineBeforeNewAssignSetRector::class, |
| 68 | + DisallowedEmptyRuleFixerRector::class, |
| 69 | + RemoveUselessParamTagRector::class, |
| 70 | + ]); |
0 commit comments