-
Notifications
You must be signed in to change notification settings - Fork 0
/
rector.php
61 lines (52 loc) · 1.86 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
<?php
declare(strict_types=1);
use Rector\Config\RectorConfig;
use Rector\Naming\Rector\Class_\RenamePropertyToMatchTypeRector;
use Rector\Php74\Rector\LNumber\AddLiteralSeparatorToNumberRector;
use Rector\PHPUnit\CodeQuality\Rector\Class_\PreferPHPUnitSelfCallRector;
use Rector\PHPUnit\CodeQuality\Rector\Class_\PreferPHPUnitThisCallRector;
use Rector\PHPUnit\Set\PHPUnitSetList;
use Rector\Set\ValueObject\LevelSetList;
use Rector\Set\ValueObject\SetList;
use Rector\TypeDeclaration\Rector\StmtsAwareInterface\DeclareStrictTypesRector;
return static function (RectorConfig $rectorConfig): void {
$rectorConfig->paths([
__DIR__ . '/src',
__DIR__ . '/tests',
__DIR__ . '/rector.php',
]);
$rectorConfig->phpstanConfig(__DIR__ . '/phpstan.neon.dist');
$rectorConfig->sets([
LevelSetList::UP_TO_PHP_82,
PHPUnitSetList::PHPUNIT_40,
PHPUnitSetList::PHPUNIT_50,
PHPUnitSetList::PHPUNIT_60,
PHPUnitSetList::PHPUNIT_70,
PHPUnitSetList::PHPUNIT_80,
PHPUnitSetList::PHPUNIT_90,
PHPUnitSetList::PHPUNIT_100,
PHPUnitSetList::PHPUNIT_CODE_QUALITY,
PHPUnitSetList::ANNOTATIONS_TO_ATTRIBUTES,
SetList::CODE_QUALITY,
SetList::CODING_STYLE,
SetList::DEAD_CODE,
SetList::STRICT_BOOLEANS,
SetList::NAMING,
SetList::PRIVATIZATION,
SetList::TYPE_DECLARATION,
SetList::EARLY_RETURN,
SetList::INSTANCEOF,
]);
$rectorConfig->rules([
AddLiteralSeparatorToNumberRector::class,
DeclareStrictTypesRector::class,
PreferPHPUnitSelfCallRector::class,
]);
$rectorConfig->skip([
PreferPHPUnitThisCallRector::class,
// phpcs:ignore Squiz.Arrays.ArrayDeclaration.KeySpecified
RenamePropertyToMatchTypeRector::class => [
__DIR__ . '/tests',
],
]);
};