-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrector.php
More file actions
31 lines (25 loc) · 1.04 KB
/
rector.php
File metadata and controls
31 lines (25 loc) · 1.04 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
<?php
declare(strict_types=1);
use Rector\Config\RectorConfig;
use Rector\Set\ValueObject\LevelSetList;
return static function (RectorConfig $rectorConfig): void {
// 1) Define which directories Rector should process:
$rectorConfig->paths([
__DIR__ . '/htdocs',
__DIR__ . '/deploy',
]);
// 2) Target modern syntax so Rector upgrades toward PHP 8.x instead of downgrading.
$rectorConfig->sets([
LevelSetList::UP_TO_PHP_83,
]);
// 3) If you had specific rules previously (like AddVoidReturnTypeWhereNoReturnRector),
// remove them or skip them because those rules add modern type hints:
$rectorConfig->skip([
// e.g. Rector\TypeDeclaration\Rector\ClassMethod\AddVoidReturnTypeWhereNoReturnRector::class,
]);
// 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.
// ]);
};