Skip to content
Permalink
Browse files

Fix #1693 - use instanceof instead of assert

  • Loading branch information...
muglug committed May 27, 2019
1 parent 442c307 commit e512bc7ef6d61cc13507252dd7e1533954a8552d
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/Psalm/Internal/Analyzer/FunctionLike/ReturnTypeAnalyzer.php
@@ -744,9 +744,9 @@ private static function addOrUpdateReturnType(
$codebase = $project_analyzer->getCodebase();
$is_final = true;
$fqcln = $source->getFQCLN();
if ($fqcln !== null) {
if ($fqcln !== null && $function instanceof ClassMethod) {
$class_storage = $codebase->classlike_storage_provider->get($fqcln);
assert($function instanceof ClassMethod);
$is_final = $function->isFinal() || $class_storage->final;
}

1 comment on commit e512bc7

@iluuu1994

This comment has been minimized.

Copy link
Contributor

commented on e512bc7 May 27, 2019

Sorry, didn't know that could happen.

Please sign in to comment.
You can’t perform that action at this time.