-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathrector.php
More file actions
36 lines (30 loc) · 1.19 KB
/
rector.php
File metadata and controls
36 lines (30 loc) · 1.19 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
<?php
declare(strict_types=1);
use Rector\Config\RectorConfig;
use Rector\Set\ValueObject\DowngradeSetList;
return static function (RectorConfig $rectorConfig): void {
// 1) Define which directories Rector should process:
$rectorConfig->paths([
__DIR__ . '/htdocs',
__DIR__ . '/deploy',
]);
// 2) Include the Downgrade sets to stay PHP 5-compatible.
// These sets remove or rewrite features from newer PHP versions (7.x, 8.x)
// so you don’t break on older environments:
$rectorConfig->sets([
DowngradeSetList::PHP_80,
DowngradeSetList::PHP_74,
DowngradeSetList::PHP_73,
DowngradeSetList::PHP_72,
]);
// 3) If you had specific rules previously (like AddVoidReturnTypeWhereNoReturnRector),
// remove them or skip them because those rules add modern type hints:
$rectorConfig->skip([
__DIR__ . '/htdocs/includes/vendor',
]);
// 4) (Optional) Add additional sets for code quality/cleanup if they don't
// introduce modern syntax. For example:
// $rectorConfig->sets([
// SetList::DEAD_CODE, // But be careful that it doesn't introduce PHP 7+ array destructuring, etc.
// ]);
};