-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrector.php
More file actions
92 lines (89 loc) · 3.49 KB
/
rector.php
File metadata and controls
92 lines (89 loc) · 3.49 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<?php
declare(strict_types=1);
use Rector\CodeQuality\Rector\BooleanAnd\SimplifyEmptyArrayCheckRector;
use Rector\CodeQuality\Rector\BooleanOr\RepeatedOrEqualToInArrayRector;
use Rector\CodeQuality\Rector\Empty_\SimplifyEmptyCheckOnEmptyArrayRector;
use Rector\CodeQuality\Rector\Identical\FlipTypeControlToUseExclusiveTypeRector;
use Rector\CodeQuality\Rector\If_\CombineIfRector;
use Rector\CodeQuality\Rector\If_\ExplicitBoolCompareRector;
use Rector\CodeQuality\Rector\Isset_\IssetOnPropertyObjectToPropertyExistsRector;
use Rector\CodingStyle\Rector\Encapsed\EncapsedStringsToSprintfRector;
use Rector\CodingStyle\Rector\Stmt\NewlineAfterStatementRector;
use Rector\Config\RectorConfig;
use Rector\Doctrine\Set\DoctrineSetList;
use Rector\PHPUnit\CodeQuality\Rector\Class_\PreferPHPUnitSelfCallRector;
use Rector\Set\ValueObject\SetList;
use Rector\Strict\Rector\BooleanNot\BooleanInBooleanNotRuleFixerRector;
use Rector\Strict\Rector\Empty_\DisallowedEmptyRuleFixerRector;
return RectorConfig
::configure()
->withPaths([
__DIR__ . '/src',
__DIR__ . '/tests',
])
->withRootFiles()
->withPHPStanConfigs([
__DIR__ . '/phpstan.dist.neon',
// rector does not load phpstan extension automatically so require them manually here:
// __DIR__ . '/vendor/phpstan/phpstan-doctrine/extension.neon',
// __DIR__ . '/vendor/phpstan/phpstan-symfony/extension.neon',
])
// Optional?
->withSymfonyContainerPhp(__DIR__ . '/tests/rector/symfony-container.php')
// For SULU
// ->withSymfonyContainerXml(__DIR__ . '/var/cache/website/dev/App_KernelDevDebugContainer.xml')
// For Symfony
->withSymfonyContainerXml(__DIR__ . '/var/cache/dev/App_KernelDevDebugContainer.xml')
->withPhpSets(
php84: true,
)
->withImportNames(
importShortClasses: false,
)
->withPreparedSets(
codeQuality: true,
codingStyle: true,
strictBooleans: true,
phpunitCodeQuality: true,
doctrineCodeQuality: true,
)
->withComposerBased(
twig: true,
doctrine: true,
phpunit: true,
symfony: true,
)
->withSets([
DoctrineSetList::ANNOTATIONS_TO_ATTRIBUTES,
DoctrineSetList::DOCTRINE_CODE_QUALITY,
SetList::DEAD_CODE,
SetList::CODE_QUALITY,
SetList::PHP_84,
])
->withRules([
PreferPHPUnitSelfCallRector::class,
])
->withSkip([
SimplifyEmptyCheckOnEmptyArrayRector::class,
SimplifyEmptyArrayCheckRector::class,
FlipTypeControlToUseExclusiveTypeRector::class,
DisallowedEmptyRuleFixerRector::class,
IssetOnPropertyObjectToPropertyExistsRector::class,
ExplicitBoolCompareRector::class,
CombineIfRector::class,
NewlineAfterStatementRector::class,
RepeatedOrEqualToInArrayRector::class,
EncapsedStringsToSprintfRector::class,
BooleanInBooleanNotRuleFixerRector::class,
])
// ->withSets([
// // activate when doing updates:
// // SymfonyLevelSetList::UP_TO_SYMFONY_63,
// // activate when doing updates:
// // PHPUnitLevelSetList::UP_TO_PHPUNIT_90,
// // PHPUnitSetList::PHPUNIT_91,
// // sulu rules
// // activate for updates when doing updates:
// // SuluLevelSetList::UP_TO_SULU_25,
// ])
;