Skip to content

Commit

Permalink
Fix pass-by-reference check
Browse files Browse the repository at this point in the history
  • Loading branch information
wapmorgan committed Apr 27, 2018
1 parent 9c0b632 commit 9ccd8f1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions data/call_with_passing_by_reference.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ function call_with_passing_by_reference(array $usage_tokens, $function) {
$data = PhpCodeFixer::trimSpaces($data);

foreach ($data as $argI => $arg) {
if (isset($arg[0]) && $arg[0] === '&'
&& isset($data[$argI + 1]) && is_array($data[$argI + 1]) && $data[$argI + 1][0] === T_VARIABLE) {
return true;
if (isset($arg[0]) && $arg[0] === '&') {
if (isset($arg[1]) && is_array($arg[1]) && $arg[1][0] === T_VARIABLE) {
return true;
}
}
}

Expand Down

0 comments on commit 9ccd8f1

Please sign in to comment.