1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
use Rector\Config\RectorConfig; |
|
|
|
|
6
|
|
|
use Rector\DeadCode\Rector\Property\RemoveUnusedPrivatePropertyRector; |
|
|
|
|
7
|
|
|
use Rector\Doctrine\Set\DoctrineSetList; |
|
|
|
|
8
|
|
|
use Rector\Php80\Rector\Class_\ClassPropertyAssignToConstructorPromotionRector; |
|
|
|
|
9
|
|
|
use Rector\PHPUnit\Set\PHPUnitSetList; |
|
|
|
|
10
|
|
|
use Rector\Set\ValueObject\LevelSetList; |
|
|
|
|
11
|
|
|
use Rector\Set\ValueObject\SetList; |
|
|
|
|
12
|
|
|
use Rector\Symfony\Rector\Class_\MakeCommandLazyRector; |
|
|
|
|
13
|
|
|
use Rector\Symfony\Set\SymfonySetList; |
|
|
|
|
14
|
|
|
use Rector\Transform\Rector\Attribute\AttributeKeyToClassConstFetchRector; |
|
|
|
|
15
|
|
|
use Rector\TypeDeclaration\Rector\ClassMethod\AddArrayParamDocTypeRector; |
|
|
|
|
16
|
|
|
use Rector\TypeDeclaration\Rector\ClassMethod\AddArrayReturnDocTypeRector; |
|
|
|
|
17
|
|
|
use Rector\Privatization\Rector\Property\ChangeReadOnlyPropertyWithDefaultValueToConstantRector; |
|
|
|
|
18
|
|
|
|
19
|
|
|
return static function (RectorConfig $rectorConfig): void { |
20
|
|
|
$rectorConfig->paths([__DIR__.'/src', __DIR__.'/tests']); |
21
|
|
|
|
22
|
|
|
// Do not try to change simple property init and assign to constructor promotion |
23
|
|
|
// to make code easier to read (no more class with properties declared both |
24
|
|
|
// at the start of the class and in the constructor) |
25
|
|
|
$rectorConfig->skip([ |
26
|
|
|
ClassPropertyAssignToConstructorPromotionRector::class, |
27
|
|
|
RemoveUnusedPrivatePropertyRector::class, |
28
|
|
|
AttributeKeyToClassConstFetchRector::class, |
29
|
|
|
MakeCommandLazyRector::class, |
30
|
|
|
AddArrayReturnDocTypeRector::class, |
31
|
|
|
AddArrayParamDocTypeRector::class, |
32
|
|
|
ChangeReadOnlyPropertyWithDefaultValueToConstantRector::class, |
33
|
|
|
]); |
34
|
|
|
|
35
|
|
|
// PHP rules |
36
|
|
|
$rectorConfig->sets([ |
37
|
|
|
LevelSetList::UP_TO_PHP_80, |
38
|
|
|
SetList::CODE_QUALITY, |
39
|
|
|
SetList::DEAD_CODE, |
40
|
|
|
SetList::CODING_STYLE, |
41
|
|
|
SetList::TYPE_DECLARATION, |
42
|
|
|
SetList::PRIVATIZATION, |
43
|
|
|
]); |
44
|
|
|
|
45
|
|
|
// Symfony rules |
46
|
|
|
$rectorConfig->sets([ |
47
|
|
|
SymfonySetList::SYMFONY_54, |
48
|
|
|
SymfonySetList::SYMFONY_CODE_QUALITY, |
49
|
|
|
SymfonySetList::SYMFONY_CONSTRUCTOR_INJECTION, |
50
|
|
|
SymfonySetList::ANNOTATIONS_TO_ATTRIBUTES, |
51
|
|
|
]); |
52
|
|
|
|
53
|
|
|
// Doctrine rules |
54
|
|
|
$rectorConfig->sets([ |
55
|
|
|
DoctrineSetList::DOCTRINE_CODE_QUALITY, |
56
|
|
|
DoctrineSetList::DOCTRINE_DBAL_30, |
57
|
|
|
DoctrineSetList::DOCTRINE_ORM_29, |
58
|
|
|
DoctrineSetList::ANNOTATIONS_TO_ATTRIBUTES, |
59
|
|
|
DoctrineSetList::GEDMO_ANNOTATIONS_TO_ATTRIBUTES, |
60
|
|
|
]); |
61
|
|
|
|
62
|
|
|
// PHPUnit rules |
63
|
|
|
$rectorConfig->sets([ |
64
|
|
|
PHPUnitSetList::PHPUNIT_91, |
65
|
|
|
PHPUnitSetList::PHPUNIT_CODE_QUALITY, |
66
|
|
|
PHPUnitSetList::PHPUNIT_YIELD_DATA_PROVIDER, |
67
|
|
|
PHPUnitSetList::PHPUNIT_EXCEPTION, |
68
|
|
|
PHPUnitSetList::ANNOTATIONS_TO_ATTRIBUTES, |
69
|
|
|
]); |
70
|
|
|
}; |
71
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths