-
-
Notifications
You must be signed in to change notification settings - Fork 57
/
Copy pathrector.php
79 lines (73 loc) · 3.09 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
71
72
73
74
75
76
77
78
79
<?php
declare(strict_types=1);
use Rector\Caching\ValueObject\Storage\FileCacheStorage;
use Rector\CodeQuality\Rector\Identical\FlipTypeControlToUseExclusiveTypeRector;
use Rector\CodeQuality\Rector\If_\SimplifyIfReturnBoolRector;
use Rector\CodingStyle\Rector\Assign\SplitDoubleAssignRector;
use Rector\CodingStyle\Rector\Catch_\CatchExceptionNameMatchingTypeRector;
use Rector\CodingStyle\Rector\ClassMethod\NewlineBeforeNewAssignSetRector;
use Rector\CodingStyle\Rector\Stmt\NewlineAfterStatementRector;
use Rector\Config\RectorConfig;
use Rector\Php83\Rector\ClassMethod\AddOverrideAttributeToOverriddenMethodsRector;
use Rector\Privatization\Rector\Class_\FinalizeTestCaseClassRector;
use Rector\Strict\Rector\Empty_\DisallowedEmptyRuleFixerRector;
use Rector\TypeDeclaration\Rector\StmtsAwareInterface\DeclareStrictTypesRector;
return RectorConfig::configure()
->withPaths([
__DIR__.'/Player',
])
->withCache(
cacheDirectory: __DIR__.'/var/cache/rector',
cacheClass: FileCacheStorage::class,
)
->withImportNames(
importNames: true,
importDocBlockNames: true,
importShortClasses: false, // do not enable, it changes `\Datetime` (and co.) into `use` statement
removeUnusedImports: false, // do not enable, it removed imports that are used in comments
)
->withPhpSets(php83: true)
->withPreparedSets(
deadCode: true,
codeQuality: true,
codingStyle: true,
typeDeclarations: true,
privatization: true,
naming: false, // do not enable, it changes variable name and break auto-wiring
instanceOf: true,
earlyReturn: true,
strictBooleans: true,
carbon: false, // do not enable, it replaces time functions with \Carbon lib
rectorPreset: true,
phpunitCodeQuality: true,
doctrineCodeQuality: true,
symfonyCodeQuality: true,
symfonyConfigs: false, // do not enable, it changes variable name and break auto-wiring
)
->withAttributesSets(
symfony: true,
doctrine: true,
mongoDb: false, // do not enable, we don't use mongoDb
gedmo: false, // do not enable, we don't use gedmo
phpunit: true,
fosRest: false, // do not enable, we don't use fosRest
jms: false, // do not enable, we don't use jms
sensiolabs: false, // do not enable, we don't use sensiolabs
behat: false, // do not enable, we don't use behat
)
->withSkip([
// injected by php83 preset
AddOverrideAttributeToOverriddenMethodsRector::class,
// injected by codeQuality preset
DisallowedEmptyRuleFixerRector::class,
FlipTypeControlToUseExclusiveTypeRector::class,
SimplifyIfReturnBoolRector::class,
// injected by codingStyle preset
CatchExceptionNameMatchingTypeRector::class,
NewlineAfterStatementRector::class,
NewlineBeforeNewAssignSetRector::class,
SplitDoubleAssignRector::class,
// injected by rectorPreset preset
DeclareStrictTypesRector::class,
FinalizeTestCaseClassRector::class,
]);