-
Notifications
You must be signed in to change notification settings - Fork 7
/
rector.php
53 lines (40 loc) · 2.17 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
<?php
declare(strict_types=1);
use craft\rector\SetList as CraftSetList;
use Rector\Config\RectorConfig;
use Rector\Core\ValueObject\PhpVersion;
use Rector\PHPUnit\Set\PHPUnitSetList;
use Rector\Renaming\Rector\Name\RenameClassRector;
use Rector\Set\ValueObject\LevelSetList;
use Rector\Set\ValueObject\SetList;
return static function (RectorConfig $rectorConfig): void {
// PHP 8.0
$rectorConfig->phpVersion(PhpVersion::PHP_80);
$rectorConfig->import(LevelSetList::UP_TO_PHP_80);
// Misc
$rectorConfig->import(CraftSetList::CRAFT_CMS_40);
$rectorConfig->import(SetList::DEAD_CODE);
$rectorConfig->import(SetList::TYPE_DECLARATION);
$rectorConfig->import(SetList::CODE_QUALITY);
$rectorConfig->import(SetList::CODING_STYLE);
$rectorConfig->import(PHPUnitSetList::PHPUNIT_90);
$rectorConfig->skip([
\Rector\CodingStyle\Rector\Encapsed\EncapsedStringsToSprintfRector::class,
\Rector\CodingStyle\Rector\ClassConst\RemoveFinalFromConstRector::class,
\Rector\CodeQuality\Rector\If_\SimplifyIfReturnBoolRector::class,
\Rector\CodeQuality\Rector\Ternary\UnnecessaryTernaryExpressionRector::class,
\Rector\CodeQuality\Rector\If_\ExplicitBoolCompareRector::class,
\Rector\CodingStyle\Rector\Encapsed\EncapsedStringsToSprintfRector::class,
\Rector\CodingStyle\Rector\ClassConst\RemoveFinalFromConstRector::class,
\Rector\CodingStyle\Rector\PostInc\PostIncDecToPreIncDecRector::class,
\Rector\CodingStyle\Rector\ClassMethod\UnSpreadOperatorRector::class,
\Rector\CodeQuality\Rector\If_\SimplifyIfReturnBoolRector::class,
\Rector\CodeQuality\Rector\Ternary\UnnecessaryTernaryExpressionRector::class,
\Rector\CodingStyle\Rector\ClassConst\VarConstantCommentRector::class,
\Rector\CodeQuality\Rector\If_\ExplicitBoolCompareRector::class,
\Rector\Php74\Rector\FuncCall\ArraySpreadInsteadOfArrayMergeRector::class,
\Rector\Php73\Rector\FuncCall\JsonThrowOnErrorRector::class,
\Rector\Php80\Rector\Class_\ClassPropertyAssignToConstructorPromotionRector::class,
\Rector\TypeDeclaration\Rector\FunctionLike\ReturnTypeDeclarationRector::class
]);
};