-
Notifications
You must be signed in to change notification settings - Fork 7
/
rector.php
46 lines (42 loc) · 1.48 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
<?php
declare(strict_types=1);
use Rector\CodeQuality\Rector\Identical\FlipTypeControlToUseExclusiveTypeRector;
use Rector\Config\RectorConfig;
use Rector\Php53\Rector\Ternary\TernaryToElvisRector;
use Rector\Php80\Rector\Class_\ClassPropertyAssignToConstructorPromotionRector;
//
// https://github.com/rectorphp/rector
// https://getrector.com/documentation/integration-to-new-project
// https://getrector.com/blog
//
// Another good tool from the rector team is installed to be able to use for manual refactors: https://github.com/rectorphp/swiss-knife
//
return RectorConfig::configure()
->withPaths([
__DIR__ . '/examples',
__DIR__ . '/src',
])
->withPhpSets(php82: true)
->withImportNames(importShortClasses: false)
->withAttributesSets(all: true)
// https://getrector.com/documentation/set-lists
->withPreparedSets(
deadCode: true,
codeQuality: true,
codingStyle: true,
typeDeclarations: true,
privatization: true,
instanceOf: true,
strictBooleans: true,
rectorPreset: true,
phpunitCodeQuality: true,
phpunit: true,
)
// DTOs looks a bit ugly with this, lets consider if we want this
->withSkip([
ClassPropertyAssignToConstructorPromotionRector::class,
FlipTypeControlToUseExclusiveTypeRector::class,
// this is conflicting with our phpstan rules - either they should change or this needs to be skipped
TernaryToElvisRector::class,
])
;