-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrector.php
More file actions
67 lines (60 loc) · 2.04 KB
/
Copy pathrector.php
File metadata and controls
67 lines (60 loc) · 2.04 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
<?php
declare(strict_types=1);
use Rector\CodeQuality\Rector\Include_\AbsolutizeRequireAndIncludePathRector;
use Rector\Config\RectorConfig;
use Rector\Doctrine\Set\DoctrineSetList;
use Rector\EarlyReturn\Rector\If_\ChangeOrIfContinueToMultiContinueRector;
use Rector\EarlyReturn\Rector\Return_\ReturnBinaryOrToEarlyReturnRector;
use Rector\Php81\Rector\Property\ReadOnlyPropertyRector;
use Rector\Set\ValueObject\SetList;
use Rector\Symfony\Set\SymfonySetList;
use Rector\Symfony\Set\TwigSetList;
return RectorConfig::configure()
->withPreparedSets(
deadCode: true,
codeQuality: true,
codingStyle: true,
typeDeclarations: true,
privatization: false, # zerhaut setup bei den unit tests
naming: false, # da man keine Ausnahmen machen kann ist es nicht vorteilhaft
instanceOf: true,
earlyReturn: true,
strictBooleans: true,
)
->withAttributesSets(symfony: true, doctrine: true)
->withPaths([
__DIR__.'/src',
__DIR__.'/tests',
])
->withRootFiles()
->withPhpSets()
->withImportNames()
->withSkip([
# verhindert das Decorator
ReadOnlyPropertyRector::class,
# macht den Code unlessbarer (SetList::EARLY_RETURN)
ChangeOrIfContinueToMultiContinueRector::class,
ReturnBinaryOrToEarlyReturnRector::class,
# macht probleme bei deploy.php
AbsolutizeRequireAndIncludePathRector::class,
])
->withSets([
# Doctrine
DoctrineSetList::ANNOTATIONS_TO_ATTRIBUTES,
DoctrineSetList::GEDMO_ANNOTATIONS_TO_ATTRIBUTES,
DoctrineSetList::DOCTRINE_CODE_QUALITY,
# Framework
TwigSetList::TWIG_240,
SymfonySetList::SYMFONY_CODE_QUALITY,
SymfonySetList::SYMFONY_CONSTRUCTOR_INJECTION,
SymfonySetList::SYMFONY_64,
SymfonySetList::CONFIGS,
# SetList
SetList::TYPE_DECLARATION,
SetList::CODE_QUALITY,
SetList::CODING_STYLE,
SetList::DEAD_CODE,
SetList::EARLY_RETURN,
])
->withoutParallel()
;