forked from revive-adserver/revive-adserver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrector.php
99 lines (91 loc) · 3.95 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<?php
declare(strict_types=1);
namespace REVIVE_ROOT;
use Rector\Caching\ValueObject\Storage\FileCacheStorage;
use Rector\CodeQuality\Rector\ClassMethod\ExplicitReturnNullRector;
use Rector\CodeQuality\Rector\ClassMethod\LocallyCalledStaticMethodToNonStaticRector;
use Rector\CodeQuality\Rector\Concat\JoinStringConcatRector;
use Rector\CodeQuality\Rector\Empty_\SimplifyEmptyCheckOnEmptyArrayRector;
use Rector\CodeQuality\Rector\Equal\UseIdenticalOverEqualWithSameTypeRector;
use Rector\CodeQuality\Rector\For_\ForRepeatedCountToOwnVariableRector;
use Rector\CodeQuality\Rector\FunctionLike\SimplifyUselessVariableRector;
use Rector\CodeQuality\Rector\If_\CombineIfRector;
use Rector\CodeQuality\Rector\If_\ExplicitBoolCompareRector;
use Rector\CodeQuality\Rector\If_\SimplifyIfElseToTernaryRector;
use Rector\CodeQuality\Rector\Include_\AbsolutizeRequireAndIncludePathRector;
use Rector\CodeQuality\Rector\Isset_\IssetOnPropertyObjectToPropertyExistsRector;
use Rector\Config\RectorConfig;
use Rector\DeadCode\Rector\ClassMethod\RemoveEmptyClassMethodRector;
use Rector\Php71\Rector\FuncCall\RemoveExtraParametersRector;
use Rector\Php72\Rector\Assign\ListEachRector;
use Rector\Php72\Rector\Assign\ReplaceEachAssignmentWithKeyCurrentRector;
use Rector\Php73\Rector\ConstFetch\SensitiveConstantNameRector;
use Rector\Php80\Rector\Class_\ClassPropertyAssignToConstructorPromotionRector;
use Rector\Php80\Rector\FunctionLike\MixedTypeRector;
use Rector\Php81\Rector\FuncCall\NullToStrictStringFuncCallArgRector;
use Rector\Set\ValueObject\LevelSetList;
use Rector\Set\ValueObject\SetList;
use Rector\Strict\Rector\Empty_\DisallowedEmptyRuleFixerRector;
return function (RectorConfig $rectorConfig): void {
$rectorConfig->cacheClass(FileCacheStorage::class);
$rectorConfig->cacheDirectory(__DIR__ . '/var/cache/tools/rector');
$rectorConfig->paths(
array_merge(
[
__DIR__ . '/etc',
__DIR__ . '/lib/max',
__DIR__ . '/lib/OA',
__DIR__ . '/lib/OX',
__DIR__ . '/lib/RV',
__DIR__ . '/maintenance',
__DIR__ . '/plugins_repo',
__DIR__ . '/scripts',
__DIR__ . '/www/admin',
__DIR__ . '/www/api',
__DIR__ . '/www/delivery_dev',
__DIR__ . '/www/devel',
__DIR__ . '/lib/pear',
__DIR__ . '/lib/smarty',
],
glob(__DIR__ . '/lib/*.php'),
glob(__DIR__ . '/*.php'),
),
);
$rectorConfig->sets([
LevelSetList::UP_TO_PHP_81,
SetList::CODE_QUALITY,
]);
$rectorConfig->rules([
RemoveEmptyClassMethodRector::class,
]);
$rectorConfig->skip([
__DIR__ . '*/tests/*',
__DIR__ . '/www/api/rest',
__DIR__ . '/plugins_repo/openXDeveloperToolbox/www/admin/plugins/oxPlugin/etc',
__DIR__ . '/lib/pear',
__DIR__ . '/lib/smarty',
__DIR__ . '/lib/max/language',
'*/etc/changes/*.php',
'*xajax*',
ExplicitBoolCompareRector::class,
UseIdenticalOverEqualWithSameTypeRector::class,
AbsolutizeRequireAndIncludePathRector::class,
IssetOnPropertyObjectToPropertyExistsRector::class,
NullToStrictStringFuncCallArgRector::class,
MixedTypeRector::class,
RemoveExtraParametersRector::class,
ClassPropertyAssignToConstructorPromotionRector::class,
DisallowedEmptyRuleFixerRector::class,
CombineIfRector::class,
SimplifyIfElseToTernaryRector::class,
LocallyCalledStaticMethodToNonStaticRector::class,
ForRepeatedCountToOwnVariableRector::class,
SimplifyEmptyCheckOnEmptyArrayRector::class,
SimplifyUselessVariableRector::class,
JoinStringConcatRector::class,
SensitiveConstantNameRector::class,
ListEachRector::class,
ReplaceEachAssignmentWithKeyCurrentRector::class,
ExplicitReturnNullRector::class,
]);
};