-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrector.php
More file actions
74 lines (71 loc) · 3.33 KB
/
Copy pathrector.php
File metadata and controls
74 lines (71 loc) · 3.33 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
<?php
use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector;
use Rector\Config\RectorConfig;
use Rector\Php80\Rector\Catch_\RemoveUnusedVariableInCatchRector;
use Rector\Set\ValueObject\SetList;
use RectorLaravel\Rector\Class_\LivewireComponentComputedMethodToComputedAttributeRector;
use RectorLaravel\Rector\Class_\LivewireComponentQueryStringToUrlAttributeRector;
use RectorLaravel\Rector\Class_\ModelCastsPropertyToCastsMethodRector;
use RectorLaravel\Rector\ClassMethod\AddArgumentDefaultValueRector;
use RectorLaravel\Rector\ClassMethod\AddGenericReturnTypeToRelationsRector;
use RectorLaravel\Rector\ClassMethod\MigrateToSimplifiedAttributeRector;
use RectorLaravel\Rector\FuncCall\DispatchNonShouldQueueToDispatchSyncRector;
use RectorLaravel\Rector\FuncCall\NowFuncWithStartOfDayMethodCallToTodayFuncRector;
use RectorLaravel\Rector\FuncCall\RemoveDumpDataDeadCodeRector;
use RectorLaravel\Rector\If_\AbortIfRector;
use RectorLaravel\Rector\If_\ReportIfRector;
use RectorLaravel\Rector\MethodCall\EloquentOrderByToLatestOrOldestRector;
use RectorLaravel\Rector\MethodCall\RedirectRouteToToRouteHelperRector;
use RectorLaravel\Rector\PropertyFetch\OptionalToNullsafeOperatorRector;
use RectorLaravel\Rector\PropertyFetch\ReplaceFakerInstanceWithHelperRector;
use RectorLaravel\Rector\StaticCall\DispatchToHelperFunctionsRector;
use RectorLaravel\Rector\StaticCall\MinutesToSecondsInCacheRector;
use RectorLaravel\Set\LaravelLevelSetList;
use RectorLaravel\Set\LaravelSetList;
return static function (RectorConfig $rectorConfig): void {
$rectorConfig->paths([
__DIR__ . '/app',
__DIR__ . '/bootstrap',
__DIR__ . '/config',
__DIR__ . '/database',
__DIR__ . '/routes',
__DIR__ . '/resources/views',
]);
$rectorConfig->rules([
InlineConstructorDefaultToPropertyRector::class, // this is used for inlining constructor default values to properties
LivewireComponentComputedMethodToComputedAttributeRector::class,
LivewireComponentQueryStringToUrlAttributeRector::class,
AbortIfRector::class,
AddArgumentDefaultValueRector::class,
AddGenericReturnTypeToRelationsRector::class,
DispatchNonShouldQueueToDispatchSyncRector::class,
DispatchToHelperFunctionsRector::class,
EloquentOrderByToLatestOrOldestRector::class,
MigrateToSimplifiedAttributeRector::class,
MinutesToSecondsInCacheRector::class,
ModelCastsPropertyToCastsMethodRector::class,
NowFuncWithStartOfDayMethodCallToTodayFuncRector::class,
OptionalToNullsafeOperatorRector::class,
RedirectRouteToToRouteHelperRector::class,
RemoveDumpDataDeadCodeRector::class,
ReplaceFakerInstanceWithHelperRector::class,
ReportIfRector::class,
]);
// Disable specific rule
$rectorConfig->skip([
RemoveUnusedVariableInCatchRector::class,
]);
$rectorConfig->sets([
SetList::PHP_84,
SetList::CODE_QUALITY,
SetList::CODING_STYLE,
SetList::DEAD_CODE,
SetList::EARLY_RETURN,
SetList::PRIVATIZATION,
SetList::TYPE_DECLARATION,
// LaravelLevelSetList::UP_TO_LARAVEL_110,
LaravelSetList::LARAVEL_ARRAY_STR_FUNCTION_TO_STATIC_CALL,
LaravelSetList::LARAVEL_ARRAYACCESS_TO_METHOD_CALL,
LaravelSetList::LARAVEL_CODE_QUALITY,
]);
};