File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
src/main/QafooLabs/Refactoring/Adapters/PHPParser/Visitor Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -59,10 +59,15 @@ private function enterAssignment(Node\Expr\Assign $node)
59
59
$ this ->assignments [$ node ->var ->name ][] = $ node ->getLine ();
60
60
$ this ->seenAssignmentVariables ->attach ($ node ->var );
61
61
} else if ($ node ->var instanceof Node \Expr \ArrayDimFetch) {
62
+ // unfold $array[$var][$var]
63
+ $ var = $ node ->var ->var ;
64
+ while (!isset ($ var ->name )) {
65
+ $ var = $ var ->var ;
66
+ }
62
67
// $foo[] = "baz" is both a read and a write access to $foo
63
- $ this ->localVariables [$ node -> var -> var ->name ][] = $ node ->getLine ();
64
- $ this ->assignments [$ node -> var -> var ->name ][] = $ node ->getLine ();
65
- $ this ->seenAssignmentVariables ->attach ($ node -> var -> var );
68
+ $ this ->localVariables [$ var ->name ][] = $ node ->getLine ();
69
+ $ this ->assignments [$ var ->name ][] = $ node ->getLine ();
70
+ $ this ->seenAssignmentVariables ->attach ($ var );
66
71
}
67
72
}
68
73
You can’t perform that action at this time.
0 commit comments