forked from sabbelasichon/typo3-rector
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rector.php
50 lines (41 loc) · 1.89 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
<?php
declare(strict_types=1);
use Rector\CodingStyle\Rector\ClassConst\VarConstantCommentRector;
use Rector\Config\RectorConfig;
use Rector\DeadCode\Rector\Assign\RemoveUnusedVariableAssignRector;
use Rector\Php55\Rector\String_\StringClassNameToClassConstantRector;
use Rector\Php80\Rector\Class_\ClassPropertyAssignToConstructorPromotionRector;
use Rector\PHPUnit\Rector\Class_\AddSeeTestAnnotationRector;
use Rector\Set\ValueObject\LevelSetList;
use Rector\Set\ValueObject\SetList;
use Ssch\TYPO3Rector\Rules\Rector\Misc\AddCodeCoverageIgnoreToMethodRectorDefinitionRector;
return static function (RectorConfig $rectorConfig): void {
$rectorConfig->import(__DIR__ . '/config/config.php');
$rectorConfig->parallel();
$rectorConfig->importNames();
$rectorConfig->importShortClasses(false);
$rectorConfig->phpstanConfig(__DIR__ . '/phpstan.neon');
$rectorConfig->rule(AddCodeCoverageIgnoreToMethodRectorDefinitionRector::class);
$rectorConfig->rule(AddSeeTestAnnotationRector::class);
$rectorConfig->rule(VarConstantCommentRector::class);
$rectorConfig->paths([__DIR__ . '/utils', __DIR__ . '/src', __DIR__ . '/tests']);
$rectorConfig->sets([
LevelSetList::UP_TO_PHP_74,
SetList::PRIVATIZATION,
SetList::CODING_STYLE,
SetList::CODE_QUALITY,
SetList::DEAD_CODE,
]);
$rectorConfig->skip([
RemoveUnusedVariableAssignRector::class,
__DIR__ . '/utils/generator/templates',
// tests
__DIR__ . '/tests/Rector/v11/v0/UsePhpNativeStringFunctionsRector/Source',
StringClassNameToClassConstantRector::class,
__DIR__ . '/src/Rector/v8/v0/RefactorRemovedMethodsFromContentObjectRendererRector.php',
__DIR__ . '/src/Rector/v8/v6/RefactorTCARector.php',
__DIR__ . '/src/Set',
'*/Fixture/*',
]);
$rectorConfig->rule(ClassPropertyAssignToConstructorPromotionRector::class);
};