-
Notifications
You must be signed in to change notification settings - Fork 4
/
rector.php
88 lines (80 loc) · 4.14 KB
/
rector.php
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\CodeQuality\Rector\BooleanAnd\SimplifyEmptyArrayCheckRector;
use Rector\CodeQuality\Rector\BooleanNot\ReplaceMultipleBooleanNotRector;
use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector;
use Rector\CodeQuality\Rector\Identical\GetClassToInstanceOfRector;
use Rector\CodingStyle\Rector\Assign\SplitDoubleAssignRector;
use Rector\CodingStyle\Rector\ClassConst\RemoveFinalFromConstRector;
use Rector\CodingStyle\Rector\ClassConst\SplitGroupedClassConstantsRector;
use Rector\CodingStyle\Rector\ClassMethod\FuncGetArgsToVariadicParamRector;
use Rector\CodingStyle\Rector\ClassMethod\MakeInheritedMethodVisibilitySameAsParentRector;
use Rector\CodingStyle\Rector\ClassMethod\NewlineBeforeNewAssignSetRector;
use Rector\CodingStyle\Rector\Encapsed\WrapEncapsedVariableInCurlyBracesRector;
use Rector\CodingStyle\Rector\FuncCall\CallUserFuncArrayToVariadicRector;
use Rector\CodingStyle\Rector\FuncCall\CallUserFuncToMethodCallRector;
use Rector\CodingStyle\Rector\FuncCall\ConsistentImplodeRector;
use Rector\CodingStyle\Rector\FuncCall\StrictArraySearchRector;
use Rector\CodingStyle\Rector\FuncCall\VersionCompareFuncCallToConstantRector;
use Rector\CodingStyle\Rector\Plus\UseIncrementAssignRector;
use Rector\CodingStyle\Rector\Property\SplitGroupedPropertiesRector;
use Rector\CodingStyle\Rector\Stmt\NewlineAfterStatementRector;
use Rector\CodingStyle\Rector\String_\UseClassKeywordForClassNameResolutionRector;
use Rector\CodingStyle\Rector\Ternary\TernaryConditionVariableAssignmentRector;
use Rector\Config\RectorConfig;
use Rector\EarlyReturn\Rector\If_\RemoveAlwaysElseRector;
use Rector\Php55\Rector\String_\StringClassNameToClassConstantRector;
use Rector\Privatization\Rector\ClassMethod\PrivatizeFinalClassMethodRector;
use Rector\Privatization\Rector\MethodCall\PrivatizeLocalGetterToPropertyRector;
use Rector\Privatization\Rector\Property\PrivatizeFinalClassPropertyRector;
use Rector\TypeDeclaration\Rector\Class_\PropertyTypeFromStrictSetterGetterRector;
use Rector\TypeDeclaration\Rector\Class_\ReturnTypeFromStrictTernaryRector;
use Rector\TypeDeclaration\Rector\ClassMethod\ParamTypeByMethodCallTypeRector;
use Rector\TypeDeclaration\Rector\ClassMethod\ReturnNeverTypeRector;
use Rector\ValueObject\PhpVersion;
return static function (RectorConfig $rectorConfig): void {
$dir = getcwd();
$rectorConfig->paths([
$dir.'/app',
]);
$rectorConfig->bootstrapFiles([
$dir.'/vendor/nunomaduro/larastan/bootstrap.php',
]);
$rectorConfig->phpVersion(PhpVersion::PHP_82);
$rectorConfig->importNames();
$rectorConfig->importShortClasses(false);
$rectorConfig->phpstanConfig('./phpstan.neon');
$rectorConfig->rules([
NewlineAfterStatementRector::class,
RemoveFinalFromConstRector::class,
ConsistentImplodeRector::class,
TernaryConditionVariableAssignmentRector::class,
StringClassNameToClassConstantRector::class,
UseIncrementAssignRector::class,
SplitDoubleAssignRector::class,
WrapEncapsedVariableInCurlyBracesRector::class,
NewlineBeforeNewAssignSetRector::class,
MakeInheritedMethodVisibilitySameAsParentRector::class,
CallUserFuncArrayToVariadicRector::class,
VersionCompareFuncCallToConstantRector::class,
CallUserFuncToMethodCallRector::class,
FuncGetArgsToVariadicParamRector::class,
StrictArraySearchRector::class,
UseClassKeywordForClassNameResolutionRector::class,
SplitGroupedPropertiesRector::class,
SplitGroupedClassConstantsRector::class,
SimplifyEmptyArrayCheckRector::class,
ReplaceMultipleBooleanNotRector::class,
GetClassToInstanceOfRector::class,
PrivatizeLocalGetterToPropertyRector::class,
InlineConstructorDefaultToPropertyRector::class,
RemoveAlwaysElseRector::class,
PrivatizeFinalClassPropertyRector::class,
PrivatizeFinalClassMethodRector::class,
ParamTypeByMethodCallTypeRector::class,
// Types...
ReturnTypeFromStrictTernaryRector::class,
PropertyTypeFromStrictSetterGetterRector::class,
ReturnNeverTypeRector::class,
]);
};