-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rector.php
49 lines (40 loc) · 1.96 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
<?php
declare(strict_types=1);
use Rector\Core\Configuration\Option;
use Rector\Doctrine\Set\DoctrineSetList;
use Rector\PHPUnit\Set\PHPUnitSetList;
use Rector\Set\ValueObject\LevelSetList;
use Rector\Set\ValueObject\SetList;
use Rector\Symfony\Set\SymfonySetList;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
return static function (ContainerConfigurator $containerConfigurator): void {
// get parameters
$parameters = $containerConfigurator->parameters();
$parameters->set(Option::PATHS, [__DIR__.'/src', __DIR__.'/tests']);
$parameters->set(Option::AUTO_IMPORT_NAMES, true);
// Define what rule sets will be applied
$containerConfigurator->import(LevelSetList::UP_TO_PHP_80);
$containerConfigurator->import(SetList::DEAD_CODE);
$containerConfigurator->import(SetList::CODE_QUALITY);
// get services (needed for register a single rule)
$services = $containerConfigurator->services();
// register a single rule
$services->set(\Rector\Php74\Rector\Property\TypedPropertyRector::class);
// Symfony
$containerConfigurator->import(SymfonySetList::SYMFONY_60);
$containerConfigurator->import(SymfonySetList::SYMFONY_CODE_QUALITY);
$parameters->set(
Option::SYMFONY_CONTAINER_XML_PATH_PARAMETER,
__DIR__.'/var/cache/dev/App_KernelDevDebugContainer.xml'
);
// Doctrine
$containerConfigurator->import(DoctrineSetList::DOCTRINE_CODE_QUALITY);
$containerConfigurator->import(DoctrineSetList::ANNOTATIONS_TO_ATTRIBUTES);
// PHPUnit
$containerConfigurator->import(PHPUnitSetList::PHPUNIT_90);
$containerConfigurator->import(PHPUnitSetList::PHPUNIT_CODE_QUALITY);
$containerConfigurator->import(PHPUnitSetList::PHPUNIT_EXCEPTION);
$containerConfigurator->import(PHPUnitSetList::PHPUNIT_MOCK);
$containerConfigurator->import(PHPUnitSetList::PHPUNIT_SPECIFIC_METHOD);
$containerConfigurator->import(PHPUnitSetList::PHPUNIT_YIELD_DATA_PROVIDER);
};