-
Notifications
You must be signed in to change notification settings - Fork 0
/
rector.php
46 lines (36 loc) · 1.37 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
<?php
declare(strict_types=1);
use Rector\Set\ValueObject\SetList;
use Rector\Core\Configuration\Option;
use Rector\Core\ValueObject\PhpVersion;
use Rector\Set\ValueObject\DowngradeSetList;
use Rector\DowngradePhp73\Tokenizer\FollowedByCommaAnalyzer;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
return static function (ContainerConfigurator $containerConfigurator): void {
// get parameters
$parameters = $containerConfigurator->parameters();
// Define what rule sets will be applied
// $parameters->set(Option::SETS, [
// SetList::DEAD_CODE,
// ]);
// $parameters->set(Option::SKIP, [
// __DIR__ . '/src/Types/CodeGen.v2.php',
// ]);
$parameters->set(Option::PATHS, [
__DIR__ . '/src',
// __DIR__ . '/tests'
]);
// here we can define, what sets of rules will be applied
$parameters->set(Option::SETS, [
SetList::PHP_71,
SetList::PHP_72,
SetList::PHP_73,
SetList::PHP_74,
]);
// is your PHP version different from the one your refactor to? [default: your PHP version]
// $parameters->set(Option::PHP_VERSION_FEATURES, PhpVersion::PHP_73);
// get services (needed for register a single rule)
// $services = $containerConfigurator->services();
// register a single rule
// $services->set(TypedPropertyRector::class);
};