-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrector.php
60 lines (56 loc) · 2.05 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
<?php
declare(strict_types=1);
use Rector\Caching\ValueObject\Storage\FileCacheStorage;
use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector;
use Rector\CodeQuality\Rector\Identical\FlipTypeControlToUseExclusiveTypeRector;
use Rector\Config\RectorConfig;
use Rector\Doctrine\Set\DoctrineSetList;
use Rector\Php82\Rector\Class_\ReadOnlyClassRector;
use Rector\PHPUnit\Set\PHPUnitSetList;
use Rector\Strict\Rector\Ternary\DisallowedShortTernaryRuleFixerRector;
use Rector\Symfony\CodeQuality\Rector\Class_\EventListenerToEventSubscriberRector;
use Rector\Symfony\Set\SymfonySetList;
$symfonyContainer = __DIR__ . '/var/cache/test/App_KernelTestDebugContainer.xml';
if (file_exists(__DIR__ . '/var/cache/dev/App_KernelDevDebugContainer.xml')) {
$symfonyContainer = __DIR__ . '/var/cache/dev/App_KernelDevDebugContainer.xml';
}
return RectorConfig::configure()
->withPaths([
__DIR__ . '/config',
__DIR__ . '/public',
__DIR__ . '/src',
__DIR__ . '/tests',
])
->withSkip([
'**/config/bundles.php',
DisallowedShortTernaryRuleFixerRector::class,
EventListenerToEventSubscriberRector::class,
FlipTypeControlToUseExclusiveTypeRector::class,
])
->withCache(
cacheDirectory: 'var/cache/ci/rector',
cacheClass: FileCacheStorage::class,
)
->withSymfonyContainerXml($symfonyContainer)
->withImportNames(importShortClasses: false)
->withPreparedSets(
deadCode: true,
codeQuality: true,
typeDeclarations: true,
instanceOf: true,
strictBooleans: true,
)
->withAttributesSets(symfony: true, doctrine: true, phpunit: true)
->withSets([
SymfonySetList::SYMFONY_64,
SymfonySetList::SYMFONY_CODE_QUALITY,
DoctrineSetList::DOCTRINE_ORM_214,
DoctrineSetList::DOCTRINE_CODE_QUALITY,
PHPUnitSetList::PHPUNIT_100,
PHPUnitSetList::PHPUNIT_CODE_QUALITY,
])
->withRules([
InlineConstructorDefaultToPropertyRector::class,
ReadOnlyClassRector::class,
])
;