[TypeDeclaration] Avoid error Rector\Core\Rector\AbstractRector::isObjectType() must implement interface PhpParser\Node, null given on AddParamTypeDeclarationRector (#1239)

This commit is contained in:
Abdul Malik Ikhsan 2021-11-15 08:37:04 +07:00 committed by GitHub
parent 8c31c3a6b9
commit 5154b53518
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -91,7 +91,7 @@ CODE_SAMPLE
}
/** @var ClassLike $classLike */
$classLike = $this->betterNodeFinder->findParentType($node, Class_::class);
$classLike = $this->betterNodeFinder->findParentType($node, ClassLike::class);
foreach ($this->parameterTypehints as $parameterTypehint) {
if (! $this->isObjectType($classLike, $parameterTypehint->getObjectType())) {