-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrector.php
More file actions
36 lines (34 loc) · 1.38 KB
/
rector.php
File metadata and controls
36 lines (34 loc) · 1.38 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
<?php
use Rector\Config\RectorConfig;
use Rector\Php73\Rector\FuncCall\JsonThrowOnErrorRector;
use Rector\Php80\Rector\Class_\ClassPropertyAssignToConstructorPromotionRector;
use Rector\Php80\Rector\Switch_\ChangeSwitchToMatchRector;
use Rector\Php81\Rector\ClassMethod\NewInInitializerRector;
use Rector\Php81\Rector\Property\ReadOnlyPropertyRector;
use Rector\Php82\Rector\Class_\ReadOnlyClassRector;
use Rector\Php84\Rector\MethodCall\NewMethodCallWithoutParenthesesRector;
use Rector\TypeDeclaration\Rector\ClassMethod\ReturnNeverTypeRector;
use Rector\TypeDeclaration\Rector\Property\TypedPropertyFromStrictConstructorRector;
use Rector\ValueObject\PhpVersion;
return RectorConfig::configure()
->withPhpVersion(PhpVersion::PHP_84)
->withRules([
TypedPropertyFromStrictConstructorRector::class,
NewMethodCallWithoutParenthesesRector::class,
JsonThrowOnErrorRector::class,
ReadOnlyPropertyRector::class,
NewInInitializerRector::class,
ReturnNeverTypeRector::class,
ChangeSwitchToMatchRector::class,
ClassPropertyAssignToConstructorPromotionRector::class,
ReadOnlyClassRector::class,
])
// here we can define, what prepared sets of rules will be applied
->withPreparedSets(
codeQuality: true
)
->withPaths([
__DIR__ . '/src',
__DIR__ . '/examples',
__DIR__ . '/tests',
]);