forked from auth0/wordpress
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rector.php
50 lines (41 loc) · 1.46 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
<?php
declare(strict_types=1);
use Rector\Config\RectorConfig;
use Rector\Core\ValueObject\PhpVersion;
use Rector\Php74\Rector\Property\TypedPropertyRector;
use Rector\Set\ValueObject\LevelSetList;
use Rector\Set\ValueObject\SetList;
if (!defined('DOCUMENT_ROOT')) {
define('DOCUMENT_ROOT', __DIR__ . DIRECTORY_SEPARATOR);
}
return static function (RectorConfig $rectorConfig): void {
$rectorConfig->importNames();
$rectorConfig->parallel();
$rectorConfig->paths([
DOCUMENT_ROOT . 'wpAuth0.php',
DOCUMENT_ROOT . 'functions.php',
DOCUMENT_ROOT . 'src',
]);
// Rector has challenges processing some classes in these folders; skip until we can find a better solution:
$rectorConfig->skip([
DOCUMENT_ROOT . 'src' . DIRECTORY_SEPARATOR . 'Http',
DOCUMENT_ROOT . 'src' . DIRECTORY_SEPARATOR . 'Cache',
]);
$rectorConfig->sets([
SetList::ACTION_INJECTION_TO_CONSTRUCTOR_INJECTION,
SetList::CODE_QUALITY,
SetList::CODING_STYLE,
SetList::DEAD_CODE,
SetList::EARLY_RETURN,
SetList::NAMING,
SetList::PHP_80,
SetList::PRIVATIZATION,
SetList::PSR_4,
SetList::TYPE_DECLARATION,
SetList::TYPE_DECLARATION_STRICT,
LevelSetList::UP_TO_PHP_80
]);
$rectorConfig->rule(TypedPropertyRector::class);
$rectorConfig->phpVersion(PhpVersion::PHP_80);
$rectorConfig->phpstanConfig(DOCUMENT_ROOT . 'phpstan.neon.dist');
};