-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrector.php
More file actions
56 lines (47 loc) · 1.75 KB
/
rector.php
File metadata and controls
56 lines (47 loc) · 1.75 KB
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
51
52
53
54
55
56
<?php
declare(strict_types=1);
use Rector\CodeQuality\Rector\Array_\CallableThisArrayToAnonymousFunctionRector;
use Rector\CodingStyle\Rector\Encapsed\EncapsedStringsToSprintfRector;
use Rector\Config\RectorConfig;
use Rector\Core\ValueObject\PhpVersion;
use Rector\Php55\Rector\Class_\ClassConstantToSelfClassRector;
use Rector\Php71\Rector\FuncCall\RemoveExtraParametersRector;
use Rector\Set\ValueObject\LevelSetList;
use Rector\Set\ValueObject\SetList;
return static function (RectorConfig $config): void {
// here we can define, what sets of rules will be applied
// tip: use "SetList" class to autocomplete sets
$config->import(SetList::CODE_QUALITY);
$config->import(SetList::PHP_74);
$config->import(SetList::TYPE_DECLARATION);
$config->import(SetList::TYPE_DECLARATION_STRICT);
$config->import(SetList::EARLY_RETURN);
$config->import(SetList::NAMING);
$config->import(SetList::CODING_STYLE);
$config->import(LevelSetList::UP_TO_PHP_74);
$config->fileExtensions(['php']);
$config->phpVersion(PhpVersion::PHP_74);
$config->importNames();
$config->importShortClasses(false);
$config->parallel();
$config->cacheDirectory(__DIR__.'/cache/rector');
$config->paths([
__DIR__,
__DIR__.'/src',
]);
$config->skip(
[
// or fnmatch
__DIR__.'/vendor',
__DIR__.'/cache',
__DIR__.'/rector.php',
CallableThisArrayToAnonymousFunctionRector::class,
ClassConstantToSelfClassRector::class,
RemoveExtraParametersRector::class,
EncapsedStringsToSprintfRector::class,
]
);
$config->autoloadPaths([
__DIR__.'/vendor/php-stubs/wordpress-stubs/wordpress-stubs.php',
]);
};