mirror of
https://github.com/rectorphp/rector.git
synced 2025-02-24 11:44:14 +01:00
[cs] fix
This commit is contained in:
parent
2308e4ee8a
commit
ee3ef5b6c1
@ -201,6 +201,14 @@ final class DocBlockAnalyzer
|
||||
private function saveNewDocBlockToNode(Node $node, DocBlock $docBlock): void
|
||||
{
|
||||
$docContent = $this->tidingSerializer->getDocComment($docBlock);
|
||||
|
||||
// respect one-liners
|
||||
$originalDocCommentContent = $node->getDocComment()->getText();
|
||||
if (substr_count($originalDocCommentContent, PHP_EOL) <= 1) {
|
||||
$docContent = Strings::replace($docContent, '#\s+#', ' ');
|
||||
$docContent = Strings::replace($docContent, '#/\*\* #', '/*');
|
||||
}
|
||||
|
||||
$doc = new Doc($docContent);
|
||||
$node->setDocComment($doc);
|
||||
}
|
||||
|
@ -25,8 +25,8 @@ final class ValueObjectRemoverRectorTest extends AbstractRectorTestCase
|
||||
{
|
||||
return [
|
||||
[__DIR__ . '/Wrong/wrong.php.inc', __DIR__ . '/Correct/correct.php.inc'],
|
||||
// [__DIR__ . '/Wrong/wrong2.php.inc', __DIR__ . '/Correct/correct2.php.inc'],
|
||||
// [__DIR__ . '/Wrong/wrong3.php.inc', __DIR__ . '/Correct/correct3.php.inc'],
|
||||
[__DIR__ . '/Wrong/wrong2.php.inc', __DIR__ . '/Correct/correct2.php.inc'],
|
||||
[__DIR__ . '/Wrong/wrong3.php.inc', __DIR__ . '/Correct/correct3.php.inc'],
|
||||
];
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user