Skip to content

Commit

Permalink
[TypeDeclaration] Avoid error Rector\Core\Rector\AbstractRector::isOb…
Browse files Browse the repository at this point in the history
…jectType() must implement interface PhpParser\Node, null given on AddParamTypeDeclarationRector (#1239)
  • Loading branch information
samsonasik authored Nov 15, 2021
1 parent 8c31c3a commit 5154b53
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public function refactor(Node $node): ?Node
}

/** @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())) {
Expand Down

0 comments on commit 5154b53

Please sign in to comment.