Skip to content

Commit

Permalink
Made debug output for arrow functions clearer (ref #2523)
Browse files Browse the repository at this point in the history
  • Loading branch information
gsherwood committed Nov 10, 2019
1 parent 5b42dc7 commit c1d30ce
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Tokenizers/PHP.php
Original file line number Diff line number Diff line change
Expand Up @@ -1692,7 +1692,7 @@ protected function processAdditional()
if ($scopeCloser !== $numTokens) {
if (PHP_CODESNIFFER_VERBOSITY > 1) {
$line = $this->tokens[$i]['line'];
echo "\t* token $i on line $line processed as arrow function".PHP_EOL;
echo "\t=> token $i on line $line processed as arrow function".PHP_EOL;
}

$this->tokens[$i]['code'] = T_FN;
Expand All @@ -1718,6 +1718,11 @@ protected function processAdditional()
$closer = $this->tokens[$i]['parenthesis_closer'];
$this->tokens[$opener]['parenthesis_owner'] = $i;
$this->tokens[$closer]['parenthesis_owner'] = $i;

if (PHP_CODESNIFFER_VERBOSITY > 1) {
$line = $this->tokens[$arrow]['line'];
echo "\t\t* token $arrow on line $line changed from T_DOUBLE_ARROW to T_FN_ARROW".PHP_EOL;
}
}//end if
}//end if
}//end if
Expand Down

0 comments on commit c1d30ce

Please sign in to comment.