-
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathrector.php
More file actions
61 lines (58 loc) · 2.66 KB
/
rector.php
File metadata and controls
61 lines (58 loc) · 2.66 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
<?php
declare(strict_types=1);
use Rector\Caching\ValueObject\Storage\FileCacheStorage;
use Rector\CodeQuality\Rector\Empty_\SimplifyEmptyCheckOnEmptyArrayRector;
use Rector\CodeQuality\Rector\Isset_\IssetOnPropertyObjectToPropertyExistsRector;
use Rector\CodeQuality\Rector\Ternary\SwitchNegatedTernaryRector;
use Rector\CodingStyle\Rector\ClassMethod\NewlineBeforeNewAssignSetRector;
use Rector\CodingStyle\Rector\FuncCall\FunctionFirstClassCallableRector;
use Rector\Config\RectorConfig;
use Rector\DeadCode\Rector\ClassMethod\RemoveUselessParamTagRector;
use Rector\Strict\Rector\Empty_\DisallowedEmptyRuleFixerRector;
use Rector\TypeDeclaration\Rector\ArrowFunction\AddArrowFunctionReturnTypeRector;
use Rector\TypeDeclaration\Rector\ClassMethod\AddParamStringTypeFromSprintfUseRector;
use Rector\TypeDeclaration\Rector\ClassMethod\AddVoidReturnTypeWhereNoReturnRector;
use Rector\TypeDeclaration\Rector\ClassMethod\StrictStringParamConcatRector;
use Rector\TypeDeclaration\Rector\Closure\AddClosureVoidReturnTypeWhereNoReturnRector;
use Rector\TypeDeclaration\Rector\Function_\AddFunctionVoidReturnTypeWhereNoReturnRector;
use Rector\TypeDeclaration\Rector\StmtsAwareInterface\DeclareStrictTypesRector;
return RectorConfig::configure()
->withCache(
cacheClass: FileCacheStorage::class,
cacheDirectory: '/tmp/rector'
)
->withImportNames(removeUnusedImports: true)
->withPaths([__DIR__.'/src', __DIR__.'/tests/src'])
->withRules([
DeclareStrictTypesRector::class,
])
->withSkip([
AddArrowFunctionReturnTypeRector::class,
AddClosureVoidReturnTypeWhereNoReturnRector::class,
AddFunctionVoidReturnTypeWhereNoReturnRector::class,
AddParamStringTypeFromSprintfUseRector::class => [
__DIR__.'/src/Admin/Traits/ControllerUtils.php',
],
AddVoidReturnTypeWhereNoReturnRector::class => [
__DIR__.'/src/Flame/Providers/EventServiceProvider.php',
],
DisallowedEmptyRuleFixerRector::class,
RemoveUselessParamTagRector::class => [
__DIR__.'/src/Flame/Database/Concerns/HasRelationships.php',
],
FunctionFirstClassCallableRector::class,
SimplifyEmptyCheckOnEmptyArrayRector::class,
StrictStringParamConcatRector::class => [
__DIR__.'/src/Flame/Database/Concerns/HasRelationships.php',
],
SwitchNegatedTernaryRector::class,
IssetOnPropertyObjectToPropertyExistsRector::class,
NewlineBeforeNewAssignSetRector::class,
])
->withPhpSets(php83: true)
->withPreparedSets(
deadCode: true,
codeQuality: true,
codingStyle: true,
typeDeclarations: true,
);