-
-
Notifications
You must be signed in to change notification settings - Fork 26
/
rector.php
52 lines (49 loc) · 2.01 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
<?php
declare(strict_types=1);
use Rector\Config\RectorConfig;
use Rector\Php74\Rector\Closure\ClosureToArrowFunctionRector;
use Rector\Php80\Rector\Catch_\RemoveUnusedVariableInCatchRector;
use Rector\Php80\Rector\FuncCall\ClassOnObjectRector;
use Rector\Php80\Rector\FunctionLike\MixedTypeRector;
use Rector\Php80\Rector\Identical\StrEndsWithRector;
use Rector\Php80\Rector\Identical\StrStartsWithRector;
use Rector\Php80\Rector\NotIdentical\StrContainsRector;
use Rector\Php82\Rector\Class_\ReadOnlyClassRector;
use Rector\Php82\Rector\Param\AddSensitiveParameterAttributeRector;
use Rector\TypeDeclaration\Rector\ClassMethod\AddVoidReturnTypeWhereNoReturnRector;
use Rector\ValueObject\PhpVersion;
use Utils\Rector\BootloaderConstantsFixesRule;
return RectorConfig::configure()
->withPaths([
__DIR__ . '/app',
__DIR__ . '/tests',
])
->withImportNames(importShortClasses: false, removeUnusedImports: true)
->withCache(cacheDirectory: __DIR__ . '.cache/rector')
// uncomment to reach your current PHP version
// ->withPhpSets()
->withRules([
BootloaderConstantsFixesRule::class,
AddVoidReturnTypeWhereNoReturnRector::class,
ReadOnlyClassRector::class,
AddSensitiveParameterAttributeRector::class,
ClassOnObjectRector::class,
MixedTypeRector::class,
StrEndsWithRector::class,
StrStartsWithRector::class,
StrContainsRector::class,
RemoveUnusedVariableInCatchRector::class,
ClosureToArrowFunctionRector::class,
])
->withSkip([
\Rector\DeadCode\Rector\ClassMethod\RemoveUnusedPublicMethodParameterRector::class => [
__DIR__ . '/app/modules/Projects/Interfaces/Queries/FindProjectsHandler.php',
__DIR__ . '/app/modules/Webhooks/Interfaces/Query/FindWebhooksHandler.php',
],
])
->withPhpVersion(PhpVersion::PHP_82)
// here we can define, what prepared sets of rules will be applied
->withPreparedSets(
deadCode: true,
codeQuality: true,
);