-
Notifications
You must be signed in to change notification settings - Fork 9
/
rector.php
43 lines (40 loc) · 1.32 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
<?php
declare(strict_types=1);
use Rector\Config\RectorConfig;
use Rector\DeadCode\Rector\StaticCall\RemoveParentCallWithoutParentRector;
use Rector\PHPUnit\CodeQuality\Rector\Class_\PreferPHPUnitThisCallRector;
use Rector\PHPUnit\CodeQuality\Rector\ClassMethod\ReplaceTestAnnotationWithPrefixedFunctionRector;
use Rector\PHPUnit\Set\PHPUnitSetList;
return RectorConfig::configure()
->withPaths([
__DIR__ . '/Classes',
__DIR__ . '/Tests',
])
->withPhpSets()
->withAutoloadPaths([
__DIR__ . '/.Build/vendor/autoload.php',
])
->withImportNames(
importShortClasses: false,
removeUnusedImports: true,
)
->withPreparedSets(
deadCode: true,
codeQuality: true,
typeDeclarations: true,
earlyReturn: true,
)
->withSets([
PHPUnitSetList::PHPUNIT_CODE_QUALITY,
PHPUnitSetList::PHPUNIT_100,
])
->withRootFiles()
->withSkip([
__DIR__ . '/Classes/Model/Type/*',
__DIR__ . '/Classes/ViewHelpers/Type/*',
PreferPHPUnitThisCallRector::class,
RemoveParentCallWithoutParentRector::class => [
__DIR__ . '/Classes/AdminPanel/SchemaModule', // can be removed with minimum compatibility to TYPO3 v12 LTS
],
ReplaceTestAnnotationWithPrefixedFunctionRector::class,
]);