-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrector.php
63 lines (57 loc) · 2.29 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
63
<?php
declare(strict_types=1);
use Rector\CodeQuality\Rector\Assign\SplitListAssignToSeparateLineRector;
use Rector\CodingStyle\Rector\ClassConst\VarConstantCommentRector;
use Rector\CodingStyle\Rector\Encapsed\EncapsedStringsToSprintfRector;
use Rector\CodingStyle\Rector\Encapsed\WrapEncapsedVariableInCurlyBracesRector;
use Rector\Config\RectorConfig;
use Rector\Core\ValueObject\PhpVersion;
use Rector\Laravel\Set\LaravelLevelSetList;
use Rector\Naming\Rector\Assign\RenameVariableToMatchMethodCallReturnTypeRector;
use Rector\Naming\Rector\Class_\RenamePropertyToMatchTypeRector;
use Rector\Naming\Rector\ClassMethod\RenameParamToMatchTypeRector;
use Rector\PHPUnit\Set\PHPUnitLevelSetList;
use Rector\Set\ValueObject\SetList;
use Rector\TypeDeclaration\Rector\ClassMethod\AddArrayReturnDocTypeRector;
use Rector\TypeDeclaration\Rector\ClassMethod\ArrayShapeFromConstantArrayReturnRector;
return static function (RectorConfig $rectorConfig): void {
$rectorConfig->sets([
SetList::PHP_81,
SetList::CODE_QUALITY,
SetList::CODING_STYLE,
SetList::DEAD_CODE,
SetList::EARLY_RETURN,
SetList::NAMING,
SetList::PRIVATIZATION,
SetList::TYPE_DECLARATION,
SetList::TYPE_DECLARATION_STRICT,
LaravelLevelSetList::UP_TO_LARAVEL_90,
PHPUnitLevelSetList::UP_TO_PHPUNIT_100,
]);
$rectorConfig->skip([
AddArrayReturnDocTypeRector::class,
ArrayShapeFromConstantArrayReturnRector::class,
EncapsedStringsToSprintfRector::class,
RenameParamToMatchTypeRector::class,
RenamePropertyToMatchTypeRector::class,
RenameVariableToMatchMethodCallReturnTypeRector::class,
SplitListAssignToSeparateLineRector::class,
VarConstantCommentRector::class,
WrapEncapsedVariableInCurlyBracesRector::class,
'app/Providers/RouteServiceProvider.php',
]);
$rectorConfig->phpVersion(PhpVersion::PHP_81);
$rectorConfig->importNames();
$rectorConfig->importShortClasses();
$rectorConfig->disableParallel();
$rectorConfig->paths([
__DIR__.'/app',
__DIR__.'/bootstrap/app.php',
__DIR__.'/config',
__DIR__.'/public/index.php',
__DIR__.'/routes',
__DIR__.'/tests',
__DIR__.'/artisan',
__DIR__.'/rector.php',
]);
};