-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrector.php
59 lines (55 loc) · 2.34 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
<?php
declare(strict_types=1);
use Rector\CodeQuality\Rector\ClassMethod\LocallyCalledStaticMethodToNonStaticRector;
use Rector\CodeQuality\Rector\Foreach_\UnusedForeachValueToArrayKeysRector;
use Rector\CodeQuality\Rector\Identical\FlipTypeControlToUseExclusiveTypeRector;
use Rector\CodeQuality\Rector\If_\ExplicitBoolCompareRector;
use Rector\Config\RectorConfig;
use Rector\Php81\Rector\FuncCall\NullToStrictStringFuncCallArgRector;
use Rector\Php82\Rector\Class_\ReadOnlyClassRector;
use Rector\Php83\Rector\ClassConst\AddTypeToConstRector;
use Rector\Php83\Rector\ClassMethod\AddOverrideAttributeToOverriddenMethodsRector;
use Rector\Set\ValueObject\LevelSetList;
use Rector\Set\ValueObject\SetList;
use Rector\Symfony\Set\SymfonySetList;
return static function (RectorConfig $rectorConfig): void {
$rectorConfig->paths([
__DIR__.'/src',
__DIR__.'/tests',
]);
$rectorConfig->skip([
'tests/Fixtures/Messenger/envelope_compressed.php',
'tests/Fixtures/Messenger/envelope_uncompressed.php',
NullToStrictStringFuncCallArgRector::class,
LocallyCalledStaticMethodToNonStaticRector::class,
FlipTypeControlToUseExclusiveTypeRector::class,
ExplicitBoolCompareRector::class,
UnusedForeachValueToArrayKeysRector::class,
AddOverrideAttributeToOverriddenMethodsRector::class,
ReadOnlyClassRector::class,
AddTypeToConstRector::class,
]);
$rectorConfig->cacheDirectory(__DIR__.'/var/rector-cache');
$rectorConfig->importNames();
$rectorConfig->importShortClasses(false);
// https://github.com/rectorphp/rector/blob/main/docs/rector_rules_overview.md
// https://github.com/rectorphp/rector-symfony/blob/main/docs/rector_rules_overview.md
$rectorConfig->sets([
LevelSetList::UP_TO_PHP_83,
SetList::CODE_QUALITY,
SetList::EARLY_RETURN,
SetList::INSTANCEOF,
SetList::PRIVATIZATION,
SetList::TYPE_DECLARATION,
SymfonySetList::SYMFONY_60,
SymfonySetList::SYMFONY_61,
SymfonySetList::SYMFONY_62,
SymfonySetList::SYMFONY_63,
SymfonySetList::SYMFONY_64,
SymfonySetList::SYMFONY_70,
SymfonySetList::SYMFONY_71,
SymfonySetList::SYMFONY_CODE_QUALITY,
SymfonySetList::SYMFONY_CONSTRUCTOR_INJECTION,
SymfonySetList::ANNOTATIONS_TO_ATTRIBUTES,
]);
};