-
Notifications
You must be signed in to change notification settings - Fork 0
/
rector.php
52 lines (44 loc) · 1.77 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
50
51
52
<?php
declare(strict_types=1);
use Rector\CodeQuality\Rector\If_\ExplicitBoolCompareRector;
use Rector\Config\RectorConfig;
use Rector\DeadCode\Rector\ClassMethod\RemoveUnusedPublicMethodParameterRector;
use Rector\Set\ValueObject\SetList;
use Rector\Symfony\Set\SymfonySetList;
use Rector\TypeDeclaration\Rector\Property\TypedPropertyFromStrictConstructorRector;
use Rector\Doctrine\Set\DoctrineSetList;
return static function (RectorConfig $rectorConfig): void {
// register single rule
$rectorConfig->rule(TypedPropertyFromStrictConstructorRector::class);
$rectorConfig->removeUnusedImports();
$rectorConfig->importNames();
$rectorConfig->importShortClasses(false);
// here we can define, what sets of rules will be applied
// tip: use "SetList" class to autocomplete sets with your IDE
$rectorConfig->sets([
SetList::CODE_QUALITY,
SetList::CODING_STYLE,
SetList::PHP_83,
SetList::PRIVATIZATION,
SetList::INSTANCEOF,
SetList::TYPE_DECLARATION,
SetList::EARLY_RETURN,
SetList::DEAD_CODE,
SymfonySetList::SYMFONY_64,
SymfonySetList::ANNOTATIONS_TO_ATTRIBUTES,
SymfonySetList::SYMFONY_CODE_QUALITY,
SymfonySetList::SYMFONY_CONSTRUCTOR_INJECTION,
SymfonySetList::SYMFONY_52_VALIDATOR_ATTRIBUTES,
DoctrineSetList::DOCTRINE_CODE_QUALITY,
DoctrineSetList::DOCTRINE_COMMON_20,
DoctrineSetList::ANNOTATIONS_TO_ATTRIBUTES,
DoctrineSetList::DOCTRINE_ORM_214,
DoctrineSetList::DOCTRINE_BUNDLE_210,
DoctrineSetList::DOCTRINE_DBAL_40,
DoctrineSetList::GEDMO_ANNOTATIONS_TO_ATTRIBUTES,
]);
$rectorConfig->skip([
ExplicitBoolCompareRector::class,
RemoveUnusedPublicMethodParameterRector::class,
]);
};