@@ -244,8 +244,8 @@ final class NoUselessConcatOperatorFixer extends AbstractFixer implements Config
],
);
- $tokens->clearTokenAndMergeSurroundingWhitespace($secondOperand['start']);
$this->clearConcatAndAround($tokens, $concatOperatorIndex);
+ $tokens->clearTokenAndMergeSurroundingWhitespace($secondOperand['start']);
}
/**
@@ -160,6 +160,19 @@ line 2 indent" ?>',
;
",
];
+
+ yield 'concat without linebreak, followed by one with linebreak' => [
+ <<<'PHP'
+ <?php
+ $foo = 'ab'
+ . 'c';
+ PHP,
+ $foo = 'a' . 'b'
+ ];
public function testWithConfigJuggling(): void