-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrector.php
More file actions
63 lines (58 loc) · 1.91 KB
/
Copy pathrector.php
File metadata and controls
63 lines (58 loc) · 1.91 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
<?php
declare(strict_types=1);
use Rector\Config\RectorConfig;
use Rector\Doctrine\Set\DoctrineSetList;
use Rector\Php80\Rector\Class_\ClassPropertyAssignToConstructorPromotionRector;
use Rector\Php81\Rector\FuncCall\NullToStrictStringFuncCallArgRector;
use Rector\Symfony\Set\SymfonySetList;
use Rector\ValueObject\PhpVersion;
return RectorConfig::configure()
// including paths
->withPaths([
__DIR__.'/src',
])
// excluding paths
->withSkip([
__DIR__.'/migrations',
__DIR__.'/src/Kernel.php',
__DIR__.'/vendor',
__DIR__.'/var',
__DIR__.'/tests',
__DIR__.'/public/index.php',
__DIR__.'/config/bundles.php',
__DIR__.'/config/reference.php',
__DIR__.'/config/preload.php',
NullToStrictStringFuncCallArgRector::class,
// Bad fit for Doctrine entities (Properties inside __construct)
ClassPropertyAssignToConstructorPromotionRector::class => [
__DIR__.'/src/Entity/*',
],
])
->withPhpVersion(PhpVersion::PHP_85)
->withImportNames(removeUnusedImports: true)
// PHP rules
->withPreparedSets(
deadCode: true,
codeQuality: true,
// codingStyle: true,
typeDeclarations: true,
privatization: true,
// naming: true,
instanceOf: true,
earlyReturn: true,
doctrineCodeQuality: true,
symfonyCodeQuality: true,
symfonyConfigs: true
)
// Symfony auto rules
->withComposerBased(twig: true, doctrine: true, phpunit: true, symfony: true)
->withAttributesSets(symfony: true, doctrine: true)
// Auto Php Select
->withPhpSets()
// Add Symfony custom rules
->withSets([
SymfonySetList::SYMFONY_CODE_QUALITY,
SymfonySetList::CONFIGS,
SymfonySetList::SYMFONY_CONSTRUCTOR_INJECTION,
DoctrineSetList::DOCTRINE_CODE_QUALITY,
]);