-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrector.php
More file actions
49 lines (41 loc) · 1.69 KB
/
rector.php
File metadata and controls
49 lines (41 loc) · 1.69 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
<?php
// version 2.3.9
declare(strict_types=1);
use Rector\Config\RectorConfig;
use Rector\ValueObject\PhpVersion;
use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector;
use Rector\Set\ValueObject\LevelSetList;
use Rector\Set\ValueObject\SetList;
use Rector\Set\ValueObject\DowngradeLevelSetList;
use Rector\CodingStyle\Rector\Encapsed\WrapEncapsedVariableInCurlyBracesRector;
return RectorConfig::configure()
// Directories to process
->withPaths([
// __DIR__ . '/src',
])
// PHP version (your minimum version)
->withPhpVersion(PhpVersion::PHP_85)
// Apply selected rule
->withRules([
// InlineConstructorDefaultToPropertyRector::class,
])
// Enable modern sets (correct API)
->withSets([
LevelSetList::UP_TO_PHP_85,
SetList::DEAD_CODE,
SetList::CODE_QUALITY,
SetList::CODING_STYLE,
])
// Disable specific Rector rules
->withSkip([
// if rector complains for not having {} after if statment
// Rector doesn't like if($var) return; he likes if ($var) {return;}
///Rector\CodeQuality\Rector\If_\CompleteMissingIfElseBracketRector::class,
// If Rector is adding extra newlines you don't want
///Rector\CodingStyle\Rector\Stmt\NewlineAfterStatementRector::class,
// Rector\CodeQuality\Rector\Empty_\EmptyToStrictCheckRector::class,
///Rector\CodingStyle\Rector\Encapsed\EncapsedStringsToSprintfRector::class,
///Rector\Php80\Rector\NotIdentical\StrContainsRector::class,
///Rector\Php80\Rector\Identical\StrStartsWithRector::class,
///Rector\CodingStyle\Rector\FuncCall\FunctionFirstClassCallableRector::class,
]);