-
Notifications
You must be signed in to change notification settings - Fork 1
/
rector.php
36 lines (30 loc) · 1.07 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
<?php
use Rector\Core\Configuration\Option;
use Rector\Set\ValueObject\SetList;
use Rector\Php80\Rector\Class_\ClassPropertyAssignToConstructorPromotionRector;
use Rector\CodingStyle\Rector\Class_\AddArrayDefaultToArrayPropertyRector;
require_once __DIR__ . '/vendor/autoload.php';
// Define what rule sets will the Rector apply
return static function (Rector\Config\RectorConfig $rectorConfig): void {
$rectorConfig->paths([
__DIR__ . '/src',
__DIR__ . '/tests',
]);
$rectorConfig->skip([
__DIR__ . '/tests/bootstrap.php', // for example, exclude test bootstrap file
]);
// Define sets of rules
$rectorConfig->sets([
SetList::CODE_QUALITY,
SetList::PHP_82,
SetList::TYPE_DECLARATION,
SetList::CODING_STYLE,
SetList::DEAD_CODE,
SetList::PRIVATIZATION,
SetList::EARLY_RETURN,
]);
// Add specific rector with configuration
$rectorConfig->ruleWithConfiguration(ClassPropertyAssignToConstructorPromotionRector::class, [
'promote_only_existing_assigns' => true,
]);
};