-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrector.php
More file actions
51 lines (45 loc) · 1.67 KB
/
rector.php
File metadata and controls
51 lines (45 loc) · 1.67 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
<?php
declare(strict_types=1);
use Rector\Config\RectorConfig;
use Rector\PHPUnit\CodeQuality\Rector\Class_\PreferPHPUnitThisCallRector;
use Rector\Symfony\Bridge\Symfony\Routing\SymfonyRoutesProvider;
use Rector\Symfony\Contract\Bridge\Symfony\Routing\SymfonyRoutesProviderInterface;
return RectorConfig::configure()
->withPaths([
__DIR__.'/src',
__DIR__.'/tests',
__DIR__.'/migrations',
])
->withPreparedSets(
deadCode: true,
codeQuality: true,
codingStyle: true,
// Don't rename variables and properties to match contents.
naming: false,
privatization: true,
typeDeclarations: true,
rectorPreset: true,
)
// Generate Rector configuration from composer.json
// @see https://getrector.com/documentation/composer-based-sets
->withComposerBased(twig: true, doctrine: true, phpunit: true, symfony: true)
->withPhpSets()
->withAttributesSets()
// import FQN
// @see https://getrector.com/documentation/import-names
->withImportNames(
importShortClasses: false,
removeUnusedImports: true
)
// @see https://github.com/rectorphp/rector-symfony
// Provide Symfony PHP container.
->withSymfonyContainerPhp(__DIR__.'/tests/RectorSymfonyContainer.php')
// Add Symfony Route annotation config.
->registerService(SymfonyRoutesProvider::class, SymfonyRoutesProviderInterface::class)
// Prevent using $this-> instead of self:: for PHPUnit static methods
// @see https://getrector.com/documentation/ignoring-rules-or-paths
->withSkip([
PreferPHPUnitThisCallRector::class => [
__DIR__.'/tests/*',
],
]);