-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathrector.php
More file actions
35 lines (32 loc) · 1.6 KB
/
rector.php
File metadata and controls
35 lines (32 loc) · 1.6 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
<?php
declare(strict_types=1);
use Rector\Config\RectorConfig;
use Rector\Php80\Rector\Class_\ClassPropertyAssignToConstructorPromotionRector;
use Rector\Symfony\CodeQuality\Rector\Class_\ControllerMethodInjectionToConstructorRector;
use Rector\Symfony\CodeQuality\Rector\ClassMethod\ActionSuffixRemoverRector;
return RectorConfig::configure()
->withPaths([__DIR__.'/src'])
->withSymfonyContainerXml(__DIR__.'/var/cache/dev/App_KernelDevDebugContainer.xml')
->withImportNames(removeUnusedImports: true)
->withSkip([
// SonataAdminBundle CRUDController needs the suffix for actions
ActionSuffixRemoverRector::class => [
__DIR__.'/src/Controller/AliasCRUDController.php',
__DIR__.'/src/Controller/UserCRUDController.php',
],
// SonataAdmin batch actions receive ProxyQueryInterface as a runtime
// parameter via request attributes, not as a service.
ControllerMethodInjectionToConstructorRector::class => [
__DIR__.'/src/Controller/UserCRUDController.php',
__DIR__.'/src/Controller/AliasCRUDController.php',
],
// Doctrine entities: keep ORM attributes above class properties for readability,
// rather than inlining them into constructor promotion.
ClassPropertyAssignToConstructorPromotionRector::class => [
__DIR__.'/src/Entity',
],
])
->withPreparedSets(codingStyle: true, privatization: true, symfonyCodeQuality: true)
->withAttributesSets(symfony: true, doctrine: true)
->withComposerBased(doctrine: true, symfony: true)
->withPhpSets(php84: true);