Hi,
I am trying to run Rector in my Docker, to locate potential issues with the PHP8.2 upgrade. But I run into the following error: Class "SetList" not found.
I am starting rector using the following command from the root directory and the following configuration script:
php rector-0.18.2/bin/rector process --clear-cache --dry-run > php82.diff
rector.php file located in the root directory:
<?php
declare(strict_types=1);
use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector;
use Rector\Config\RectorConfig;
use Rector\Set\ValueObject\LevelSetList;
return static function (RectorConfig $rectorConfig): void {
$rectorConfig->paths([
__DIR__ . '/custom'
]);
// register a single rule
$rectorConfig->rule(InlineConstructorDefaultToPropertyRector::class);
$rectorConfig->sets([
LevelSetList::UP_TO_PHP_82,
SetList::PHP_82,
]);
$rectorConfig->skip([
\Rector\Php73\Rector\ConstFetch\SensitiveConstantNameRector::class,
\Rector\Php55\Rector\String_\StringClassNameToClassConstantRector::class,
\Rector\Php80\Rector\FunctionLike\UnionTypesRector::class,
\Rector\Php74\Rector\Closure\ClosureToArrowFunctionRector::class,
\Rector\Php80\Rector\FunctionLike\MixedTypeRector::class,
\Rector\Php81\Rector\Property\ReadOnlyPropertyRector::class,
\Rector\Php80\Rector\Catch_\RemoveUnusedVariableInCatchRector::class,
\Rector\TypeDeclaration\Rector\ClassMethod\ReturnNeverTypeRector::class,
\Rector\Php80\Rector\NotIdentical\StrContainsRector::class,
\Rector\Php80\Rector\Identical\StrEndsWithRector::class,
\Rector\Php80\Rector\Identical\StrStartsWithRector::class,
\Rector\TypeDeclaration\Rector\Property\TypedPropertyFromAssignsRector::class,
\Rector\Php80\Rector\Switch_\ChangeSwitchToMatchRector::class,
\Rector\Php80\Rector\Class_\ClassPropertyAssignToConstructorPromotionRector::class,
\Rector\Php81\Rector\ClassConst\FinalizePublicClassConstantRector::class,
\Rector\Php81\Rector\Array_\FirstClassCallableRector::class,
\Rector\Php80\Rector\FuncCall\TokenGetAllToObjectRector::class,
\Rector\Php81\Rector\ClassMethod\NewInInitializerRector::class,
\Rector\Php80\Rector\Class_\StringableForToStringRector::class,
\Rector\Php73\Rector\FuncCall\JsonThrowOnErrorRector::class,
\Rector\Php54\Rector\Array_\LongArrayToShortArrayRector::class,
\Rector\Php74\Rector\FuncCall\ArrayKeyExistsOnPropertyRector::class,
\Rector\Php81\Rector\FuncCall\NullToStrictStringFuncCallArgRector::class,
\Rector\Php74\Rector\FuncCall\ArraySpreadInsteadOfArrayMergeRector::class,
\Rector\Php80\Rector\FuncCall\ClassOnObjectRector::class,
\Rector\Php80\Rector\ClassConstFetch\ClassOnThisVariableObjectRector::class,
\Rector\DeadCode\Rector\StaticCall\RemoveParentCallWithoutParentRector::class,
\Rector\Php82\Rector\New_\FilesystemIteratorSkipDotsRector::class,
\Rector\Php74\Rector\LNumber\AddLiteralSeparatorToNumberRector::class,
__DIR__ . '/include/SugarObjects/templates/file/views/view.edit.php',
]);
};
Does anyone have any idea what I am doing wrong?
Thanks in advance,
Stijn