-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrector.php
More file actions
65 lines (60 loc) · 2.29 KB
/
rector.php
File metadata and controls
65 lines (60 loc) · 2.29 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
64
65
<?php
declare(strict_types=1);
use Rector\Config\RectorConfig;
use Rector\Symfony\Bridge\Symfony\Routing\SymfonyRoutesProvider;
use Rector\Symfony\Contract\Bridge\Symfony\Routing\SymfonyRoutesProviderInterface;
use Rector\Symfony\Set\SymfonySetList;
use Rector\Doctrine\Set\DoctrineSetList;
use Rector\Set\ValueObject\LevelSetList;
use Rector\ValueObject\PhpVersion;
use Rector\CodingStyle\Rector\Encapsed\EncapsedStringsToSprintfRector;
use Rector\Symfony\CodeQuality\Rector\Class_\InlineClassRoutePrefixRector;
use Rector\CodingStyle\Rector\ClassLike\NewlineBetweenClassLikeStmtsRector;
use Rector\CodingStyle\Rector\ClassMethod\NewlineBeforeNewAssignSetRector;
use Rector\CodingStyle\Rector\Stmt\NewlineAfterStatementRector;
use Rector\CodingStyle\Rector\Encapsed\WrapEncapsedVariableInCurlyBracesRector;
// https://github.com/rectorphp/rector-symfony?tab=readme-ov-file
return RectorConfig::configure()
->withPaths([
__DIR__ . '/config',
__DIR__ . '/docker',
__DIR__ . '/public',
__DIR__ . '/src',
__DIR__ . '/tests',
__DIR__ . '/templates'
])
->withFileExtensions(['php', 'twig'])
->withComposerBased(doctrine: true)
->withComposerBased(symfony: true)
// ->withPhpVersion(PhpVersion::PHP_83)
->withPhpSets(
php83: true
)
->withSets([
// SymfonySetList::SYMFONY_74,
])
->withAttributesSets(
symfony: true,
sensiolabs: true,
doctrine: true,
phpunit: true
)
->withPreparedSets(symfonyConfigs: true)
->withPreparedSets(deadCode: true)
->withPreparedSets(symfonyCodeQuality: true)
->withPreparedSets(doctrineCodeQuality: true)
->withPreparedSets(codeQuality: true)
->withPreparedSets(codingStyle: true)
->withPreparedSets(carbon: true)
->withPreparedSets(phpunitCodeQuality: true)
->withSkip([
// I *like* bare variables in strings, and I've
// always preferred interpolation over concatenation.
EncapsedStringsToSprintfRector::class,
WrapEncapsedVariableInCurlyBracesRector::class,
// This one actually breaks things.
InlineClassRoutePrefixRector::class
// NewlineBetweenClassLikeStmtsRector::class,
// NewlineBeforeNewAssignSetRector::class,
// NewlineAfterStatementRector::class,
]);