Skip to content

Commit

Permalink
Temporary restore keep comment feature on before @\ with auto import (#…
Browse files Browse the repository at this point in the history
…5280)

* Temporary restore keep comment feature on before @\ with auto import

* cs

* temporary removed

* temporary removed

* link
  • Loading branch information
samsonasik committed Nov 23, 2023
1 parent 1b12d62 commit 520829e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -165,14 +165,11 @@ private function processTextSpacelessInTextNode(
return;
}

$otherText = Strings::replace($phpDocTextNode->text, self::LONG_ANNOTATION_REGEX, '');
if (! in_array($otherText, ["\n", ""], true)) {
$phpDocNode->children[$key] = new PhpDocTextNode($otherText);
array_splice($phpDocNode->children, $key + 1, 0, $spacelessPhpDocTagNodes);
} else {
unset($phpDocNode->children[$key]);
array_splice($phpDocNode->children, $key, 0, $spacelessPhpDocTagNodes);
}
// temporary restore keep comment feature to avoid error
// in nested annotation
// @see https://github.com/rectorphp/rector-src/pull/5280#pullrequestreview-1745794426
unset($phpDocNode->children[$key]);
array_splice($phpDocNode->children, $key, 0, $spacelessPhpDocTagNodes);
}

private function transformGenericTagValueNodesToDoctrineAnnotationTagValueNodes(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ use Symfony\Component\Routing\Annotation\Route;
class TwoRoutesWithCommentBefore
{
/**
* Testsssssssssss
* @Route("/first", methods={"GET"})
* @Route("/second", methods={"GET"})
*/
Expand Down

0 comments on commit 520829e

Please sign in to comment.