Repository navigation
Expand file tree
/
Copy pathrector.php
More file actions
45 lines (42 loc) · 1.74 KB
/
Copy pathrector.php
File metadata and controls
45 lines (42 loc) · 1.74 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
<?php
declare(strict_types=1);
use Rector\Config\RectorConfig;
return RectorConfig::configure()
->withParallel()
->withPreparedSets(
deadCode: true,
codeQuality: true,
codingStyle: true,
typeDeclarations: true,
if: true,
earlyReturn: true,
carbon: true,
// no privatization, naming, namedArgs, instanceOf, rectorPreset
)
->withComposerBased(twig: true)
->withPhpSets()
->withPaths([
__DIR__ . '/config',
__DIR__ . '/modules',
__DIR__ . '/public/index.php',
__DIR__ . '/public/editorcss.php',
])
->withRootFiles()
->withSkip([
// don't remove useless variables inside event handler closures
// it's nice to keep them for editing later
Rector\CodeQuality\Rector\FunctionLike\SimplifyUselessVariableRector::class,
// we may not want the property to have a default value
Rector\Php74\Rector\Property\RestoreDefaultNullToNullableTypePropertyRector::class,
Rector\CodeQuality\Rector\Identical\FlipTypeControlToUseExclusiveTypeRector::class,
Rector\CodeQuality\Rector\If_\ObjectExplicitBoolCompareRector::class,
// prefer a null check: a type check silently flips to false on another valid type
Rector\TypeDeclaration\Rector\BooleanAnd\BinaryOpNullableToInstanceofRector::class,
// keep @param tags even when redundant with type declarations
Rector\DeadCode\Rector\ClassMethod\RemoveUselessParamTagRector::class,
Rector\TypeDeclaration\Rector\StmtsAwareInterface\SafeDeclareStrictTypesRector::class,
Rector\CodeQuality\Rector\Concat\DirnameDirConcatStringToDirectStringPathRector::class => [
__DIR__ . '/config',
],
])
;