-
Notifications
You must be signed in to change notification settings - Fork 0
/
rector.php
87 lines (81 loc) · 3.66 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
<?php
declare(strict_types=1);
use Rector\CodeQuality\Rector\Class_\CompleteDynamicPropertiesRector;
use Rector\Config\RectorConfig;
use Rector\DeadCode\Rector\ClassMethod\RemoveNullTagValueNodeRector;
use Rector\DeadCode\Rector\ClassMethod\RemoveUselessParamTagRector;
use Rector\DeadCode\Rector\ClassMethod\RemoveUselessReturnTagRector;
use Rector\DeadCode\Rector\Property\RemoveUselessVarTagRector;
use Rector\EarlyReturn\Rector\If_\ChangeAndIfToEarlyReturnRector;
use Rector\EarlyReturn\Rector\If_\ChangeOrIfContinueToMultiContinueRector;
use Rector\EarlyReturn\Rector\If_\RemoveAlwaysElseRector;
use Rector\Php71\Rector\BinaryOp\BinaryOpBetweenNumberAndStringRector;
use Rector\Php71\Rector\FuncCall\RemoveExtraParametersRector;
use Rector\Php73\Rector\ConstFetch\SensitiveConstantNameRector;
use Rector\Php73\Rector\String_\SensitiveHereNowDocRector;
use Rector\Php80\Rector\Catch_\RemoveUnusedVariableInCatchRector;
use Rector\Php80\Rector\FunctionLike\MixedTypeRector;
use Rector\Php80\Rector\Property\NestedAnnotationToAttributeRector;
use Rector\Php81\Rector\Property\ReadOnlyPropertyRector;
use Rector\Php82\Rector\Class_\ReadOnlyClassRector;
use Rector\Transform\Rector\Attribute\AttributeKeyToClassConstFetchRector;
use Rector\TypeDeclaration\Rector\Class_\MergeDateTimePropertyTypeDeclarationRector;
use Rector\TypeDeclaration\Rector\ClassMethod\AddVoidReturnTypeWhereNoReturnRector;
use Rector\TypeDeclaration\Rector\Closure\AddClosureVoidReturnTypeWhereNoReturnRector;
use Rector\TypeDeclaration\Rector\FunctionLike\AddParamTypeSplFixedArrayRector;
use Rector\Visibility\Rector\ClassMethod\ExplicitPublicClassMethodRector;
return RectorConfig::configure()
->withPaths([
__DIR__ . '/src',
__DIR__ . '/tests',
__DIR__ . '/.php-cs-fixer.dist.php',
__DIR__ . '/rector.php',
])->withRules([
CompleteDynamicPropertiesRector::class
]);
//return RectorConfig::configure()
// ->withPaths([
// __DIR__ . '/src',
// __DIR__ . '/tests',
// __DIR__ . '/.php-cs-fixer.dist.php',
// __DIR__ . '/rector.php',
// ])
// ->withPhpSets(php82: true)
// ->withPreparedSets(earlyReturn: true)
// ->withSkip([
// RemoveNullTagValueNodeRector::class,
// RemoveUselessVarTagRector::class,
// RemoveUselessParamTagRector::class,
// RemoveUselessReturnTagRector::class,
// MixedTypeRector::class,
// MergeDateTimePropertyTypeDeclarationRector::class,
// SensitiveHereNowDocRector::class,
// ReadOnlyClassRector::class,
// ReadOnlyPropertyRector::class,
// ChangeOrIfContinueToMultiContinueRector::class,
// ChangeAndIfToEarlyReturnRector::class,
// RemoveUnusedVariableInCatchRector::class,
// SensitiveConstantNameRector::class,
// RemoveExtraParametersRector::class,
// BinaryOpBetweenNumberAndStringRector::class
// ])
// ->withRules([
// AddVoidReturnTypeWhereNoReturnRector::class,
// AddClosureVoidReturnTypeWhereNoReturnRector::class,
// AddParamTypeSplFixedArrayRector::class,
// NestedAnnotationToAttributeRector::class,
// AttributeKeyToClassConstFetchRector::class,
// ExplicitPublicClassMethodRector::class,
// RemoveAlwaysElseRector::class,
// CompleteDynamicPropertiesRector::class
// ]);
// ->withSets([
// SymfonySetList::SYMFONY_64,
// SymfonySetList::SYMFONY_CODE_QUALITY,
// SymfonySetList::SYMFONY_CONSTRUCTOR_INJECTION,
// ]);
// @see : https://github.com/rectorphp/rector/blob/main/docs/rector_rules_overview.md
// @see : https://getrector.com/find-rule
// to see
// ClassPropertyAssignToConstructorPromotionRector
// ClassOnObjectRector