-
Notifications
You must be signed in to change notification settings - Fork 45
Expand file tree
/
Copy pathrector.php
More file actions
55 lines (48 loc) · 1.94 KB
/
rector.php
File metadata and controls
55 lines (48 loc) · 1.94 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
<?php
declare(strict_types=1);
use Rector\Caching\ValueObject\Storage\FileCacheStorage;
use Rector\CodeQuality\Rector\FuncCall\CompactToVariablesRector;
use Rector\CodeQuality\Rector\If_\ExplicitBoolCompareRector;
use Rector\CodingStyle\Rector\Assign\SplitDoubleAssignRector;
use Rector\CodingStyle\Rector\Catch_\CatchExceptionNameMatchingTypeRector;
use Rector\CodingStyle\Rector\Stmt\NewlineAfterStatementRector;
use Rector\Config\RectorConfig;
use Rector\DeadCode\Rector\ClassMethod\RemoveUselessReturnTagRector;
use Rector\Php74\Rector\Closure\ClosureToArrowFunctionRector;
use Rector\Php80\Rector\Class_\ClassPropertyAssignToConstructorPromotionRector;
use Rector\Set\ValueObject\SetList;
use Rector\TypeDeclaration\Rector\Class_\TypedPropertyFromCreateMockAssignRector;
use Rector\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromStrictFluentReturnRector;
$cacheDir = getenv('RECTOR_CACHE_DIR') ?: sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'rector';
return RectorConfig::configure()
->withPaths([
__DIR__ . '/src',
__DIR__ . '/tests',
])
->withCache(
cacheClass: FileCacheStorage::class,
cacheDirectory: $cacheDir,
)
->withPhpSets()
->withAttributesSets()
->withSets([
SetList::CODE_QUALITY,
SetList::CODING_STYLE,
SetList::DEAD_CODE,
SetList::EARLY_RETURN,
SetList::INSTANCEOF,
SetList::TYPE_DECLARATION,
])
->withSkip([
__DIR__ . '/tests/comparisons',
ClassPropertyAssignToConstructorPromotionRector::class,
CatchExceptionNameMatchingTypeRector::class,
ClosureToArrowFunctionRector::class,
RemoveUselessReturnTagRector::class,
CompactToVariablesRector::class,
ReturnTypeFromStrictFluentReturnRector::class,
SplitDoubleAssignRector::class,
NewlineAfterStatementRector::class,
ExplicitBoolCompareRector::class,
TypedPropertyFromCreateMockAssignRector::class,
]);