From faf7b12d47a49675c75c65710ba3e1f914bc51b8 Mon Sep 17 00:00:00 2001 From: Ivan Bozhanov Date: Thu, 26 Jan 2017 19:03:08 +0200 Subject: [PATCH] Fixed setting a variable inside an IF --- src/DefinitionResolver.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/DefinitionResolver.php b/src/DefinitionResolver.php index a7ab566..55160f1 100644 --- a/src/DefinitionResolver.php +++ b/src/DefinitionResolver.php @@ -483,7 +483,8 @@ class DefinitionResolver if ($expr instanceof Node\Expr\MethodCall) { $fqn .= '()'; } - if ($def = $this->index->getDefinition($fqn)) { + $def = $this->index->getDefinition($fqn); + if ($def !== null) { if ($def->type instanceof Types\This || $def->type instanceof Types\Self_) { return $this->resolveExpressionNodeToType($expr->var); }