-
Notifications
You must be signed in to change notification settings - Fork 114
Expand file tree
/
Copy pathsymfony-code-quality.php
More file actions
46 lines (38 loc) · 1.98 KB
/
symfony-code-quality.php
File metadata and controls
46 lines (38 loc) · 1.98 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
<?php
declare(strict_types=1);
use Rector\Symfony\Symfony62\Rector\Class_\SecurityAttributeToIsGrantedAttributeRector;
use Rector\Config\RectorConfig;
use Rector\Symfony\CodeQuality\Rector\BinaryOp\RequestIsMainRector;
use Rector\Symfony\CodeQuality\Rector\BinaryOp\ResponseStatusCodeRector;
use Rector\Symfony\CodeQuality\Rector\Class_\EventListenerToEventSubscriberRector;
use Rector\Symfony\CodeQuality\Rector\Class_\InlineClassRoutePrefixRector;
use Rector\Symfony\CodeQuality\Rector\Class_\LoadValidatorMetadataToAnnotationRector;
use Rector\Symfony\CodeQuality\Rector\ClassMethod\ActionSuffixRemoverRector;
use Rector\Symfony\CodeQuality\Rector\ClassMethod\ParamTypeFromRouteRequiredRegexRector;
use Rector\Symfony\CodeQuality\Rector\ClassMethod\RemoveUnusedRequestParamRector;
use Rector\Symfony\CodeQuality\Rector\ClassMethod\ResponseReturnTypeControllerActionRector;
use Rector\Symfony\CodeQuality\Rector\MethodCall\AssertSameResponseCodeWithDebugContentsRector;
use Rector\Symfony\CodeQuality\Rector\MethodCall\LiteralGetToRequestClassConstantRector;
use Rector\Symfony\Symfony26\Rector\MethodCall\RedirectToRouteRector;
return static function (RectorConfig $rectorConfig): void {
$rectorConfig->rules([
RedirectToRouteRector::class,
EventListenerToEventSubscriberRector::class,
ResponseReturnTypeControllerActionRector::class,
// int and string literals to const fetches
ResponseStatusCodeRector::class,
LiteralGetToRequestClassConstantRector::class,
RemoveUnusedRequestParamRector::class,
ParamTypeFromRouteRequiredRegexRector::class,
ActionSuffixRemoverRector::class,
LoadValidatorMetadataToAnnotationRector::class,
// request method
RequestIsMainRector::class,
// tests
AssertSameResponseCodeWithDebugContentsRector::class,
// routing
InlineClassRoutePrefixRector::class,
// narrow attributes
SecurityAttributeToIsGrantedAttributeRector::class,
]);
};