-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathrector.php
75 lines (64 loc) · 2.19 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<?php
declare(strict_types=1);
use Rector\Config\RectorConfig;
use Rector\Core\ValueObject\PhpVersion;
use Rector\Doctrine\Set\DoctrineSetList;
use Rector\PHPUnit\Set\PHPUnitSetList;
use Rector\Set\ValueObject\SetList;
use Rector\Symfony\Set\SymfonySetList;
return static function (RectorConfig $rectorConfig): void {
$rectorConfig->phpVersion(phpVersion: PhpVersion::PHP_80);
$rectorConfig->importNames();
$rectorConfig->importShortClasses();
$rectorConfig->parallel(seconds: 600, maxNumberOfProcess: 32);
$rectorConfig->autoloadPaths(autoloadPaths: [
__DIR__ . '/vendor/autoload.php',
]);
$rectorConfig->paths(paths: [
__DIR__ . '/src',
__DIR__ . '/tests',
]);
$rectorConfig->skip(criteria: [
__DIR__ . '/vendor',
__DIR__ . '/src/DependencyInjection/SchedulerBundleExtension.php',
__DIR__ . '/tests/Serializer/TaskNormalizerTest.php',
]);
$rectorConfig->sets(sets: [
DoctrineSetList::DOCTRINE_25,
DoctrineSetList::DOCTRINE_DBAL_211,
DoctrineSetList::DOCTRINE_DBAL_30,
]);
$rectorConfig->sets(sets: [
PHPUnitSetList::PHPUNIT_91,
PHPUnitSetList::PHPUNIT_EXCEPTION,
PHPUnitSetList::REMOVE_MOCKS,
PHPUnitSetList::PHPUNIT_SPECIFIC_METHOD,
PHPUnitSetList::PHPUNIT_YIELD_DATA_PROVIDER,
]);
$rectorConfig->sets(sets: [
SetList::CODE_QUALITY,
SetList::DEAD_CODE,
SetList::EARLY_RETURN,
SetList::PHP_70,
SetList::PHP_71,
SetList::PHP_72,
SetList::PHP_73,
SetList::PHP_74,
SetList::PHP_80,
SetList::PSR_4,
]);
$rectorConfig->sets(sets: [
SymfonySetList::SYMFONY_50,
SymfonySetList::SYMFONY_50_TYPES,
SymfonySetList::SYMFONY_51,
SymfonySetList::SYMFONY_52,
SymfonySetList::SYMFONY_CONSTRUCTOR_INJECTION,
SymfonySetList::SYMFONY_52_VALIDATOR_ATTRIBUTES,
SymfonySetList::SYMFONY_53,
SymfonySetList::SYMFONY_54,
]);
'8.1' !== PHP_VERSION
? $rectorConfig->phpstanConfig(filePath: __DIR__ . '/phpstan.neon.8.0.dist')
: $rectorConfig->phpstanConfig(filePath: __DIR__ . '/phpstan.neon.8.1.dist')
;
};