-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrector.php
More file actions
48 lines (38 loc) · 1.33 KB
/
rector.php
File metadata and controls
48 lines (38 loc) · 1.33 KB
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\Set\ValueObject\LevelSetList;
use Rector\Set\ValueObject\SetList;
use Rector\TypeDeclaration\Rector\ClassMethod\AddArrayReturnDocTypeRector;
use Rector\TypeDeclaration\Rector\Property\TypedPropertyFromStrictConstructorRector;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
return static function (ContainerConfigurator $containerConfigurator): void {
// get parameters
$parameters = $containerConfigurator->parameters();
$parameters->set(Option::SKIP, [
// rules
AddArrayReturnDocTypeRector::class,
TypedPropertyFromStrictConstructorRector::class,
// files
'*/node_modules/*',
]);
$drupalRoot = __DIR__ . '/docroot';
$parameters->set(Option::BOOTSTRAP_FILES, [
$drupalRoot . '/core/tests/bootstrap.php',
]);
$parameters->set(Option::AUTO_IMPORT_NAMES, TRUE);
$parameters->set(Option::IMPORT_SHORT_CLASSES, FALSE);
$parameters->set(Option::IMPORT_DOC_BLOCKS, FALSE);
$parameters->set(Option::FILE_EXTENSIONS, [
'php',
'module',
'theme',
'install',
'profile',
'inc',
'engine',
]);
// Define what rule sets will be applied
$containerConfigurator->import(LevelSetList::UP_TO_PHP_74);
$containerConfigurator->import(SetList::TYPE_DECLARATION_STRICT);
};