-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rector.php
55 lines (45 loc) · 1.92 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
<?php
declare(strict_types=1);
use Rector\CodeQuality\Rector\If_\ExplicitBoolCompareRector;
use Rector\ValueObject\PhpVersion;
use Rector\Php80\Rector\Catch_\RemoveUnusedVariableInCatchRector;
use Rector\Php81\Rector\FuncCall\NullToStrictStringFuncCallArgRector;
use Rector\Set\ValueObject\LevelSetList;
use Rector\Set\ValueObject\SetList;
use Rector\Config\RectorConfig;
use Rector\Strict\Rector\Empty_\DisallowedEmptyRuleFixerRector;
use Ssch\TYPO3Rector\Configuration\Typo3Option;
use Ssch\TYPO3Rector\Set\Typo3LevelSetList;
use Ssch\TYPO3Rector\Set\Typo3SetList;
// See https://github.com/sabbelasichon/typo3-rector/tree/main/docs
return static function (RectorConfig $rectorConfig): void {
$rectorConfig->sets([
SetList::CODING_STYLE,
SetList::CODE_QUALITY,
LevelSetList::UP_TO_PHP_82,
Typo3LevelSetList::UP_TO_TYPO3_12,
Typo3SetList::TYPO3_13,
]);
// Define your target version which you want to support
$rectorConfig->phpVersion(PhpVersion::PHP_81);
$rectorConfig->skip([
NullToStrictStringFuncCallArgRector::class,
DisallowedEmptyRuleFixerRector::class,
RemoveUnusedVariableInCatchRector::class,
ExplicitBoolCompareRector::class,
]);
// If you only want to process one/some TYPO3 extension(s), you can specify its path(s) here.
// If you use the option --config change __DIR__ to getcwd()
$rectorConfig->paths([
__DIR__,
]);
// In order to have a better analysis from phpstan we teach it here some more things
$rectorConfig->phpstanConfig(Typo3Option::PHPSTAN_FOR_RECTOR_PATH);
// FQN classes are not imported by default. If you don't do it manually after every Rector run, enable it by:
$rectorConfig->importNames();
// If you use importNames(), you should consider excluding some TYPO3 files.
$rectorConfig->skip([
__DIR__ . '/.github/*',
__DIR__ . '/Resources/Private/Php/*',
]);
};