-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrector.php
50 lines (41 loc) · 1.63 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
<?php
declare(strict_types=1);
use PHPUnit\Framework\TestCase;
use Rector\CodingStyle\Rector\MethodCall\PreferThisOrSelfMethodCallRector;
use Rector\Core\Configuration\Option;
use Rector\Php55\Rector\String_\StringClassNameToClassConstantRector;
use Rector\Set\ValueObject\SetList;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
return static function (ContainerConfigurator $containerConfigurator): void {
$services = $containerConfigurator->services();
$services->set(StringClassNameToClassConstantRector::class)
->call('configure', [[
StringClassNameToClassConstantRector::CLASSES_TO_SKIP => [
'Error',
'Exception',
'Doctrine\ORM\EntityManagerInterface',
'Doctrine\ORM\EntityManager',
],
]]);
$parameters = $containerConfigurator->parameters();
$parameters->set(Option::AUTO_IMPORT_NAMES, true);
$parameters->set(Option::AUTOLOAD_PATHS, [__DIR__ . '/ecs.php', __DIR__ . '/vendor/autoload.php']);
$parameters->set(Option::SETS, [
SetList::CODE_QUALITY,
SetList::DEAD_CODE,
SetList::CODING_STYLE,
SetList::PHP_54,
SetList::PHP_55,
SetList::PHP_56,
SetList::PHP_70,
SetList::PHP_71,
SetList::PHP_72,
SetList::PHP_73,
SetList::TYPE_DECLARATION,
SetList::PHPUNIT_CODE_QUALITY,
SetList::NAMING,
SetList::EARLY_RETURN,
]);
$parameters->set(Option::PATHS, [__DIR__ . '/packages']);
$parameters->set(Option::SKIP, ['*/vendor/*', '*/init/*', '*/Source/*', '*/Fixture/*']);
};