Skip to content

Commit

Permalink
Merge branch 'feature/file-isreference-simplify-logic' of https://git…
Browse files Browse the repository at this point in the history
  • Loading branch information
gsherwood committed Sep 7, 2020
2 parents 674cb96 + 76fce40 commit db9089d
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions src/Files/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -1981,19 +1981,7 @@ public function isReference($stackPtr)
) {
$params = $this->getMethodParameters($this->tokens[$lastBracket]['parenthesis_owner']);
foreach ($params as $param) {
$varToken = $tokenAfter;
if ($param['variable_length'] === true) {
$varToken = $this->findNext(
(Util\Tokens::$emptyTokens + [T_ELLIPSIS]),
($stackPtr + 1),
null,
true
);
}

if ($param['token'] === $varToken
&& $param['pass_by_reference'] === true
) {
if ($param['reference_token'] === $stackPtr) {
// Function parameter declared to be passed by reference.
return true;
}
Expand Down

0 comments on commit db9089d

Please sign in to comment.