forked from mautic/mautic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rector.php
35 lines (30 loc) · 1.41 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
<?php
declare(strict_types=1);
return static function (Rector\Config\RectorConfig $rectorConfig): void {
$rectorConfig->paths([__DIR__.'/app/bundles', __DIR__.'/plugins']);
$rectorConfig->skip(
[
__DIR__.'/*/test/*',
__DIR__.'/*/tests/*',
__DIR__.'/*/Test/*',
__DIR__.'/*/Tests/*',
__DIR__.'/*.html.php',
__DIR__.'/*.less.php',
__DIR__.'/*.inc.php',
__DIR__.'/*.js.php',
]
);
// Define what rule sets will be applied
// $rectorConfig->sets([\Rector\Set\ValueObject\SetList::DEAD_CODE]); // @todo implement the whole set. Start rule by rule bellow.
// Define what signle rules will be applied
$rectorConfig->rule(\Rector\DeadCode\Rector\BooleanAnd\RemoveAndTrueRector::class);
$rectorConfig->rule(\Rector\DeadCode\Rector\Stmt\RemoveUnreachableStatementRector::class);
$rectorConfig->rule(\Rector\DeadCode\Rector\ClassConst\RemoveUnusedPrivateClassConstantRector::class);
$rectorConfig->rule(\Rector\DeadCode\Rector\ClassMethod\RemoveUnusedPrivateMethodParameterRector::class);
// temp workaround to prevent rector to fail due to an undefined const.
// This doesn't make much sense, and is probably fixed in a more recent version of Rector.
if (!defined('MAUTIC_TABLE_PREFIX')) {
//set the table prefix before boot
define('MAUTIC_TABLE_PREFIX', '');
}
};