-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrector.php
82 lines (71 loc) · 2.54 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<?php
declare(strict_types=1);
/*
* This file is part of {PROJECT_NAME} project.
*
* (c) Pierre du Plessis <[email protected]>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
use Rector\Config\RectorConfig;
use Rector\Core\ValueObject\PhpVersion;
use Rector\DeadCode\Rector\If_\RemoveAlwaysTrueIfConditionRector;
use Rector\Doctrine\Set\DoctrineSetList;
use Rector\Php80\Rector\Class_\AnnotationToAttributeRector;
use Rector\PHPUnit\Set\PHPUnitSetList;
use Rector\Set\ValueObject\LevelSetList;
use Rector\Set\ValueObject\SetList;
use Rector\Symfony\Set\SymfonySetList;
return static function (RectorConfig $rectorConfig): void {
$rectorConfig->paths([__DIR__ . '/src']);
$rectorConfig->importNames();
$rectorConfig->importShortClasses();
$rectorConfig->symfonyContainerXml(__DIR__ . '/var/cache/dev/App_KernelDevDebugContainer.xml');
$rectorConfig->phpVersion(PhpVersion::PHP_82);
$rectorConfig->sets([
// General
SetList::CODE_QUALITY,
SetList::CODING_STYLE,
SetList::DEAD_CODE,
SetList::EARLY_RETURN,
SetList::INSTANCEOF,
SetList::PHP_82,
SetList::STRICT_BOOLEANS,
SetList::TYPE_DECLARATION,
SetList::PRIVATIZATION,
// PHP
LevelSetList::UP_TO_PHP_82,
// PHPUnit
PHPUnitSetList::PHPUNIT_90,
PHPUnitSetList::PHPUNIT_100,
PHPUnitSetList::ANNOTATIONS_TO_ATTRIBUTES,
PHPUnitSetList::PHPUNIT_CODE_QUALITY,
// Doctrine
DoctrineSetList::DOCTRINE_ORM_25,
DoctrineSetList::DOCTRINE_ORM_29,
DoctrineSetList::DOCTRINE_ORM_213,
DoctrineSetList::DOCTRINE_ORM_214,
DoctrineSetList::DOCTRINE_COMMON_20,
DoctrineSetList::DOCTRINE_DBAL_30,
DoctrineSetList::DOCTRINE_DBAL_40,
DoctrineSetList::DOCTRINE_DBAL_40,
DoctrineSetList::DOCTRINE_CODE_QUALITY,
DoctrineSetList::DOCTRINE_BUNDLE_210,
// Symfony
SymfonySetList::SYMFONY_CODE_QUALITY,
SymfonySetList::SYMFONY_CONSTRUCTOR_INJECTION,
SymfonySetList::ANNOTATIONS_TO_ATTRIBUTES,
SymfonySetList::CONFIGS,
]);
$rectorConfig->skip([
RemoveAlwaysTrueIfConditionRector::class => [
__DIR__ . '/src/Security/Voter/UserSiteAccessVoter.php',
],
AnnotationToAttributeRector::class => [
__DIR__ . '/src/Entity/Site.php',
__DIR__ . '/src/Entity/User.php',
__DIR__ . '/src/Entity/UserSiteAccess.php',
],
]);
};