-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
rector.php
54 lines (51 loc) · 2.04 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
<?php
declare(strict_types=1);
use Rector\CodeQuality\Rector\ClassMethod\InlineArrayReturnAssignRector;
use Rector\CodeQuality\Rector\Expression\InlineIfToExplicitIfRector;
use Rector\CodeQuality\Rector\Identical\FlipTypeControlToUseExclusiveTypeRector;
use Rector\CodeQuality\Rector\LogicalAnd\LogicalToBooleanRector;
use Rector\CodingStyle\Rector\Encapsed\EncapsedStringsToSprintfRector;
use Rector\CodingStyle\Rector\PostInc\PostIncDecToPreIncDecRector;
use Rector\Config\RectorConfig;
use Rector\Php81\Rector\FuncCall\NullToStrictStringFuncCallArgRector;
use Rector\Strict\Rector\Empty_\DisallowedEmptyRuleFixerRector;
use Rector\TypeDeclaration\Rector\BooleanAnd\BinaryOpNullableToInstanceofRector;
use Rector\ValueObject\PhpVersion;
return RectorConfig::configure()
->withPaths([
// let's add more directories step by step
// __DIR__ . '/src',
// __DIR__ . '/tests',
// __DIR__ . '/bin',
__DIR__ . '/src/Client',
])
->withSkipPath('src/Client/TrapHandle/ContextProvider/Source.php')
->withPHPStanConfigs([
__DIR__ . '/phpstan-baseline.neon',
])
->withImportNames(importNames: false, importDocBlockNames: true, importShortClasses: false, removeUnusedImports: true)
->withPhpVersion(PhpVersion::PHP_81)
->withPhpSets(php81: true)
->withPreparedSets(
deadCode: false,
codeQuality: true,
codingStyle: true,
typeDeclarations: true,
privatization: true,
naming: false,
instanceOf: true,
earlyReturn: true,
strictBooleans: true,
carbon: false,
rectorPreset: true,
)->withSkip([
InlineArrayReturnAssignRector::class,
PostIncDecToPreIncDecRector::class,
InlineIfToExplicitIfRector::class,
LogicalToBooleanRector::class,
BinaryOpNullableToInstanceofRector::class,
FlipTypeControlToUseExclusiveTypeRector::class,
DisallowedEmptyRuleFixerRector::class,
NullToStrictStringFuncCallArgRector::class,
EncapsedStringsToSprintfRector::class,
]);