forked from yllen/pdf
-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathrector.php
More file actions
102 lines (98 loc) · 4.88 KB
/
rector.php
File metadata and controls
102 lines (98 loc) · 4.88 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
<?php
/**
* -------------------------------------------------------------------------
* LICENSE
*
* This file is part of PDF plugin for GLPI.
*
* PDF is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* PDF is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Reports. If not, see <http://www.gnu.org/licenses/>.
*
* @author Nelly Mahu-Lasson, Remi Collet, Teclib
* @copyright Copyright (c) 2009-2022 PDF plugin team
* @copyright Copyright (C) 2018-2023 by Metabase plugin team.
* @license AGPL License 3.0 or (at your option) any later version
* @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
* @link https://github.com/pluginsGLPI/pdf/
* @link http://www.glpi-project.org/
* @link https://github.com/pluginsGLPI/metabase
* @package pdf
* @since 2009
* http://www.gnu.org/licenses/agpl-3.0-standalone.html
* --------------------------------------------------------------------------
*/
require_once __DIR__ . '/../../src/Plugin.php';
use Rector\Caching\ValueObject\Storage\FileCacheStorage;
use Rector\CodeQuality\Rector as CodeQuality;
use Rector\Config\RectorConfig;
use Rector\DeadCode\Rector as DeadCode;
use Rector\ValueObject\PhpVersion;
return RectorConfig::configure()
->withPaths([
__DIR__ . '/front',
__DIR__ . '/inc',
])
->withPhpVersion(PhpVersion::PHP_82)
->withCache(
cacheClass: FileCacheStorage::class,
cacheDirectory: sys_get_temp_dir() . '/metabase-rector',
)
->withRootFiles()
->withParallel(timeoutSeconds: 300)
->withImportNames(removeUnusedImports: true)
->withRules([
CodeQuality\Assign\CombinedAssignRector::class,
CodeQuality\BooleanAnd\RemoveUselessIsObjectCheckRector::class,
CodeQuality\BooleanAnd\SimplifyEmptyArrayCheckRector::class,
CodeQuality\BooleanNot\ReplaceMultipleBooleanNotRector::class,
CodeQuality\Catch_\ThrowWithPreviousExceptionRector::class,
CodeQuality\Empty_\SimplifyEmptyCheckOnEmptyArrayRector::class,
CodeQuality\Expression\InlineIfToExplicitIfRector::class,
CodeQuality\Expression\TernaryFalseExpressionToIfRector::class,
CodeQuality\For_\ForRepeatedCountToOwnVariableRector::class,
CodeQuality\Foreach_\ForeachItemsAssignToEmptyArrayToAssignRector::class,
CodeQuality\Foreach_\ForeachToInArrayRector::class,
CodeQuality\Foreach_\SimplifyForeachToCoalescingRector::class,
CodeQuality\Foreach_\UnusedForeachValueToArrayKeysRector::class,
CodeQuality\FuncCall\ChangeArrayPushToArrayAssignRector::class,
CodeQuality\FuncCall\CompactToVariablesRector::class,
CodeQuality\FuncCall\InlineIsAInstanceOfRector::class,
CodeQuality\FuncCall\IsAWithStringWithThirdArgumentRector::class,
CodeQuality\FuncCall\RemoveSoleValueSprintfRector::class,
CodeQuality\FuncCall\SetTypeToCastRector::class,
CodeQuality\FuncCall\SimplifyFuncGetArgsCountRector::class,
CodeQuality\FuncCall\SimplifyInArrayValuesRector::class,
CodeQuality\FuncCall\SimplifyStrposLowerRector::class,
CodeQuality\FuncCall\UnwrapSprintfOneArgumentRector::class,
CodeQuality\Identical\BooleanNotIdenticalToNotIdenticalRector::class,
CodeQuality\Identical\SimplifyArraySearchRector::class,
CodeQuality\Identical\SimplifyConditionsRector::class,
CodeQuality\Identical\StrlenZeroToIdenticalEmptyStringRector::class,
CodeQuality\If_\CombineIfRector::class,
CodeQuality\If_\CompleteMissingIfElseBracketRector::class,
CodeQuality\If_\ConsecutiveNullCompareReturnsToNullCoalesceQueueRector::class,
CodeQuality\If_\ExplicitBoolCompareRector::class,
CodeQuality\If_\ShortenElseIfRector::class,
CodeQuality\If_\SimplifyIfElseToTernaryRector::class,
CodeQuality\If_\SimplifyIfNotNullReturnRector::class,
CodeQuality\If_\SimplifyIfNullableReturnRector::class,
CodeQuality\If_\SimplifyIfReturnBoolRector::class,
CodeQuality\Include_\AbsolutizeRequireAndIncludePathRector::class,
CodeQuality\LogicalAnd\AndAssignsToSeparateLinesRector::class,
CodeQuality\LogicalAnd\LogicalToBooleanRector::class,
CodeQuality\NotEqual\CommonNotEqualRector::class,
CodeQuality\Ternary\UnnecessaryTernaryExpressionRector::class,
DeadCode\Assign\RemoveUnusedVariableAssignRector::class,
])
->withPhpSets(php74: true) // apply PHP sets up to PHP 7.4
;