-
-
Notifications
You must be signed in to change notification settings - Fork 15
/
rector.php
42 lines (36 loc) · 2.3 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
declare(strict_types=1);
use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector;
use Rector\Config\RectorConfig;
use Rector\PHPUnit\Rector\Class_\PreferPHPUnitSelfCallRector;
use Rector\PHPUnit\Set\PHPUnitSetList;
use Rector\Set\ValueObject\LevelSetList;
return static function (RectorConfig $rectorConfig): void {
$rectorConfig->paths([
__DIR__ . '/packages',
]);
//$rectorConfig->phpstanConfig(__DIR__ . '/phpstan.neon');
// register a single rule
$rectorConfig->rule(InlineConstructorDefaultToPropertyRector::class);
$rectorConfig->rule(Rector\CodeQuality\Rector\Class_\CompleteDynamicPropertiesRector::class);
$rectorConfig->rule(Rector\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromStrictTypedCallRector::class);
$rectorConfig->rule(Rector\TypeDeclaration\Rector\Property\TypedPropertyFromStrictConstructorRector::class);
$rectorConfig->rule(Rector\TypeDeclaration\Rector\Property\TypedPropertyFromStrictGetterMethodReturnTypeRector::class);
$rectorConfig->rule(Rector\TypeDeclaration\Rector\Property\TypedPropertyFromStrictSetUpRector::class);
$rectorConfig->rule(Rector\Privatization\Rector\ClassMethod\PrivatizeFinalClassMethodRector::class);
$rectorConfig->rule(Rector\Privatization\Rector\Property\PrivatizeFinalClassPropertyRector::class);
$rectorConfig->rule(Rector\Privatization\Rector\MethodCall\PrivatizeLocalGetterToPropertyRector::class);
$rectorConfig->rule(Rector\DeadCode\Rector\ClassMethod\RemoveEmptyClassMethodRector::class);
$rectorConfig->rule(Rector\DeadCode\Rector\ClassMethod\RemoveUnusedConstructorParamRector::class);
$rectorConfig->rule(Rector\DeadCode\Rector\Foreach_\RemoveUnusedForeachKeyRector::class);
$rectorConfig->rule(Rector\DeadCode\Rector\ClassConst\RemoveUnusedPrivateClassConstantRector::class);
$rectorConfig->rule(Rector\DeadCode\Rector\ClassMethod\RemoveUnusedPrivateMethodParameterRector::class);
$rectorConfig->rule(Rector\DeadCode\Rector\ClassMethod\RemoveUnusedPrivateMethodRector::class);
$rectorConfig->rule(PreferPHPUnitSelfCallRector::class);
$rectorConfig->rule(Rector\PHPUnit\PHPUnit100\Rector\Class_\AddProphecyTraitRector::class);
$rectorConfig->importNames();
// define sets of rules
$rectorConfig->sets([
LevelSetList::UP_TO_PHP_81,
]);
};