Skip to content

Commit 7aefbb2

Browse files
committed
NoExtraBlankLinesFixer - fix candidate detection
1 parent a0769f9 commit 7aefbb2

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/Fixer/Whitespace/NoExtraBlankLinesFixer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ private function fixByToken(Token $token, $index)
362362

363363
private function removeBetweenUse($index)
364364
{
365-
$next = $this->tokens->getNextTokenOfKind($index, [';', T_CLOSE_TAG]);
365+
$next = $this->tokens->getNextTokenOfKind($index, [';', [T_CLOSE_TAG]]);
366366
if (null === $next || $this->tokens[$next]->isGivenKind(T_CLOSE_TAG)) {
367367
return;
368368
}

tests/Fixer/Whitespace/NoExtraBlankLinesFixerTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,8 @@ public function provideBetweenUseCases()
512512
['<?php use A\B;'],
513513
['<?php use A\B?>'],
514514
['<?php use A\B;use A\D; return 1;'],
515+
["<?php use A\\B?>\n\n<?php use D\\E\\F?>"],
516+
['<?php use Y\B;use A\D; return 1;'],
515517
[
516518
'<?php
517519
use A\B;

0 commit comments

Comments
 (0)