1
0
mirror of https://github.com/danog/PHP-Parser.git synced 2024-11-27 04:14:44 +01:00

Remove unused variables (#357)

This commit is contained in:
Matthew Brown 2017-02-11 05:05:36 -05:00 committed by Nikita Popov
parent 54b61ebe7c
commit 9857a545e2
3 changed files with 2 additions and 3 deletions

View File

@ -157,7 +157,7 @@ class Lexer
$filePos = 0;
$line = 1;
foreach ($this->tokens as $i => $token) {
foreach ($this->tokens as $token) {
$tokenValue = \is_string($token) ? $token : $token[1];
$tokenLen = \strlen($tokenValue);

View File

@ -72,7 +72,6 @@ class Emulative extends \PhpParser\Lexer
// the tokens array on the way
$line = 1;
for ($i = 0, $c = count($this->tokens); $i < $c; ++$i) {
$replace = null;
if (isset($this->tokens[$i + 1])) {
if ($this->tokens[$i] === '?' && $this->tokens[$i + 1] === '?') {
array_splice($this->tokens, $i, 2, array(

View File

@ -462,7 +462,7 @@ abstract class PrettyPrinterAbstract
$result = '';
$pos = $startPos;
foreach ($node->getSubNodeNames() as $i => $subNodeName) {
foreach ($node->getSubNodeNames() as $subNodeName) {
$subNode = $node->$subNodeName;
$origSubNode = $origNode->$subNodeName;