1
0
Fork 0

Fixed setting a variable inside an IF

pull/247/head
Ivan Bozhanov 2017-01-26 19:03:08 +02:00
parent 66634a4045
commit faf7b12d47
1 changed files with 2 additions and 1 deletions

View File

@ -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);
}