/
rector.php
45 lines (36 loc) · 1.57 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
<?php
declare(strict_types=1);
use Rector\Config\RectorConfig;
use Rector\Set\ValueObject\LevelSetList;
use Rector\Set\ValueObject\SetList;
return static function (RectorConfig $rectorConfig): void {
$rectorConfig->paths([
// Excluding the directories that contain external source code
//__DIR__ . '/ext_inc',
//__DIR__ . '/ext_scripts',
__DIR__ . '/inc',
__DIR__ . '/modules',
__DIR__ . '/tests',
]);
// Register a single rule
// $rectorConfig->rule(Rector\Php70\Rector\FuncCall\RandomFunctionRector::class);
// Define sets of rules
$rectorConfig->sets([
LevelSetList::UP_TO_PHP_80
]);
$rectorConfig->skip([
// Skipping LongArrayToShortArrayRector, because it transforms long multi-line
// array to one line arrays. This would destroy readability for now.
Rector\Php54\Rector\Array_\LongArrayToShortArrayRector::class,
// Skipping PowToExpRector, because pow is not deprecated or has any disadvantage
// over **
// See https://www.php.net/manual/en/function.pow.php
Rector\Php56\Rector\FuncCall\PowToExpRector::class,
// Skipping Constructor Promotion right now, because it is a great feature and syntactic sugar.
// However, to keep the changeset small, we might introduce this at a later stage.
// More info:
// - https://wiki.php.net/rfc/constructor_promotion
// - https://github.com/php/php-src/pull/5291
Rector\Php80\Rector\Class_\ClassPropertyAssignToConstructorPromotionRector::class,
]);
};