Skip to content

Commit

Permalink
bug #3866 SpaceAfterSemicolonFixer - loop over all tokens (SpacePossum)
Browse files Browse the repository at this point in the history
This PR was squashed before being merged into the 2.12 branch (closes #3866).

Discussion
----------

SpaceAfterSemicolonFixer - loop over all tokens

closes #3856

Commits
-------

9675267 SpaceAfterSemicolonFixer - loop over all tokens
  • Loading branch information
SpacePossum committed Jul 4, 2018
2 parents a008ddb + 9675267 commit 3a1ddb6
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 3a1ddb6

Please sign in to comment.