-
Notifications
You must be signed in to change notification settings - Fork 0
/
rector.php
84 lines (75 loc) · 2.84 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
<?php
declare(strict_types=1);
/*
* Copyright notice
*
* (c) DMK E-BUSINESS GmbH <[email protected]>
* All rights reserved
*
* This file is part of the "mkcleaner" Extension for TYPO3 CMS.
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* GNU Lesser General Public License can be found at
* www.gnu.org/licenses/lgpl.html
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
*/
use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector;
use Rector\Config\RectorConfig;
use Rector\PostRector\Rector\NameImportingPostRector;
use Rector\Set\ValueObject\LevelSetList;
use Rector\Set\ValueObject\SetList;
use Rector\ValueObject\PhpVersion;
use Ssch\TYPO3Rector\CodeQuality\General\ConvertImplicitVariablesToExplicitGlobalsRector;
use Ssch\TYPO3Rector\CodeQuality\General\ExtEmConfRector;
use Ssch\TYPO3Rector\Configuration\Typo3Option;
use Ssch\TYPO3Rector\Set\Typo3LevelSetList;
return static function (RectorConfig $rectorConfig): void {
$rectorConfig->paths([__DIR__]);
$rectorConfig->phpVersion(PhpVersion::PHP_81);
$rectorConfig->sets([
LevelSetList::UP_TO_PHP_83,
SetList::CODE_QUALITY,
SetList::CODING_STYLE,
SetList::DEAD_CODE,
SetList::STRICT_BOOLEANS,
SetList::PHP_82,
SetList::PRIVATIZATION,
SetList::TYPE_DECLARATION,
SetList::EARLY_RETURN,
SetList::INSTANCEOF,
Typo3LevelSetList::UP_TO_TYPO3_11,
]);
$rectorConfig->rule(InlineConstructorDefaultToPropertyRector::class);
$rectorConfig->ruleWithConfiguration(
ExtEmConfRector::class,
[
ExtEmConfRector::PHP_VERSION_CONSTRAINT => '8.1.0-8.3.99',
ExtEmConfRector::TYPO3_VERSION_CONSTRAINT => '11.5.0-12.4.99',
ExtEmConfRector::ADDITIONAL_VALUES_TO_BE_REMOVED => [],
]
);
$rectorConfig->rule(ConvertImplicitVariablesToExplicitGlobalsRector::class);
$rectorConfig->phpstanConfig(Typo3Option::PHPSTAN_FOR_RECTOR_PATH);
$rectorConfig->phpstanConfig(__DIR__.'/phpstan.neon');
$rectorConfig->skip([
// no namespace imports for these files:
NameImportingPostRector::class => [
'ext_localconf.php',
'ext_tables.php',
'ClassAliasMap.php',
__DIR__.'/Configuration/*.php',
__DIR__.'/Configuration/**/*.php',
],
]);
};