-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathrector.php
48 lines (41 loc) · 2.1 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
<?php
declare(strict_types=1);
use Rector\Core\Configuration\Option;
use Rector\Core\ValueObject\PhpVersion;
use Rector\Doctrine\Set\DoctrineSetList;
use Rector\Php74\Rector\Property\TypedPropertyRector;
use Rector\Php80\Rector\Class_\ClassPropertyAssignToConstructorPromotionRector;
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/Monofony/Component/Admin',
__DIR__ . '/src/Monofony/MetaPack/AdminMeta/.recipe/src',
__DIR__ . '/src/Monofony/MetaPack/ApiMeta/.recipe/src',
__DIR__ . '/src/Monofony/MetaPack/CoreMeta/.recipe/src',
__DIR__ . '/src/Monofony/MetaPack/FrontMeta/.recipe/src',
]);
$parameters->set(Option::SYMFONY_CONTAINER_XML_PATH_PARAMETER,
__DIR__ . '/var/cache/dev/App_KernelDevDebugContainer.xml',
);
// Define what rule sets will be applied
// $containerConfigurator->import(SetList::DEAD_CODE);
// get services (needed for register a single rule)
$services = $containerConfigurator->services();
// register a single rule
$services->set(TypedPropertyRector::class);
$services->set(ClassPropertyAssignToConstructorPromotionRector::class);
$parameters->set(Option::PHP_VERSION_FEATURES, PhpVersion::PHP_74);
$parameters->set(Option::PHP_VERSION_FEATURES, PhpVersion::PHP_80);
$parameters->set(Option::AUTO_IMPORT_NAMES, true);
$parameters->set(Option::IMPORT_SHORT_CLASSES, false);
//
$containerConfigurator->import(SymfonySetList::SYMFONY_44);
$containerConfigurator->import(SymfonySetList::SYMFONY_52);
// $containerConfigurator->import(SymfonySetList::SYMFONY_CODE_QUALITY);
$containerConfigurator->import(SymfonySetList::SYMFONY_CONSTRUCTOR_INJECTION);
$containerConfigurator->import(SymfonySetList::ANNOTATIONS_TO_ATTRIBUTES);
// $containerConfigurator->import(DoctrineSetList::ANNOTATIONS_TO_ATTRIBUTES);
};