-
Notifications
You must be signed in to change notification settings - Fork 946
Expand file tree
/
Copy pathrector.php
More file actions
72 lines (70 loc) · 3.13 KB
/
rector.php
File metadata and controls
72 lines (70 loc) · 3.13 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
<?php
use Rector\CodeQuality\Rector\Class_\CompleteDynamicPropertiesRector;
use Rector\CodeQuality\Rector\For_\ForRepeatedCountToOwnVariableRector;
use Rector\CodeQuality\Rector\If_\CombineIfRector;
use Rector\CodeQuality\Rector\If_\ExplicitBoolCompareRector;
use Rector\CodeQuality\Rector\If_\ShortenElseIfRector;
use Rector\CodingStyle\Rector\ClassMethod\NewlineBeforeNewAssignSetRector;
use Rector\CodingStyle\Rector\Encapsed\EncapsedStringsToSprintfRector;
use Rector\CodingStyle\Rector\Encapsed\WrapEncapsedVariableInCurlyBracesRector;
use Rector\CodingStyle\Rector\If_\NullableCompareToNullRector;
use Rector\CodingStyle\Rector\Stmt\NewlineAfterStatementRector;
use Rector\Config\RectorConfig;
use Rector\DeadCode\Rector\If_\RemoveAlwaysTrueIfConditionRector;
use Rector\DeadCode\Rector\If_\RemoveDeadInstanceOfRector;
use Rector\Php55\Rector\String_\StringClassNameToClassConstantRector;
use Rector\Php80\Rector\Class_\ClassPropertyAssignToConstructorPromotionRector;
use Rector\Php81\Rector\Array_\ArrayToFirstClassCallableRector;
use Rector\Php81\Rector\Property\ReadOnlyPropertyRector;
use Rector\TypeDeclaration\Rector\ClassMethod\ParamTypeByMethodCallTypeRector;
use Rector\ValueObject\PhpVersion;
return RectorConfig::configure()
->withSkipPath(__DIR__ . '/tests/Fixtures')
->withSkip([
NewlineBeforeNewAssignSetRector::class,
CombineIfRector::class,
ExplicitBoolCompareRector::class,
ForRepeatedCountToOwnVariableRector::class,
ReadOnlyPropertyRector::class,
RemoveAlwaysTrueIfConditionRector::class => [
__DIR__ . '/src/Processors/ExpandEnums.php',
],
RemoveDeadInstanceOfRector::class => [
__DIR__ . '/src/Processors/ExpandEnums.php',
],
ShortenElseIfRector::class,
NewlineAfterStatementRector::class,
NullableCompareToNullRector::class,
StringClassNameToClassConstantRector::class => [
__DIR__ . '/src/Analysers/DocBlockParser.php',
__DIR__ . '/src/Analysers/TypeResolverTrait.php',
__DIR__ . '/tests/Analysers/ComposerAutoloaderScannerTest.php',
__DIR__ . '/tests/Analysers/TokenScannerTest.php',
__DIR__ . '/tests/AnalysisTest.php',
__DIR__ . '/tests/ContextTest.php',
],
WrapEncapsedVariableInCurlyBracesRector::class => [
__DIR__ . '/src/Type/LegacyTypeResolver.php',
],
EncapsedStringsToSprintfRector::class,
ParamTypeByMethodCallTypeRector::class => [
__DIR__ . '/src/Serializer.php',
],
ClassPropertyAssignToConstructorPromotionRector::class,
CompleteDynamicPropertiesRector::class => [
__DIR__ . '/src/Annotations/AbstractAnnotation.php',
],
ArrayToFirstClassCallableRector::class => [
__DIR__ . '/tests/Analysers/ComposerAutoloaderScannerTest.php',
],
])
->withPreparedSets(
deadCode: true,
codeQuality: true,
codingStyle: true,
typeDeclarations: true,
phpunitCodeQuality: true,
)
->withAttributesSets(phpunit: true)
->withPhpVersion(PhpVersion::PHP_82)
->withPhpSets();