Skip to content

Commit

Permalink
SpaceAfterSemicolonFixer - loop over all tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
SpacePossum committed Jul 4, 2018
1 parent 012b1e2 commit 9675267
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Fixer/Semicolon/SpaceAfterSemicolonFixer.php
Expand Up @@ -113,6 +113,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens)
)
) {
$tokens->insertAt($index + 1, new Token([T_WHITESPACE, ' ']));
++$max;
}

continue;
Expand Down
24 changes: 24 additions & 0 deletions tests/Fixer/Semicolon/SpaceAfterSemicolonFixerTest.php
Expand Up @@ -258,6 +258,30 @@ public function provideFixCases()
}
',
],
[
'<?php if ($a):?>
1
<?php endif; ?>
<?php if ($b):?>
2
<?php endif; ?>
<?php if ($c):?>
3
<?php endif; ?>',
'<?php if ($a):?>
1
<?php endif;?>
<?php if ($b):?>
2
<?php endif;?>
<?php if ($c):?>
3
<?php endif;?>',
],
[
'<?php echo 1; ; ; ; ; ; ; ; ;',
'<?php echo 1;;;;;;;;;',
],
];
}

Expand Down

0 comments on commit 9675267

Please sign in to comment.