Skip to content

Commit

Permalink
Merge pull request #6068 from caugner/make-ClassLikeNodeScanner-resil…
Browse files Browse the repository at this point in the history
…ient-against-missing-class-storage

Make ClassLikeNodeScanner resilient against missing class storage
  • Loading branch information
weirdan authored Jul 11, 2021
2 parents ad3d46c + c6ccf61 commit d1f894a
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,11 @@ public function start(PhpParser\Node\Stmt\ClassLike $node): ?bool
$storage->aliases = $this->aliases;

foreach ($storage->dependent_classlikes as $dependent_name_lc => $_) {
$dependent_storage = $this->codebase->classlike_storage_provider->get($dependent_name_lc);
try {
$dependent_storage = $this->codebase->classlike_storage_provider->get($dependent_name_lc);
} catch (\InvalidArgumentException $exception) {
continue;
}
$dependent_storage->populated = false;
$this->codebase->classlike_storage_provider->makeNew($dependent_name_lc);
}
Expand Down

0 comments on commit d1f894a

Please sign in to comment.