diff --git a/src/BetterPhpDocParser/PhpDocParser/DoctrineAnnotationDecorator.php b/src/BetterPhpDocParser/PhpDocParser/DoctrineAnnotationDecorator.php index 4c3c5e5927..5e7be1e51b 100644 --- a/src/BetterPhpDocParser/PhpDocParser/DoctrineAnnotationDecorator.php +++ b/src/BetterPhpDocParser/PhpDocParser/DoctrineAnnotationDecorator.php @@ -440,8 +440,8 @@ private function isClosedContent(string $composedContent): bool if ($composedTokenIterator->isCurrentTokenType( Lexer::TOKEN_OPEN_CURLY_BRACKET, Lexer::TOKEN_OPEN_PARENTHESES - ) || \str_starts_with($composedTokenIterator->currentTokenValue(), '{') - || \str_starts_with($composedTokenIterator->currentTokenValue(), '(') + ) || \str_contains($composedTokenIterator->currentTokenValue(), '{') + || \str_contains($composedTokenIterator->currentTokenValue(), '(') ) { ++$openBracketCount; } @@ -451,8 +451,8 @@ private function isClosedContent(string $composedContent): bool Lexer::TOKEN_CLOSE_CURLY_BRACKET, Lexer::TOKEN_CLOSE_PARENTHESES // sometimes it gets mixed int ") - ) || \str_ends_with($composedTokenIterator->currentTokenValue(), '}') - || \str_ends_with($composedTokenIterator->currentTokenValue(), ')')) { + ) || \str_contains($composedTokenIterator->currentTokenValue(), '}') + || \str_contains($composedTokenIterator->currentTokenValue(), ')')) { ++$closeBracketCount; } diff --git a/tests/Issues/InlineTags/Fixture/with_description.php.inc b/tests/Issues/InlineTags/Fixture/with_description.php.inc index bf6de99f75..3c01d41c71 100644 --- a/tests/Issues/InlineTags/Fixture/with_description.php.inc +++ b/tests/Issues/InlineTags/Fixture/with_description.php.inc @@ -3,7 +3,8 @@ use PHPUnit\Framework\TestCase; /** - * @copyright Example {@link https://example.com} some description + * @copyright Example {@link https://example.com}. Additional description. + * @todo Do this.{@link https://example.com}. * @covers \Tests\BarController */ class WithDescription extends TestCase @@ -17,7 +18,8 @@ class WithDescription extends TestCase use PHPUnit\Framework\TestCase; /** - * @copyright Example {@link https://example.com} some description + * @copyright Example {@link https://example.com}. Additional description. + * @todo Do this.{@link https://example.com}. */ #[\PHPUnit\Framework\Attributes\CoversClass(\Tests\BarController::class)] class WithDescription extends TestCase diff --git a/tests/Issues/InlineTags/Fixture/with_punctuation.inc b/tests/Issues/InlineTags/Fixture/with_punctuation.inc new file mode 100644 index 0000000000..0f6e4f7063 --- /dev/null +++ b/tests/Issues/InlineTags/Fixture/with_punctuation.inc @@ -0,0 +1,27 @@ + +----- +