-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrector.php
62 lines (56 loc) · 2.16 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
<?php
declare(strict_types=1);
use Rector\CodingStyle\Rector\Encapsed\EncapsedStringsToSprintfRector;
use Rector\CodingStyle\Rector\Encapsed\WrapEncapsedVariableInCurlyBracesRector;
use Rector\Config\RectorConfig;
use Rector\Naming\Rector\Assign\RenameVariableToMatchMethodCallReturnTypeRector;
use Rector\Naming\Rector\Class_\RenamePropertyToMatchTypeRector;
use Rector\Naming\Rector\ClassMethod\RenameParamToMatchTypeRector;
use Rector\Php55\Rector\Class_\ClassConstantToSelfClassRector;
use Rector\PHPUnit\Set\PHPUnitLevelSetList;
use Rector\PHPUnit\Set\PHPUnitSetList;
use Rector\Set\ValueObject\LevelSetList;
use Rector\Set\ValueObject\SetList;
use RectorLaravel\Set\LaravelLevelSetList;
use RectorLaravel\Set\LaravelSetList;
return static function (RectorConfig $rectorConfig): void {
$rectorConfig->sets([
SetList::CODE_QUALITY,
SetList::CODING_STYLE,
SetList::DEAD_CODE,
SetList::EARLY_RETURN,
SetList::INSTANCEOF,
SetList::NAMING,
SetList::PRIVATIZATION,
SetList::TYPE_DECLARATION,
LevelSetList::UP_TO_PHP_82,
LaravelSetList::ARRAY_STR_FUNCTIONS_TO_STATIC_CALL,
LaravelSetList::LARAVEL_ARRAY_STR_FUNCTION_TO_STATIC_CALL,
LaravelSetList::LARAVEL_CODE_QUALITY,
LaravelSetList::LARAVEL_LEGACY_FACTORIES_TO_CLASSES,
LaravelLevelSetList::UP_TO_LARAVEL_100,
PHPUnitSetList::PHPUNIT_CODE_QUALITY,
PHPUnitLevelSetList::UP_TO_PHPUNIT_100,
]);
$rectorConfig->skip([
ClassConstantToSelfClassRector::class,
EncapsedStringsToSprintfRector::class,
RenameParamToMatchTypeRector::class,
RenamePropertyToMatchTypeRector::class,
RenameVariableToMatchMethodCallReturnTypeRector::class,
WrapEncapsedVariableInCurlyBracesRector::class,
]);
$rectorConfig->importNames();
$rectorConfig->importShortClasses();
$rectorConfig->paths([
__DIR__.'/app',
__DIR__.'/bootstrap/app.php',
__DIR__.'/config',
__DIR__.'/database/seeders',
__DIR__.'/public/index.php',
__DIR__.'/routes',
__DIR__.'/tests',
__DIR__.'/artisan',
__DIR__.'/rector.php',
]);
};