-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrector.php
More file actions
35 lines (32 loc) · 1.23 KB
/
rector.php
File metadata and controls
35 lines (32 loc) · 1.23 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
<?php
declare(strict_types=1);
use Rector\CodeQuality\Rector\FuncCall\SetTypeToCastRector;
use Rector\CodeQuality\Rector\FuncCall\SimplifyRegexPatternRector;
use Rector\CodeQuality\Rector\FuncCall\SingleInArrayToCompareRector;
use Rector\Config\RectorConfig;
use Rector\DeadCode\Rector\Assign\RemoveDoubleAssignRector;
use Rector\DeadCode\Rector\Assign\RemoveUnusedVariableAssignRector;
use Rector\DeadCode\Rector\ClassMethod\RemoveEmptyClassMethodRector;
use Rector\DeadCode\Rector\ClassMethod\RemoveUnusedPrivateMethodRector;
use Rector\Php81\Rector\FuncCall\NullToStrictStringFuncCallArgRector;
return RectorConfig::configure()
->withPaths([
__DIR__.'/src',
])
->withSkip([
__DIR__.'/src/Scaffold/stubs',
__DIR__.'/src/Console/stubs',
])
->withRules([
// strict_types 类型安全
NullToStrictStringFuncCallArgRector::class,
// 代码质量
SetTypeToCastRector::class,
SimplifyRegexPatternRector::class,
SingleInArrayToCompareRector::class,
// 死代码清理
RemoveDoubleAssignRector::class,
RemoveUnusedVariableAssignRector::class,
RemoveEmptyClassMethodRector::class,
RemoveUnusedPrivateMethodRector::class,
]);