-
Notifications
You must be signed in to change notification settings - Fork 3
/
rector.php
29 lines (24 loc) · 1.02 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
<?php
require_once __DIR__ . '/vendor/autoload.php';
use Rector\Config\RectorConfig;
use Rector\Php80\Rector\Class_\ClassPropertyAssignToConstructorPromotionRector;
use Rector\Set\ValueObject\SetList;
use Rector\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromStrictTypedPropertyRector;
use Rector\TypeDeclaration\Rector\Property\TypedPropertyFromStrictConstructorRector;
return static function (RectorConfig $rectorConfig): void {
// register single rule
$rectorConfig->rules([
TypedPropertyFromStrictConstructorRector::class,
ReturnTypeFromStrictTypedPropertyRector::class,
ClassPropertyAssignToConstructorPromotionRector::class,
]);
// here we can define, what sets of rules will be applied
// tip: use "SetList" class to autocomplete sets with your IDE
$rectorConfig->sets([
\Rector\Set\ValueObject\LevelSetList::UP_TO_PHP_82,
SetList::CODE_QUALITY,
SetList::PHP_82,
SetList::TYPE_DECLARATION,
]);
$rectorConfig->paths([__DIR__ . '/src']);
};