1
0
Fork 0

Don't crash on array assignments

pull/60/merge
Felix Becker 2016-10-09 19:06:20 +02:00
parent 1689e4d0dc
commit aff9edb630
1 changed files with 1 additions and 1 deletions

View File

@ -525,7 +525,7 @@ class PhpDocument
} }
// Check each previous sibling node for a variable assignment to that variable // Check each previous sibling node for a variable assignment to that variable
while ($n->getAttribute('previousSibling') && $n = $n->getAttribute('previousSibling')) { while ($n->getAttribute('previousSibling') && $n = $n->getAttribute('previousSibling')) {
if ($n instanceof Node\Expr\Assign && $n->var->name === $var->name) { if ($n instanceof Node\Expr\Assign && $n->var instanceof Node\Expr\Variable && $n->var->name === $var->name) {
return $n; return $n;
} }
} }