-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrector.php
More file actions
92 lines (85 loc) · 3.05 KB
/
Copy pathrector.php
File metadata and controls
92 lines (85 loc) · 3.05 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<?php
declare(strict_types=1);
/*
* This file is part of SolidWorx Platform project.
*
* (c) Pierre du Plessis <open-source@solidworx.co>
*
* 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\DeadCode\Rector\Class_\RemoveRefactorDuplicatedNodeInstanceCheckRector;
use Rector\PHPUnit\Set\PHPUnitSetList;
use Rector\Set\ValueObject\LevelSetList;
use Rector\Set\ValueObject\SetList;
use Rector\Symfony\Configs\Rector\Closure\ServiceArgsToServiceNamedArgRector;
use Rector\TypeDeclaration\Rector\ClassMethod\AddReturnDocblockForScalarArrayFromAssignsRector;
use Rector\TypeDeclarationDocblocks\Rector\Class_\AddParamTypeToRefactorMethodRector;
use Rector\ValueObject\PhpVersion;
use SolidWorx\Platform\Tools\Rector\Set\SolidWorxSetList;
return RectorConfig::configure()
->withPaths([
__DIR__ . '/src',
])
->withImportNames()
->withComposerBased(twig: true, doctrine: true, phpunit: true, symfony: true)
->withPhpVersion(PhpVersion::PHP_84)
->withAttributesSets(symfony: true, doctrine: true, gedmo: true, phpunit: true)
->withPhpLevel(0)
->withRootFiles()
->withEditorUrl('phpstorm://open?url=file://%%f&line=%%l')
->withPreparedSets(
deadCode: true,
codeQuality: true,
codingStyle: true,
typeDeclarations: true,
typeDeclarationDocblocks: true,
privatization: true,
naming: false,
namedArgs: true,
instanceOf: true,
if: true,
earlyReturn: true,
carbon: true,
rectorPreset: true,
phpunitCodeQuality: true,
phpunitNarrowAsserts: true,
phpunitMockToStub: true,
doctrineCodeQuality: true,
symfonyCodeQuality: true,
symfonyConfigs: true,
)
->withParallel()
->withSets([
SolidWorxSetList::PLATFORM,
// General
SetList::CODE_QUALITY,
SetList::CODING_STYLE,
SetList::DEAD_CODE,
SetList::RECTOR_PRESET,
SetList::TYPE_DECLARATION,
SetList::TYPE_DECLARATION_DOCBLOCKS,
SetList::CARBON,
SetList::PRIVATIZATION,
// PHP
LevelSetList::UP_TO_PHP_84,
// PHPUnit
PHPUnitSetList::ANNOTATIONS_TO_ATTRIBUTES,
PHPUnitSetList::PHPUNIT_CODE_QUALITY,
PHPUnitSetList::PHPUNIT_MOCK_TO_STUB,
PHPUnitSetList::PHPUNIT_NARROW_ASSERTS,
PHPUnitSetList::COMPOSER_BASED,
])
->withSkip([
AddReturnDocblockForScalarArrayFromAssignsRector::class,
RemoveRefactorDuplicatedNodeInstanceCheckRector::class,
AddParamTypeToRefactorMethodRector::class,
/**
* This rule changes Symfony service config
* from `$services->set(SomeClass::class)->args(['some_value']);` to `$services->set(SomeClass::class)->arg('$someCtorParameter', 'some_value');`
* which means that if we change the variable name in the constructor,
* the service definition will break.
*/
ServiceArgsToServiceNamedArgRector::class,
]);