forked from deprecated-packages/symplify
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrector.php
More file actions
72 lines (61 loc) · 2.39 KB
/
rector.php
File metadata and controls
72 lines (61 loc) · 2.39 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<?php
declare(strict_types=1);
use Rector\CodingStyle\Rector\ClassConst\VarConstantCommentRector;
use Rector\CodingStyle\Rector\ClassMethod\UnSpreadOperatorRector;
use Rector\Config\RectorConfig;
use Rector\Php55\Rector\String_\StringClassNameToClassConstantRector;
use Rector\PHPUnit\Set\PHPUnitSetList;
use Rector\Set\ValueObject\LevelSetList;
use Rector\Set\ValueObject\SetList;
return static function (RectorConfig $rectorConfig): void {
$rectorConfig->sets([
SetList::CODE_QUALITY,
SetList::DEAD_CODE,
LevelSetList::UP_TO_PHP_80,
SetList::CODING_STYLE,
SetList::TYPE_DECLARATION,
SetList::TYPE_DECLARATION_STRICT,
SetList::NAMING,
SetList::PRIVATIZATION,
SetList::EARLY_RETURN,
PHPUnitSetList::PHPUNIT_CODE_QUALITY,
]);
$rectorConfig->ruleWithConfiguration(StringClassNameToClassConstantRector::class, [
'Error',
'Exception',
'Dibi\Connection',
'Doctrine\ORM\EntityManagerInterface',
'Doctrine\ORM\EntityManager',
'Nette\*',
'Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator',
'PHPUnit\Framework\TestCase',
'Symplify\EasyCodingStandard\Config\ECSConfig',
'Symfony\Contracts\Service\Attribute\Required',
'Symfony\Component\Routing\Annotation\Route',
'Rector\Config\RectorConfig',
]);
$rectorConfig->paths([__DIR__ . '/packages']);
$rectorConfig->parallel();
$rectorConfig->importNames();
$rectorConfig->autoloadPaths([__DIR__ . '/tests/bootstrap.php']);
$rectorConfig->skip([
'*/scoper.php',
'*/vendor/*',
'*/init/*',
'*/Source/*',
'*/Fixture/*',
'*/Fixture*/*',
'*/ChangedFilesDetectorSource/*',
__DIR__ . '/packages/monorepo-builder/templates',
// test fixtures
'*/packages/phpstan-extensions/tests/TypeExtension/*/*Extension/data/*',
// many false positives related to file class autoload
__DIR__ . '/packages/easy-coding-standard/bin/ecs.php',
// adopted 3rd party package - keep API compatible
UnSpreadOperatorRector::class => [__DIR__ . '/packages/git-wrapper'],
// false positive on "locale" string
VarConstantCommentRector::class => [
__DIR__ . '/packages/php-config-printer/src/RoutingCaseConverter/ImportRoutingCaseConverter.php',
],
]);
};