|
| 1 | +<?php |
| 2 | + |
| 3 | +declare(strict_types=1); |
| 4 | + |
| 5 | +use Rector\CodeQuality\Rector\Identical\FlipTypeControlToUseExclusiveTypeRector; |
| 6 | +use Rector\CodeQuality\Rector\If_\CombineIfRector; |
| 7 | +use Rector\CodeQuality\Rector\If_\SimplifyIfElseToTernaryRector; |
| 8 | +use Rector\CodingStyle\Rector\Catch_\CatchExceptionNameMatchingTypeRector; |
| 9 | +use Rector\CodingStyle\Rector\Use_\SeparateMultiUseImportsRector; |
| 10 | +use Rector\Config\RectorConfig; |
| 11 | +use Rector\DeadCode\Rector\Assign\RemoveUnusedVariableAssignRector; |
| 12 | +use Rector\DeadCode\Rector\ClassMethod\RemoveUnusedPublicMethodParameterRector; |
| 13 | +use Rector\DeadCode\Rector\ClassMethod\RemoveUselessParamTagRector; |
| 14 | +use Rector\DeadCode\Rector\ClassMethod\RemoveUselessReturnTagRector; |
| 15 | +use Rector\DeadCode\Rector\Node\RemoveNonExistingVarAnnotationRector; |
| 16 | +use Rector\Php71\Rector\FuncCall\RemoveExtraParametersRector; |
| 17 | +use Rector\Php83\Rector\ClassMethod\AddOverrideAttributeToOverriddenMethodsRector; |
| 18 | +use Rector\Strict\Rector\Ternary\DisallowedShortTernaryRuleFixerRector; |
| 19 | +use Rector\ValueObject\PhpVersion; |
| 20 | + |
| 21 | +return RectorConfig::configure() |
| 22 | + ->withPhpVersion(PhpVersion::PHP_83) |
| 23 | + ->withPaths([ |
| 24 | + __DIR__ . '/src', |
| 25 | + __DIR__ . '/tests/bin', |
| 26 | + __DIR__ . '/tests/config', |
| 27 | + __DIR__ . '/tests/public', |
| 28 | + __DIR__ . '/tests/src', |
| 29 | + ]) |
| 30 | + ->withPreparedSets( |
| 31 | + deadCode: true, |
| 32 | + codeQuality: true, |
| 33 | + codingStyle: true, |
| 34 | + typeDeclarations: true, |
| 35 | + privatization: true, |
| 36 | + instanceOf: true, |
| 37 | + strictBooleans: true, |
| 38 | + symfonyCodeQuality: true, |
| 39 | + doctrineCodeQuality: true, |
| 40 | + ) |
| 41 | + ->withPhpSets(php82: true) |
| 42 | + ->withRules([ |
| 43 | + AddOverrideAttributeToOverriddenMethodsRector::class, |
| 44 | + ]) |
| 45 | + ->withSkip([ |
| 46 | + // potential cognitive burden |
| 47 | + FlipTypeControlToUseExclusiveTypeRector::class, |
| 48 | + |
| 49 | + // results in too long variables |
| 50 | + CatchExceptionNameMatchingTypeRector::class, |
| 51 | + |
| 52 | + // makes code unreadable |
| 53 | + DisallowedShortTernaryRuleFixerRector::class, |
| 54 | + |
| 55 | + // unsafe |
| 56 | + SeparateMultiUseImportsRector::class, |
| 57 | + ]); |
0 commit comments