-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathrector.php
More file actions
52 lines (43 loc) · 1.46 KB
/
rector.php
File metadata and controls
52 lines (43 loc) · 1.46 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
<?php
declare(strict_types=1);
use Rector\Config\RectorConfig;
use Rector\Set\ValueObject\LevelSetList;
use Rector\Set\ValueObject\SetList;
// Project-specific Rector configuration for WP-SlimStat plugin.
// Configured for PHP 7.4+ compatibility as per project requirements.
return static function (RectorConfig $rectorConfig): void {
// Paths Rector should analyze and refactor
$rectorConfig->paths([
__DIR__ . '/admin',
__DIR__ . '/src',
__DIR__ . '/views',
__DIR__ . '/uninstall.php',
__DIR__ . '/wp-slimstat.php',
__DIR__ . '/index.php',
]);
// // Ensure Rector can autoload project classes and stubs
// $rectorConfig->autoloadPaths([
// __DIR__ . '/vendor/autoload.php',
// ]);
// Recommended sets - modernize to PHP 7.4 and apply quality/cleanup rules
$rectorConfig->sets([
LevelSetList::UP_TO_PHP_74,
// Safe sets only
SetList::CODE_QUALITY,
SetList::DEAD_CODE,
SetList::CODING_STYLE,
]);
// Auto-import class names where possible
$rectorConfig->importNames(true);
$rectorConfig->importShortClasses(false);
// Skip files and folders that should not be modified
$rectorConfig->skip([
__DIR__ . '/vendor',
__DIR__ . '/node_modules',
__DIR__ . '/phpstan-cache',
__DIR__ . '/languages',
__DIR__ . '/src/Dependencies',
__DIR__ . '/src/symfony',
__DIR__ . '/rector.php',
]);
};