diff --git a/src/TokenRunner/Transformer/FixerTransformer/TokensNewliner.php b/src/TokenRunner/Transformer/FixerTransformer/TokensNewliner.php index 140dfedcb..95780d4bd 100644 --- a/src/TokenRunner/Transformer/FixerTransformer/TokensNewliner.php +++ b/src/TokenRunner/Transformer/FixerTransformer/TokensNewliner.php @@ -50,7 +50,7 @@ public function breakItems(BlockInfo $blockInfo, Tokens $tokens, int $kind): voi ); // again, from the bottom to the top - for ($i = $blockInfo->getEnd() - 1; $i > $blockInfo->getStart(); --$i) { + for ($i = $blockInfo->getEnd() - 1; $i >= $blockInfo->getStart(); --$i) { /** @var Token $currentToken */ $currentToken = $tokens[$i]; diff --git a/tests/Fixer/Spacing/StandaloneLinePromotedPropertyFixer/Fixture/promoted_property.php.inc b/tests/Fixer/Spacing/StandaloneLinePromotedPropertyFixer/Fixture/promoted_property.php.inc new file mode 100644 index 000000000..4ea325bb1 --- /dev/null +++ b/tests/Fixer/Spacing/StandaloneLinePromotedPropertyFixer/Fixture/promoted_property.php.inc @@ -0,0 +1,27 @@ + +----- +