forked from deprecated-packages/symplify
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrector.php
86 lines (74 loc) · 3.33 KB
/
rector.php
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<?php
declare(strict_types=1);
use Rector\CodingStyle\Rector\ClassConst\VarConstantCommentRector;
use Rector\Config\RectorConfig;
use Rector\Php55\Rector\String_\StringClassNameToClassConstantRector;
use Rector\PHPUnit\Set\PHPUnitSetList;
use Rector\Set\ValueObject\LevelSetList;
use Rector\Set\ValueObject\SetList;
return static function (RectorConfig $rectorConfig): void {
$rectorConfig->sets([
SetList::CODE_QUALITY,
SetList::DEAD_CODE,
LevelSetList::UP_TO_PHP_80,
SetList::CODING_STYLE,
SetList::TYPE_DECLARATION,
SetList::NAMING,
SetList::PRIVATIZATION,
SetList::EARLY_RETURN,
PHPUnitSetList::PHPUNIT_CODE_QUALITY,
]);
$rectorConfig->ruleWithConfiguration(StringClassNameToClassConstantRector::class, [
'Error',
'Exception',
'Dibi\Connection',
'Doctrine\ORM\EntityManagerInterface',
'Doctrine\ORM\EntityManager',
'PHPUnit_Framework_TestCase',
'Nette\*',
'Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator',
'Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator',
'PHPUnit\Framework\TestCase',
'Symplify\EasyCodingStandard\Config\ECSConfig',
'Symfony\Contracts\Service\Attribute\Required',
'Symfony\Component\Routing\Annotation\Route',
'Symfony\Bundle\FrameworkBundle\Controller\AbstractController',
'Rector\Config\RectorConfig',
'Symplify\PackageBuilder\Reflection\PrivatesCaller',
'Symfony\Component\Form\AbstractType',
]);
$rectorConfig->paths([__DIR__ . '/packages']);
$rectorConfig->parallel();
$rectorConfig->importNames();
$rectorConfig->autoloadPaths([__DIR__ . '/tests/bootstrap.php']);
$rectorConfig->skip([
'*/scoper.php',
'*/vendor/*',
'*/init/*',
'*/Source/*',
'*/Fixture/*',
'*/Fixture*/*',
'*/ChangedFilesDetectorSource/*',
__DIR__ . '/packages/monorepo-builder/templates',
// test fixtures
'*/packages/phpstan-extensions/tests/TypeExtension/*/*Extension/data/*',
__DIR__ . '/packages/phpstan-rules/build/*',
// many false positives related to file class autoload
__DIR__ . '/packages/easy-coding-standard/bin/ecs.php',
// false positive on "locale" string
VarConstantCommentRector::class => [
__DIR__ . '/packages/php-config-printer/src/RoutingCaseConverter/ImportRoutingCaseConverter.php',
],
// keep classes untouched, to avoid prefixing and renames
StringClassNameToClassConstantRector::class => [
__DIR__ . '/packages/phpstan-rules/src/NodeAnalyzer/MethodCall/AllowedChainCallSkipper.php',
__DIR__ . '/packages/autowire-array-parameter/src/DependencyInjection/CompilerPass/AutowireArrayParameterCompilerPass.php',
],
\Rector\Naming\Rector\Foreach_\RenameForeachValueVariableToMatchExprVariableRector::class => [
__DIR__ . '/packages/phpstan-rules/src/Rules/Domain/ForbiddenAlwaysSetterCallRule.php',
],
\Rector\Privatization\Rector\Property\ChangeReadOnlyPropertyWithDefaultValueToConstantRector::class => [
__DIR__ . '/packages/autowire-array-parameter/src/DependencyInjection/CompilerPass/AutowireArrayParameterCompilerPass.php',
],
]);
};