Repository navigation
Expand file tree
/
Copy pathrector.php
More file actions
44 lines (41 loc) · 1.73 KB
/
Copy pathrector.php
File metadata and controls
44 lines (41 loc) · 1.73 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
<?php
declare(strict_types=1);
use Rector\CodeQuality\Rector\If_\ExplicitNullableObjectInstanceRector;
use Rector\CodingStyle\Rector\ClassLike\NewlineBetweenClassLikeStmtsRector;
use Rector\CodingStyle\Rector\ClassMethod\NewlineBeforeNewAssignSetRector;
use Rector\CodingStyle\Rector\Stmt\NewlineAfterStatementRector;
use Rector\Config\RectorConfig;
use Rector\DeadCode\Rector\Assign\RemoveUnusedVariableAssignRector;
use Rector\Php80\Rector\Class_\ClassPropertyAssignToConstructorPromotionRector;
use Rector\TypeDeclaration\Rector\StmtsAwareInterface\SafeDeclareStrictTypesRector;
return RectorConfig::configure()
->withPaths([
__DIR__ . '/src',
__DIR__ . '/tests',
])
->withBootstrapFiles([
__DIR__ . '/vendor/autoload.php',
])
->withPhpSets(php82: true)
->withPreparedSets(
deadCode: true,
codeQuality: true,
codingStyle: true,
)
->withSkip([
// keep explicit class property declarations instead of constructor promotion
ClassPropertyAssignToConstructorPromotionRector::class,
// do not force blank lines between class constants / properties
NewlineBetweenClassLikeStmtsRector::class,
// do not force blank lines between statements
NewlineAfterStatementRector::class,
NewlineBeforeNewAssignSetRector::class,
// prefer explicit null comparisons over fully-qualified instanceof checks
ExplicitNullableObjectInstanceRector::class,
// treats ArrayAccess reads (e.g. `$_ = $obj[0];`) as side-effect free
RemoveUnusedVariableAssignRector::class,
// PHPUnit test classes must not declare strict types
SafeDeclareStrictTypesRector::class => [
__DIR__ . '/tests',
],
]);