-
Notifications
You must be signed in to change notification settings - Fork 3
/
rector.php
51 lines (47 loc) · 1.5 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
<?php
declare(strict_types=1);
use Rector\Config\RectorConfig;
use Rector\PHPUnit\Set\PHPUnitSetList;
use RectorLaravel\Set\LaravelSetList;
return RectorConfig::configure()
->withPaths([
__DIR__ . '/app',
__DIR__ . '/bootstrap',
__DIR__ . '/config',
__DIR__ . '/public',
__DIR__ . '/resources',
__DIR__ . '/routes',
__DIR__ . '/tests',
])
->withRootFiles()
// Larastan's bootstrap file doesn't run when Rector boots PHPStan, so we need to include it manually. See:
// * https://github.com/rectorphp/rector/issues/8006
// * https://github.com/larastan/larastan/issues/1664#issuecomment-1637152828
->withBootstrapFiles([
__DIR__ . '/vendor/larastan/larastan/bootstrap.php',
])
->withPHPStanConfigs([
__DIR__ . '/phpstan.neon.dist',
])
->withPhpSets()
->withPreparedSets(
deadCode: true,
codeQuality: true,
typeDeclarations: true,
privatization: true,
instanceOf: true,
earlyReturn: true,
strictBooleans: true,
)
->withSets([
LaravelSetList::LARAVEL_100,
LaravelSetList::LARAVEL_CODE_QUALITY,
LaravelSetList::LARAVEL_FACADE_ALIASES_TO_FULL_NAMES,
LaravelSetList::LARAVEL_ELOQUENT_MAGIC_METHOD_TO_QUERY_BUILDER,
PHPUnitSetList::PHPUNIT_100,
PHPUnitSetList::PHPUNIT_CODE_QUALITY,
PHPUnitSetList::ANNOTATIONS_TO_ATTRIBUTES,
])
->withSkip([
__DIR__ . '/bootstrap/cache',
]);