-
Notifications
You must be signed in to change notification settings - Fork 20
/
rector.php
34 lines (28 loc) · 1006 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
<?php
declare(strict_types=1);
use Rector\Config\RectorConfig;
use Rector\ValueObject\PhpVersion;
use Rector\Set\ValueObject\LevelSetList;
use Rector\Set\ValueObject\SetList;
/**
* More info about Rector on https://github.com/rectorphp/rector.
*/
return static function (RectorConfig $rectorConfig): void {
// paths to refactor; solid alternative to CLI arguments
$rectorConfig->paths([
__DIR__ . '/app',
__DIR__ . '/tests',
]);
// is your PHP version different from the one you refactor to? [default: your PHP version], uses PHP_VERSION_ID format
$rectorConfig->phpVersion(PhpVersion::PHP_83);
// Path to PHPStan with extensions, that PHPStan in Rector uses to determine types
$rectorConfig->phpstanConfig(__DIR__ . '/phpstan.neon.dist');
// register sets rule
$rectorConfig->sets([
SetList::CODE_QUALITY,
SetList::PHP_83,
SetList::EARLY_RETURN,
SetList::DEAD_CODE,
LevelSetList::UP_TO_PHP_83,
]);
};