-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathrector.php
More file actions
51 lines (47 loc) · 1.76 KB
/
rector.php
File metadata and controls
51 lines (47 loc) · 1.76 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
<?php
declare(strict_types=1);
use PhPhD\CodingStandard\ValueObject\Set\PhdSetList;
use Rector\Config\RectorConfig;
use Rector\DeadCode\Rector\ClassMethod\RemoveUnusedPromotedPropertyRector;
use Rector\DeadCode\Rector\If_\ReduceAlwaysFalseIfOrRector;
use Rector\DeadCode\Rector\Property\RemoveUnusedPrivatePropertyRector;
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\ValueObject\PhpVersion;
return RectorConfig::configure()
->withPaths([__DIR__.'/src', __DIR__.'/tests', __DIR__.'/upgrade'])
->withSets([PhdSetList::rector()->getPath()])
->withPhpVersion(PhpVersion::PHP_81)
->withSkip([
...stubExclusions(),
ArrayToFirstClassCallableRector::class => [
__DIR__.'/src/*/services.php',
__DIR__.'/src/*/*CompilerPass.php',
],
ClassPropertyAssignToConstructorPromotionRector::class => [
__DIR__.'/src/ExceptionalMatcher/Exception/ExceptionReciprocal.php',
__DIR__.'/src/ExceptionalMatcher/Rule/LazyMatchingRule.php',
],
StringClassNameToClassConstantRector::class => [
__DIR__.'/upgrade',
],
ReduceAlwaysFalseIfOrRector::class => [
__DIR__.'/upgrade',
]
]);
function stubExclusions(): array
{
return [
RemoveUnusedPrivatePropertyRector::class => [
__DIR__ .'/*/Stub/*',
],
RemoveUnusedPromotedPropertyRector::class => [
__DIR__ .'/*/Stub/*',
],
ReadOnlyPropertyRector::class => [
__DIR__.'/*/Stub/*',
],
];
}