-
Notifications
You must be signed in to change notification settings - Fork 0
/
rector.php
66 lines (59 loc) · 2.16 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
55
56
57
58
59
60
61
62
63
64
65
66
<?php
use Rector\Caching\ValueObject\Storage\FileCacheStorage;
use Rector\CodingStyle\Rector\ArrowFunction\StaticArrowFunctionRector;
use Rector\CodingStyle\Rector\Closure\StaticClosureRector;
use Rector\CodingStyle\Rector\FuncCall\ArraySpreadInsteadOfArrayMergeRector;
use Rector\Config\RectorConfig;
use Rector\Php81\Rector\Array_\FirstClassCallableRector;
use RectorLaravel\Rector\FuncCall\RemoveDumpDataDeadCodeRector;
use RectorLaravel\Rector\MethodCall\EloquentWhereRelationTypeHintingParameterRector;
use RectorLaravel\Rector\MethodCall\EloquentWhereTypeHintClosureParameterRector;
use RectorLaravel\Rector\PropertyFetch\OptionalToNullsafeOperatorRector;
use RectorLaravel\Set\LaravelSetList;
return RectorConfig::configure()
->withImportNames()
->withParallel(
timeoutSeconds: 320,
maxNumberOfProcess: 16,
jobSize: 20,
)
->withCache(
cacheClass: FileCacheStorage::class,
cacheDirectory: __DIR__.'/.rector_cache',
)
->withPaths([
__DIR__.'/src',
])
// Up from PHP 5.3 to 8.2
//->withPhpSets()
// only PHP 8.2
->withPhpSets(php82: true)
->withSkip([
// Je trouve la lecture plus difficile avec cette syntaxe, donc je désactive (PHP 7.4/8.1)
// ArraySpreadInsteadOfArrayMergeRector::class,
// Ne pas changer les closure et Arrow Function en Static
// StaticClosureRector::class,
// StaticArrowFunctionRector::class,
// Désactivation de cette règle car elle
// transforme : array_map('intval',
// en : array_map(intval(...),
FirstClassCallableRector::class,
])
->withRules([
EloquentWhereRelationTypeHintingParameterRector::class,
EloquentWhereTypeHintClosureParameterRector::class,
OptionalToNullsafeOperatorRector::class,
RemoveDumpDataDeadCodeRector::class,
])
->withSets([
LaravelSetList::LARAVEL_FACADE_ALIASES_TO_FULL_NAMES,
])
->withPreparedSets(
deadCode: true,
codeQuality: true,
codingStyle: true,
typeDeclarations: true,
instanceOf: true,
earlyReturn: true,
strictBooleans: true,
);