-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrector.php
49 lines (47 loc) · 1.72 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
<?php declare(strict_types=1);
use Rector\Caching\ValueObject\Storage\FileCacheStorage;
use Rector\CodingStyle\Rector\Encapsed\EncapsedStringsToSprintfRector;
use Rector\Config\RectorConfig;
use Rector\DeadCode\Rector\PropertyProperty\RemoveNullPropertyInitializationRector;
use Rector\DeadCode\Rector\Stmt\RemoveUnreachableStatementRector;
use Rector\Php74\Rector\Closure\ClosureToArrowFunctionRector;
use Rector\Php74\Rector\Ternary\ParenthesizeNestedTernaryRector;
use Rector\Php84\Rector\Param\ExplicitNullableParamTypeRector;
use Rector\Privatization\Rector\Property\PrivatizeFinalClassPropertyRector;
/**
* @see https://github.com/rectorphp/rector/blob/main/docs/rector_rules_overview.md
*/
return RectorConfig::configure()
->withCache('./.cache/rector', FileCacheStorage::class)
->withPaths([
__DIR__ . '/src',
])
->withRules([
ExplicitNullableParamTypeRector::class,
ParenthesizeNestedTernaryRector::class,
RemoveUnreachableStatementRector::class,
PrivatizeFinalClassPropertyRector::class,
])
->withSkip([
ClosureToArrowFunctionRector::class,
EncapsedStringsToSprintfRector::class,
RemoveNullPropertyInitializationRector::class,
])
->withParallel(300, 15, 15)
// here we can define, what prepared sets of rules will be applied
->withPreparedSets(
deadCode: true,
codeQuality: true,
codingStyle: true,
typeDeclarations: true,
privatization: true,
naming: true,
instanceOf: true,
earlyReturn: true,
strictBooleans: true,
carbon: true,
rectorPreset: true,
phpunitCodeQuality: true,
)
->withMemoryLimit('3G')
->withPhpSets(php83: true);