Skip to content

Commit 7634d3a

Browse files
committed
[Rector] Using LevelSetList::UP_TO_PHP_73
1 parent fe5037d commit 7634d3a

2 files changed

Lines changed: 20 additions & 2 deletions

File tree

rector.php

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,16 @@
3737
use Rector\EarlyReturn\Rector\If_\ChangeIfElseValueAssignToEarlyReturnRector;
3838
use Rector\EarlyReturn\Rector\If_\RemoveAlwaysElseRector;
3939
use Rector\EarlyReturn\Rector\Return_\PreparedValueToEarlyReturnRector;
40+
use Rector\Php55\Rector\String_\StringClassNameToClassConstantRector;
41+
use Rector\Php56\Rector\FunctionLike\AddDefaultValueForUndefinedVariableRector;
42+
use Rector\Php70\Rector\FuncCall\RandomFunctionRector;
4043
use Rector\Php70\Rector\Ternary\TernaryToNullCoalescingRector;
44+
use Rector\Php71\Rector\FuncCall\CountOnNullRector;
4145
use Rector\Php71\Rector\FuncCall\RemoveExtraParametersRector;
4246
use Rector\Php71\Rector\List_\ListToArrayDestructRector;
4347
use Rector\Php73\Rector\FuncCall\JsonThrowOnErrorRector;
4448
use Rector\Php73\Rector\FuncCall\StringifyStrNeedlesRector;
49+
use Rector\Set\ValueObject\LevelSetList;
4550
use Rector\Set\ValueObject\SetList;
4651
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
4752
use Utils\Rector\PassStrictParameterToFunctionParameterRector;
@@ -51,7 +56,7 @@
5156

5257
return static function (ContainerConfigurator $containerConfigurator): void {
5358
$containerConfigurator->import(SetList::DEAD_CODE);
54-
$containerConfigurator->import(SetList::PHP_73);
59+
$containerConfigurator->import(LevelSetList::UP_TO_PHP_73);
5560

5661
$parameters = $containerConfigurator->parameters();
5762

@@ -95,6 +100,19 @@
95100
UnderscoreToCamelCaseVariableNameRector::class => [
96101
__DIR__ . '/system/Session/Handlers',
97102
],
103+
104+
// may cause load view files directly when detecting class that
105+
// make warning
106+
StringClassNameToClassConstantRector::class,
107+
108+
// sometime too detail
109+
CountOnNullRector::class,
110+
111+
// may not be unitialized on purpose
112+
AddDefaultValueForUndefinedVariableRector::class,
113+
114+
// use mt_rand instead of random_int on purpose on non-cryptographically random
115+
RandomFunctionRector::class,
98116
]);
99117

100118
// auto import fully qualified class names

tests/system/Autoloader/FileLocatorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ public function testFindQNameFromPathWithoutCorrespondingNamespace()
261261
public function testGetClassNameFromClassFile()
262262
{
263263
$this->assertSame(
264-
__CLASS__,
264+
self::class,
265265
$this->locator->getClassname(__FILE__)
266266
);
267267
}

0 commit comments

Comments
 (0)