-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathrector.php
More file actions
88 lines (85 loc) · 3.77 KB
/
rector.php
File metadata and controls
88 lines (85 loc) · 3.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<?php
declare(strict_types=1);
use Rector\Caching\ValueObject\Storage\FileCacheStorage;
use Rector\CodingStyle\Rector\PostInc\PostIncDecToPreIncDecRector;
use Rector\Config\RectorConfig;
use Rector\EarlyReturn\Rector\If_\ChangeOrIfContinueToMultiContinueRector;
use Rector\Php83\Rector\ClassMethod\AddOverrideAttributeToOverriddenMethodsRector;
use Rector\TypeDeclaration\Rector\ArrowFunction\AddArrowFunctionReturnTypeRector;
use RectorLaravel\Rector\Class_\AddExtendsAnnotationToModelFactoriesRector;
use RectorLaravel\Rector\Class_\AnonymousMigrationsRector;
use RectorLaravel\Rector\Class_\ModelCastsPropertyToCastsMethodRector;
use RectorLaravel\Rector\Class_\ReplaceExpectsMethodsInTestsRector;
use RectorLaravel\Rector\ClassMethod\AddGenericReturnTypeToRelationsRector;
use RectorLaravel\Rector\Coalesce\ApplyDefaultInsteadOfNullCoalesceRector;
use RectorLaravel\Rector\Empty_\EmptyToBlankAndFilledFuncRector;
use RectorLaravel\Rector\FuncCall\NotFilledBlankFuncCallToBlankFilledFuncCallRector;
use RectorLaravel\Rector\MethodCall\AssertStatusToAssertMethodRector;
use RectorLaravel\Rector\MethodCall\RefactorBlueprintGeometryColumnsRector;
use RectorLaravel\Rector\MethodCall\ValidationRuleArrayStringValueToArrayRector;
use RectorLaravel\Rector\PropertyFetch\ReplaceFakerInstanceWithHelperRector;
use RectorLaravel\Rector\StaticCall\DispatchToHelperFunctionsRector;
use RectorLaravel\Set\LaravelSetList;
return RectorConfig::configure()
->withPaths([
__DIR__.'/app',
__DIR__.'/config',
__DIR__.'/bootstrap/app.php',
__DIR__.'/database',
__DIR__.'/routes',
__DIR__.'/public',
__DIR__.'/tests',
])
->withCache(
cacheDirectory: __DIR__.'/.rector.cache',
cacheClass: FileCacheStorage::class,
)
->withImportNames(importShortClasses: false, removeUnusedImports: true)
->withRootFiles()
->withBootstrapFiles([__DIR__.'/vendor/larastan/larastan/bootstrap.php'])
->withPHPStanConfigs([__DIR__.'/phpstan.neon'])
->withPreparedSets(
deadCode: true,
codeQuality: true,
codingStyle: true,
typeDeclarations: true,
privatization: true,
instanceOf: true,
earlyReturn: true,
strictBooleans: true,
carbon: true,
rectorPreset: true,
)
->withPhpSets(php84: true)
->withRules([
ValidationRuleArrayStringValueToArrayRector::class,
AnonymousMigrationsRector::class,
AssertStatusToAssertMethodRector::class,
AddExtendsAnnotationToModelFactoriesRector::class,
AddGenericReturnTypeToRelationsRector::class,
ApplyDefaultInsteadOfNullCoalesceRector::class,
DispatchToHelperFunctionsRector::class,
EmptyToBlankAndFilledFuncRector::class,
ModelCastsPropertyToCastsMethodRector::class,
NotFilledBlankFuncCallToBlankFilledFuncCallRector::class,
RefactorBlueprintGeometryColumnsRector::class,
ReplaceExpectsMethodsInTestsRector::class,
ReplaceFakerInstanceWithHelperRector::class,
])
->withSets([
LaravelSetList::LARAVEL_ARRAYACCESS_TO_METHOD_CALL,
LaravelSetList::LARAVEL_ARRAY_STR_FUNCTION_TO_STATIC_CALL,
LaravelSetList::LARAVEL_CODE_QUALITY,
LaravelSetList::LARAVEL_COLLECTION,
LaravelSetList::LARAVEL_CONTAINER_STRING_TO_FULLY_QUALIFIED_NAME,
LaravelSetList::LARAVEL_ELOQUENT_MAGIC_METHOD_TO_QUERY_BUILDER,
LaravelSetList::LARAVEL_FACADE_ALIASES_TO_FULL_NAMES,
LaravelSetList::LARAVEL_IF_HELPERS,
LaravelSetList::LARAVEL_LEGACY_FACTORIES_TO_CLASSES,
])
->withSkip([
AddOverrideAttributeToOverriddenMethodsRector::class,
ChangeOrIfContinueToMultiContinueRector::class,
PostIncDecToPreIncDecRector::class,
AddArrowFunctionReturnTypeRector::class,
]);