|
| 1 | +<?php |
| 2 | + |
| 3 | +declare(strict_types=1); |
| 4 | + |
| 5 | +use Rector\Config\RectorConfig; |
| 6 | +use Rector\Set\ValueObject\SetList; |
| 7 | +use Rector\ValueObject\PhpVersion; |
| 8 | +use RectorLaravel\Rector\Class_\AnonymousMigrationsRector; |
| 9 | +use RectorLaravel\Rector\ClassMethod\AddGenericReturnTypeToRelationsRector; |
| 10 | +use RectorLaravel\Rector\Coalesce\ApplyDefaultInsteadOfNullCoalesceRector; |
| 11 | +use RectorLaravel\Rector\Expr\AppEnvironmentComparisonToParameterRector; |
| 12 | +use RectorLaravel\Rector\Expr\SubStrToStartsWithOrEndsWithStaticMethodCallRector\SubStrToStartsWithOrEndsWithStaticMethodCallRector; |
| 13 | +use RectorLaravel\Rector\FuncCall\NotFilledBlankFuncCallToBlankFilledFuncCallRector; |
| 14 | +use RectorLaravel\Rector\FuncCall\NowFuncWithStartOfDayMethodCallToTodayFuncRector; |
| 15 | +use RectorLaravel\Rector\FuncCall\RemoveDumpDataDeadCodeRector; |
| 16 | +use RectorLaravel\Rector\FuncCall\ThrowIfAndThrowUnlessExceptionsToUseClassStringRector; |
| 17 | +use RectorLaravel\Rector\FuncCall\TypeHintTappableCallRector; |
| 18 | +use RectorLaravel\Rector\If_\AbortIfRector; |
| 19 | +use RectorLaravel\Rector\If_\ReportIfRector; |
| 20 | +use RectorLaravel\Rector\If_\ThrowIfRector; |
| 21 | +use RectorLaravel\Rector\MethodCall\EloquentOrderByToLatestOrOldestRector; |
| 22 | +use RectorLaravel\Rector\MethodCall\EloquentWhereRelationTypeHintingParameterRector; |
| 23 | +use RectorLaravel\Rector\MethodCall\EloquentWhereTypeHintClosureParameterRector; |
| 24 | +use RectorLaravel\Rector\MethodCall\RedirectBackToBackHelperRector; |
| 25 | +use RectorLaravel\Rector\MethodCall\RedirectRouteToToRouteHelperRector; |
| 26 | +use RectorLaravel\Rector\MethodCall\ValidationRuleArrayStringValueToArrayRector; |
| 27 | +use RectorLaravel\Rector\MethodCall\WhereToWhereLikeRector; |
| 28 | +use RectorLaravel\Rector\PropertyFetch\OptionalToNullsafeOperatorRector; |
| 29 | +use RectorLaravel\Rector\StaticCall\CarbonSetTestNowToTravelToRector; |
| 30 | +use RectorLaravel\Rector\StaticCall\DispatchToHelperFunctionsRector; |
| 31 | +use RectorLaravel\Rector\StaticCall\EloquentMagicMethodToQueryBuilderRector; |
| 32 | +use RectorLaravel\Rector\StaticCall\MinutesToSecondsInCacheRector; |
| 33 | +use RectorLaravel\Rector\StaticCall\RequestStaticValidateToInjectRector; |
| 34 | +use RectorLaravel\Rector\StaticCall\RouteActionCallableRector; |
| 35 | +use RectorLaravel\Set\LaravelLevelSetList; |
| 36 | +use RectorLaravel\Set\LaravelSetList; |
| 37 | + |
| 38 | +return RectorConfig::configure() |
| 39 | + ->withPaths([ |
| 40 | + __DIR__.'/app', |
| 41 | + __DIR__.'/bootstrap', |
| 42 | + __DIR__.'/config', |
| 43 | + __DIR__.'/public', |
| 44 | + __DIR__.'/resources', |
| 45 | + __DIR__.'/routes', |
| 46 | + __DIR__.'/tests', |
| 47 | + ]) |
| 48 | + // uncomment to reach your current PHP version |
| 49 | + ->withPreparedSets( |
| 50 | + deadCode: true, |
| 51 | + codeQuality: true, |
| 52 | + typeDeclarations: true, |
| 53 | + privatization: true, |
| 54 | + earlyReturn: true, |
| 55 | + strictBooleans: true |
| 56 | + ) |
| 57 | + ->withSets([ |
| 58 | + SetList::DEAD_CODE, |
| 59 | + LaravelLevelSetList::UP_TO_LARAVEL_120, |
| 60 | + LaravelSetList::LARAVEL_LEGACY_FACTORIES_TO_CLASSES, |
| 61 | + LaravelSetList::LARAVEL_CODE_QUALITY, |
| 62 | + LaravelSetList::LARAVEL_COLLECTION, |
| 63 | + ]) |
| 64 | + ->withRules([ |
| 65 | + AnonymousMigrationsRector::class, |
| 66 | + EloquentMagicMethodToQueryBuilderRector::class, |
| 67 | + EloquentOrderByToLatestOrOldestRector::class, |
| 68 | + AbortIfRector::class, |
| 69 | + ReportIfRector::class, |
| 70 | + ThrowIfRector::class, |
| 71 | + RedirectRouteToToRouteHelperRector::class, |
| 72 | + EloquentWhereRelationTypeHintingParameterRector::class, |
| 73 | + EloquentWhereTypeHintClosureParameterRector::class, |
| 74 | + ValidationRuleArrayStringValueToArrayRector::class, |
| 75 | + RedirectBackToBackHelperRector::class, |
| 76 | + WhereToWhereLikeRector::class, |
| 77 | + NowFuncWithStartOfDayMethodCallToTodayFuncRector::class, |
| 78 | + ThrowIfAndThrowUnlessExceptionsToUseClassStringRector::class, |
| 79 | + TypeHintTappableCallRector::class, |
| 80 | + NotFilledBlankFuncCallToBlankFilledFuncCallRector::class, |
| 81 | + RemoveDumpDataDeadCodeRector::class, |
| 82 | + CarbonSetTestNowToTravelToRector::class, |
| 83 | + MinutesToSecondsInCacheRector::class, |
| 84 | + DispatchToHelperFunctionsRector::class, |
| 85 | + RequestStaticValidateToInjectRector::class, |
| 86 | + RouteActionCallableRector::class, |
| 87 | + OptionalToNullsafeOperatorRector::class, |
| 88 | + SubStrToStartsWithOrEndsWithStaticMethodCallRector::class, |
| 89 | + AppEnvironmentComparisonToParameterRector::class, |
| 90 | + ApplyDefaultInsteadOfNullCoalesceRector::class, |
| 91 | + AddGenericReturnTypeToRelationsRector::class, |
| 92 | + ]) |
| 93 | + ->withImportNames(removeUnusedImports: true) |
| 94 | + ->withPhpVersion(PhpVersion::PHP_82); |
0 commit comments