I'm trying to run PHP Rector on a very old codebase to convert mysql_* calls into mysqli_* calls however it keeps failing with the following error:
In NodeTypeResolver.php line 129:
Look at "Rector\NodeTypeResolver\NodeTypeResolver::isObjectType()" on line 129
When I look at the NodeTypeResolver.php line 129 file it's throwing an exception:
if ($node instanceof \PhpParser\Node\Expr\ClassConstFetch) {
throw new \Rector\Core\Exception\ShouldNotHappenException();
}
Looking at the ShouldNotHappenException.php file it gives me no information at to what the possible problem could be. The name of the error message itself seems very cryptic.
My config is pretty basic as I'm only testing this at the moment to see if its viable:
return static function (ContainerConfigurator $containerConfigurator): void {
// get parameters
$parameters = $containerConfigurator->parameters();
// Define what rule sets will be applied
$containerConfigurator->import(SetList::MYSQL_TO_MYSQLI);
// get services (needed for register a single rule)
//$services = $containerConfigurator->services();
// register a single rule
//$services->set(TypedPropertyRector::class);
};
Does anyone have an idea of what's going on?
EDIT:
I should probably mention I tried a few different configs to run different things like $containerConfigurator->import(SetList::DEAD_CODE); and $containerConfigurator->import(SetList::CODE_QUALITY); and they run fine so it seems to a specific issue with SetList::MYSQL_TO_MYSQLI