-
Notifications
You must be signed in to change notification settings - Fork 263
/
rector.php
42 lines (36 loc) · 1.41 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
<?php
use Rector\Config\RectorConfig;
use Rector\DeadCode\Rector\ClassLike\RemoveAnnotationRector;
use Rector\Php70\Rector\StmtsAwareInterface\IfIssetToCoalescingRector;
use Rector\Php71\Rector\FuncCall\RemoveExtraParametersRector;
use Rector\Php80\Rector\Switch_\ChangeSwitchToMatchRector;
use Rector\PHPUnit\PHPUnit100\Rector\Class_\StaticDataProviderClassMethodRector;
use Rector\PHPUnit\Set\PHPUnitSetList;
use Rector\Set\ValueObject\LevelSetList;
return static function (RectorConfig $rectorConfig): void {
$rectorConfig->paths([
__DIR__ . '/examples',
__DIR__ . '/src',
__DIR__ . '/tests',
__DIR__ . '/tools',
]);
// Modernize code
$rectorConfig->sets([
LevelSetList::UP_TO_PHP_74,
PHPUnitSetList::PHPUNIT_100,
]);
$rectorConfig->rule(ChangeSwitchToMatchRector::class);
$rectorConfig->rule(StaticDataProviderClassMethodRector::class);
// phpcs:disable Squiz.Arrays.ArrayDeclaration.KeySpecified
$rectorConfig->skip([
RemoveExtraParametersRector::class,
// Do not use ternaries extensively
IfIssetToCoalescingRector::class,
ChangeSwitchToMatchRector::class => [
__DIR__ . '/tests/SpecTests/Operation.php',
],
]);
// phpcs:enable
// All classes are public API by default, unless marked with @internal.
$rectorConfig->ruleWithConfiguration(RemoveAnnotationRector::class, ['api']);
};