-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrector.php
More file actions
65 lines (63 loc) · 2.43 KB
/
rector.php
File metadata and controls
65 lines (63 loc) · 2.43 KB
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
64
65
<?php declare(strict_types=1);
use Rector\Caching\ValueObject\Storage\FileCacheStorage;
use Rector\Carbon\Rector\FuncCall\TimeFuncCallToCarbonRector;
use Rector\CodeQuality\Rector\ClassMethod\InlineArrayReturnAssignRector;
use Rector\CodeQuality\Rector\If_\ExplicitBoolCompareRector;
use Rector\CodingStyle\Rector\Encapsed\EncapsedStringsToSprintfRector;
use Rector\Config\RectorConfig;
use Rector\DeadCode\Rector\ClassMethod\RemoveUselessParamTagRector;
use Rector\DeadCode\Rector\ClassMethod\RemoveUselessReturnTagRector;
use Rector\Php81\Rector\FuncCall\NullToStrictStringFuncCallArgRector;
use Rector\Privatization\Rector\ClassMethod\PrivatizeFinalClassMethodRector;
use Rector\TypeDeclaration\Rector\ArrowFunction\AddArrowFunctionReturnTypeRector;
use RectorPest\Rules\UseToBeDirectoryRector;
use RectorPest\Set\PestSetList;
return RectorConfig::configure()
->withCache(
cacheDirectory: './.cache/rector',
cacheClass: FileCacheStorage::class,
containerCacheDirectory: './.cache/rectorContainer',
)
->withPaths([
__DIR__ . '/src',
__DIR__ . '/tests',
])
->withPreparedSets(
deadCode: true,
codeQuality: true,
codingStyle: true,
typeDeclarations: true,
typeDeclarationDocblocks: true,
privatization: true,
instanceOf: true,
earlyReturn: true,
carbon: true,
rectorPreset: true,
phpunitCodeQuality: true,
)
->withAttributesSets()
->withImportNames()
->withFluentCallNewLine()
->withParallel(300, 15, 15)
->withMemoryLimit('3G')
->withPhpSets(php82: true)
->withSets([
PestSetList::PEST_CODE_QUALITY,
PestSetList::PEST_CHAIN,
])
->withSkip([
// boost-core ships no `nesbot/carbon` runtime dep; Rector's Carbon set
// is enabled for tests + dev but the production code must stay
// Carbon-free, so this single src-path skip keeps `time()` untouched
// in shipped code.
TimeFuncCallToCarbonRector::class => [__DIR__ . '/src'],
NullToStrictStringFuncCallArgRector::class,
AddArrowFunctionReturnTypeRector::class,
EncapsedStringsToSprintfRector::class,
ExplicitBoolCompareRector::class,
InlineArrayReturnAssignRector::class,
PrivatizeFinalClassMethodRector::class,
RemoveUselessParamTagRector::class,
RemoveUselessReturnTagRector::class,
UseToBeDirectoryRector::class,
]);