-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrector.php
70 lines (66 loc) · 2.46 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
<?php
declare(strict_types=1);
use Rector\Config\RectorConfig;
use Rector\Doctrine\Set\DoctrineSetList;
use Rector\Set\ValueObject\LevelSetList;
/*
* https://getrector.com/find-rule
*/
return RectorConfig::configure()
->withPaths([__DIR__ . '/src', __DIR__ . '/tests'])
->withRootFiles()
->withParallel()
// ->withSymfonyContainerXml(__DIR__ . '/var/cache/dev/App_KernelDevDebugContainer.xml')
->withIndent(indentChar: ' ', indentSize: 4)
->withImportNames(
importNames: true,
importDocBlockNames: true,
importShortClasses: true,
removeUnusedImports: true,
)
->withPhpSets(php84: true)
->withAttributesSets(symfony: true, doctrine: true, phpunit: true)
->withPreparedSets(
// deadCode: false,
// codeQuality: false,
// codingStyle: false,
// typeDeclarations: true,
// privatization: false,
// naming: false,
// instanceOf: false,
// earlyReturn: false,
// strictBooleans: false,
)
->withComposerBased(doctrine: true, phpunit: true)
->withRules(
[
// AddVoidReturnTypeWhereNoReturnRector::class,
// StaticDataProviderClassMethodRector::class,
// ExplicitNullableParamTypeRector::class,
// StringExtensionToConfigBuilderRector::class,
]
)
->withSkip(
[
// AddOverrideAttributeToOverriddenMethodsRector::class,
// ClassPropertyAssignToConstructorPromotionRector::class,
// ClosureToArrowFunctionRector::class,
// StringableForToStringRector::class,
// NullToStrictStringFuncCallArgRector::class,
// ReadOnlyPropertyRector::class => [__DIR__ . '/src/Entity/V1/Embeddable/NbnkMoney.php'],
]
)
->withSets(
[
// SymfonySetList::SYMFONY_72,
// SymfonySetList::SYMFONY_CODE_QUALITY,
// SymfonySetList::SYMFONY_CONSTRUCTOR_INJECTION,
DoctrineSetList::GEDMO_ANNOTATIONS_TO_ATTRIBUTES,
DoctrineSetList::ANNOTATIONS_TO_ATTRIBUTES,
LevelSetList::UP_TO_PHP_84,
]
)
->withTypeCoverageLevel(50)
// ->withDeadCodeLevel(0)
->withCodeQualityLevel(75)
;