Skip to content
Permalink
Browse files

Fix #2547 - use better conditional check

  • Loading branch information
muglug committed Jan 11, 2020
1 parent bd84612 commit 7b887efc2c68666935773240d039b6009b2d73a2
Showing with 10 additions and 0 deletions.
  1. +10 −0 src/Psalm/Internal/Visitor/ReflectorVisitor.php
@@ -536,6 +536,16 @@ public function enterNode(PhpParser\Node $node)
)
) {
$this->exists_cond_expr = $node->cond->left;
} elseif ($node->cond instanceof PhpParser\Node\Expr\BinaryOp\BooleanAnd
&& $node->cond->right instanceof PhpParser\Node\Expr\FuncCall
&& $node->cond->right->name instanceof PhpParser\Node\Name
&& (
$node->cond->right->name->parts === ['function_exists']
|| $node->cond->right->name->parts === ['class_exists']
|| $node->cond->right->name->parts === ['interface_exists']
)
) {
$this->exists_cond_expr = $node->cond->right;
}
}

0 comments on commit 7b887ef

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