forked from hflabs/dadata-php
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathrector.php
More file actions
45 lines (38 loc) · 1.4 KB
/
rector.php
File metadata and controls
45 lines (38 loc) · 1.4 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
<?php
declare(strict_types=1);
use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector;
use Rector\Config\RectorConfig;
use Rector\Php74\Rector\Assign\NullCoalescingOperatorRector;
use Rector\Php74\Rector\Property\RestoreDefaultNullToNullableTypePropertyRector;
use Rector\Set\ValueObject\LevelSetList;
use Rector\Set\ValueObject\SetList;
use Rector\TypeDeclaration\Rector\Property\TypedPropertyFromAssignsRector;
use Rector\TypeDeclaration\Rector\Property\TypedPropertyFromStrictConstructorRector;
return static function (RectorConfig $rectorConfig): void {
// register a single rule
$rectorConfig->rules(
[
InlineConstructorDefaultToPropertyRector::class,
NullCoalescingOperatorRector::class,
TypedPropertyFromStrictConstructorRector::class,
RestoreDefaultNullToNullableTypePropertyRector::class,
Rector\Php84\Rector\Param\ExplicitNullableParamTypeRector::class,
]
);
$rectorConfig->ruleWithConfiguration(TypedPropertyFromAssignsRector::class, ['inlinePublic' => true]);
// define sets of rules
$rectorConfig->sets(
[
LevelSetList::UP_TO_PHP_84,
SetList::CODE_QUALITY,
SetList::CODING_STYLE,
SetList::DEAD_CODE
]
);
$rectorConfig->paths(
[
__DIR__ . '/src',
__DIR__ . '/tests',
]
);
};