-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrector.php
54 lines (50 loc) · 2.67 KB
/
rector.php
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
<?php
declare(strict_types=1);
use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector;
use Rector\Config\RectorConfig;
use Rector\Php80\Rector\Class_\ClassPropertyAssignToConstructorPromotionRector;
use Rector\Set\ValueObject\LevelSetList;
use Rector\Set\ValueObject\SetList;
use Rector\TypeDeclaration\Rector\Class_\PropertyTypeFromStrictSetterGetterRector;
use Rector\TypeDeclaration\Rector\ClassMethod\AddMethodCallBasedStrictParamTypeRector;
use Rector\TypeDeclaration\Rector\ClassMethod\AddParamTypeFromPropertyTypeRector;
use Rector\TypeDeclaration\Rector\ClassMethod\ArrayShapeFromConstantArrayReturnRector;
use Rector\TypeDeclaration\Rector\ClassMethod\ParamAnnotationIncorrectNullableRector;
use Rector\TypeDeclaration\Rector\ClassMethod\ParamTypeByMethodCallTypeRector;
use Rector\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromReturnDirectArrayRector;
use Rector\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromReturnNewRector;
use Rector\TypeDeclaration\Rector\Param\ParamTypeFromStrictTypedPropertyRector;
use Rector\TypeDeclaration\Rector\Property\TypedPropertyFromAssignsRector;
use Rector\TypeDeclaration\Rector\Property\TypedPropertyFromStrictConstructorRector;
use Rector\TypeDeclaration\Rector\Property\TypedPropertyFromStrictGetterMethodReturnTypeRector;
return static function (RectorConfig $rectorConfig): void {
$rectorConfig->importNames(true);
$rectorConfig->paths([
__DIR__ . '/build',
__DIR__ . '/generated',
__DIR__ . '/src',
]);
$rectorConfig->rule(InlineConstructorDefaultToPropertyRector::class);
$rectorConfig->rule(AddMethodCallBasedStrictParamTypeRector::class);
$rectorConfig->rule(AddParamTypeFromPropertyTypeRector::class);
$rectorConfig->rule(ArrayShapeFromConstantArrayReturnRector::class);
$rectorConfig->rule(ParamTypeByMethodCallTypeRector::class);
$rectorConfig->rule(ParamTypeFromStrictTypedPropertyRector::class);
$rectorConfig->rule(PropertyTypeFromStrictSetterGetterRector::class);
$rectorConfig->rule(ReturnTypeFromReturnDirectArrayRector::class);
$rectorConfig->rule(ReturnTypeFromReturnNewRector::class);
$rectorConfig->rule(TypedPropertyFromStrictConstructorRector::class);
$rectorConfig->rule(TypedPropertyFromStrictGetterMethodReturnTypeRector::class);
$rectorConfig->ruleWithConfiguration(TypedPropertyFromAssignsRector::class, [
TypedPropertyFromAssignsRector::INLINE_PUBLIC => true,
]);
$rectorConfig->sets([
LevelSetList::UP_TO_PHP_80,
SetList::TYPE_DECLARATION,
]);
$rectorConfig->skip([
ClassPropertyAssignToConstructorPromotionRector::class => [
__DIR__ . '/generated/Model'
],
]);
};