-
-
Notifications
You must be signed in to change notification settings - Fork 36
/
Copy pathrector.php
59 lines (55 loc) · 2.56 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
<?php
declare(strict_types=1);
use Rector\CodeQuality\Rector\Concat\JoinStringConcatRector;
use Rector\CodeQuality\Rector\Identical\FlipTypeControlToUseExclusiveTypeRector;
use Rector\CodeQuality\Rector\If_\SimplifyIfReturnBoolRector;
use Rector\CodingStyle\Rector\Catch_\CatchExceptionNameMatchingTypeRector;
use Rector\CodingStyle\Rector\Encapsed\EncapsedStringsToSprintfRector;
use Rector\CodingStyle\Rector\String_\SymplifyQuoteEscapeRector;
use Rector\CodingStyle\Rector\String_\UseClassKeywordForClassNameResolutionRector;
use Rector\Config\RectorConfig;
use Rector\DeadCode\Rector\ClassMethod\RemoveUnusedPrivateMethodParameterRector;
use Rector\DeadCode\Rector\If_\RemoveAlwaysTrueIfConditionRector;
use Rector\EarlyReturn\Rector\Return_\ReturnBinaryOrToEarlyReturnRector;
use Rector\Php74\Rector\Closure\ClosureToArrowFunctionRector;
use Rector\Set\ValueObject\LevelSetList;
use Rector\Set\ValueObject\SetList;
return RectorConfig::configure()
->withSets([
LevelSetList::UP_TO_PHP_81,
// https://getrector.com/blog/5-common-mistakes-in-rector-config-and-how-to-avoid-them
SetList::DEAD_CODE,
SetList::CODE_QUALITY,
SetList::CODING_STYLE,
SetList::TYPE_DECLARATION,
SetList::PRIVATIZATION,
SetList::EARLY_RETURN,
SetList::INSTANCEOF,
])
->withPaths([
__DIR__.'/api',
__DIR__.'/public',
])
->withSkip([
__DIR__.'/downgrade.php',
__DIR__.'/stub.php',
CatchExceptionNameMatchingTypeRector::class,
ReturnBinaryOrToEarlyReturnRector::class,
FlipTypeControlToUseExclusiveTypeRector::class,
RemoveAlwaysTrueIfConditionRector::class => [
__DIR__.'/api/Command/AboutCommand.php',
__DIR__.'/api/Process/PhpExecutableFinder.php',
__DIR__.'/api/TaskOperation/AbstractInlineOperation.php',
],
SimplifyIfReturnBoolRector::class => [__DIR__.'/api/IntegrityCheck/GraphicsLibCheck.php'],
RemoveUnusedPrivateMethodParameterRector::class => [__DIR__.'/api/TaskOperation/Contao/CreateContaoOperation.php'],
JoinStringConcatRector::class => [__DIR__.'/api/ApiKernel.php'],
ClosureToArrowFunctionRector::class => [__DIR__.'/scoper.inc.php'],
EncapsedStringsToSprintfRector::class => [__DIR__.'/scoper.inc.php'],
SymplifyQuoteEscapeRector::class => [__DIR__.'/scoper.inc.php'],
UseClassKeywordForClassNameResolutionRector::class => [__DIR__.'/scoper.inc.php'],
])
->withRootFiles()
->withParallel()
->withCache(sys_get_temp_dir().'/rector/contao-manager')
;