-
Notifications
You must be signed in to change notification settings - Fork 7
/
rector.php
40 lines (28 loc) · 893 Bytes
/
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
<?php
declare(strict_types=1);
use Rector\Config\RectorConfig;
use Rector\Set\ValueObject\SetList;
include_once __DIR__ . '/php_min_version.php';
return static function (RectorConfig $rectorConfig): void {
# load min version from centralized file
$minVersion = (int)getenv('PHP_MIN_VERSION_RECTOR');
if (!$minVersion) {
die('PHP_MIN_VERSION_RECTOR environment variable not set or invalid.');
}
$rectorConfig->phpVersion($minVersion);
$rectorConfig->paths([
__DIR__ . '/bin',
__DIR__ . '/devops/scripts',
__DIR__ . '/src',
__DIR__ . '/tests/phpunit',
]);
$rectorConfig->importNames();
$rectorConfig->sets([
SetList::DEAD_CODE,
SetList::CODE_QUALITY,
SetList::STRICT_BOOLEANS,
SetList::TYPE_DECLARATION,
SetList::EARLY_RETURN,
SetList::INSTANCEOF,
]);
};