-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrector.php
More file actions
51 lines (43 loc) · 1.95 KB
/
rector.php
File metadata and controls
51 lines (43 loc) · 1.95 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
<?php
declare(strict_types=1);
use Rector\CodeQuality\Rector\Identical\FlipTypeControlToUseExclusiveTypeRector;
use Rector\CodeQuality\Rector\If_\CombineIfRector;
use Rector\CodingStyle\Rector\Catch_\CatchExceptionNameMatchingTypeRector;
use Rector\CodingStyle\Rector\Encapsed\EncapsedStringsToSprintfRector;
use Rector\Config\Level\CodeQualityLevel;
use Rector\Config\Level\CodingStyleLevel;
use Rector\Config\Level\DeadCodeLevel;
use Rector\Config\Level\TypeDeclarationLevel;
use Rector\Config\RectorConfig;
use Rector\Php80\Rector\Class_\ClassPropertyAssignToConstructorPromotionRector;
use Rector\Php81\Rector\FuncCall\NullToStrictStringFuncCallArgRector;
return RectorConfig::configure()
->withPaths([
__DIR__.'/config',
__DIR__.'/public',
__DIR__.'/src',
__DIR__.'/tests',
])
->withPhpSets()
->withComposerBased(twig: true, doctrine: true, phpunit: true, symfony: true)
->withTypeCoverageLevel(count(TypeDeclarationLevel::RULES))
->withDeadCodeLevel(count(DeadCodeLevel::RULES))
->withCodeQualityLevel(count(CodeQualityLevel::RULES))
->withCodingStyleLevel(count(CodingStyleLevel::RULES))
->withSkip([
// This rule systematically move "huge" block of code inside the
// constructor. I found this less readable for entities.
ClassPropertyAssignToConstructorPromotionRector::class,
// Cause "$e" is acceptable
CatchExceptionNameMatchingTypeRector::class,
// Encapsed string are IMO more lisible than sprintf!
EncapsedStringsToSprintfRector::class,
// Not a big fan a long line with a single if statement
CombineIfRector::class,
// I prefer comparing to null
FlipTypeControlToUseExclusiveTypeRector::class,
// This rule creates "errors" in CI but not locally
// @see https://github.com/altercampagne/eventoj/actions/runs/13699190164/job/38308515651?pr=103
NullToStrictStringFuncCallArgRector::class,
])
;