-
Notifications
You must be signed in to change notification settings - Fork 0
/
rector.php
45 lines (37 loc) · 1.22 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
<?php
use Rector\Config\RectorConfig;
use Rector\Set\ValueObject\LevelSetList;
use Rector\Set\ValueObject\SetList;
use Rector\CodeQuality\Rector\If_\ExplicitBoolCompareRector;
use Rector\CodingStyle\Rector\Stmt\NewlineAfterStatementRector;
use Rector\Php73\Rector\FuncCall\JsonThrowOnErrorRector;
use Rector\Php81\Rector\ClassConst\FinalizePublicClassConstantRector;
use Rector\DeadCode\Rector\If_\RemoveAlwaysTrueIfConditionRector;
function applyRectorDefaults(RectorConfig $rectorConfig) {
$rectorConfig->phpstanConfig(__DIR__ . '/../../../phpstan.neon');
$rectorConfig->fileExtensions([
'php',
'phtml'
]);
$rectorConfig->sets([
LevelSetList::UP_TO_PHP_82,
SetList::DEAD_CODE,
SetList::CODE_QUALITY,
SetList::CODING_STYLE
]);
};
function outeredgeRectorSkipDefaults() {
return [
__DIR__ . '/vendor',
NewlineAfterStatementRector::class => [
'*.phtml',
],
// Stop rector breaking short open tags
RemoveAlwaysTrueIfConditionRector::class => [
'*.phtml',
],
ExplicitBoolCompareRector::class,
FinalizePublicClassConstantRector::class,
JsonThrowOnErrorRector::class
];
}