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
|
|
|
|
18
|
|
|
return static function (RectorConfig $rectorConfig): void { |
19
|
|
|
$rectorConfig->paths([__DIR__.'/src', __DIR__.'/tests']); |
20
|
|
|
|
21
|
|
|
// Do not try to change simple property init and assign to constructor promotion |
22
|
|
|
// to make code easier to read (no more class with properties declared both |
23
|
|
|
// at the start of the class and in the constructor) |
24
|
|
|
$rectorConfig->skip([ |
25
|
|
|
ClassPropertyAssignToConstructorPromotionRector::class, |
26
|
|
|
RemoveUnusedPrivatePropertyRector::class, |
27
|
|
|
AttributeKeyToClassConstFetchRector::class, |
28
|
|
|
MakeCommandLazyRector::class, |
29
|
|
|
AddArrayReturnDocTypeRector::class, |
30
|
|
|
AddArrayParamDocTypeRector::class, |
31
|
|
|
__DIR__.'/tests/App/var/*', |
32
|
|
|
]); |
33
|
|
|
|
34
|
|
|
// PHP rules |
35
|
|
|
$rectorConfig->sets([ |
36
|
|
|
LevelSetList::UP_TO_PHP_80, |
37
|
|
|
SetList::CODE_QUALITY, |
38
|
|
|
SetList::DEAD_CODE, |
39
|
|
|
SetList::CODING_STYLE, |
40
|
|
|
SetList::TYPE_DECLARATION, |
41
|
|
|
]); |
42
|
|
|
|
43
|
|
|
// Symfony rules |
44
|
|
|
$rectorConfig->sets([ |
45
|
|
|
SymfonySetList::SYMFONY_54, |
46
|
|
|
SymfonySetList::SYMFONY_CODE_QUALITY, |
47
|
|
|
SymfonySetList::SYMFONY_CONSTRUCTOR_INJECTION, |
48
|
|
|
SymfonySetList::ANNOTATIONS_TO_ATTRIBUTES, |
49
|
|
|
]); |
50
|
|
|
|
51
|
|
|
// Doctrine rules |
52
|
|
|
$rectorConfig->sets([ |
53
|
|
|
DoctrineSetList::DOCTRINE_CODE_QUALITY, |
54
|
|
|
DoctrineSetList::DOCTRINE_DBAL_30, |
55
|
|
|
DoctrineSetList::DOCTRINE_ORM_29, |
56
|
|
|
DoctrineSetList::ANNOTATIONS_TO_ATTRIBUTES, |
57
|
|
|
]); |
58
|
|
|
|
59
|
|
|
// PHPUnit rules |
60
|
|
|
$rectorConfig->sets([ |
61
|
|
|
PHPUnitSetList::PHPUNIT_91, |
62
|
|
|
PHPUnitSetList::PHPUNIT_CODE_QUALITY, |
63
|
|
|
PHPUnitSetList::PHPUNIT_YIELD_DATA_PROVIDER, |
64
|
|
|
]); |
65
|
|
|
}; |
66
|
|
|
|
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