Skip to content

Commit e2d33d7

Browse files
authored
Merge pull request #450 from bshaffer/exclude-escaped-closing-phpdoc-from-tags-parsing
fix: add escaped closing docblock to escaped sequences
2 parents b4e69b0 + 0e00c75 commit e2d33d7

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/DocBlock/DescriptionFactory.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,9 @@ private function lex(string $contents): array
100100

101101
return Utils::pregSplit(
102102
'/\{
103-
# "{@}" is not a valid inline tag. This ensures that we do not treat it as one, but treat it literally.
104-
(?!@\})
103+
# "{@}" and "{@*}" are not a valid inline tags. This ensures that we do not treat them as one, but treat
104+
# them literally.
105+
(?!(?:@\}|@\*\}) )
105106
# We want to capture the whole tag line, but without the inline tag delimiters.
106107
(\@
107108
# Match everything up to the next delimiter.

tests/unit/DocBlock/DescriptionFactoryTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ public function provideEscapeSequences(): array
245245
{
246246
return [
247247
['This is text for a description with a {@}.', 'This is text for a description with a @.'],
248+
['This is text for a description with a {@*}.', 'This is text for a description with a {@*}.'],
248249
['This is text for a description with a {}.', 'This is text for a description with a }.'],
249250
];
250251
}

0 commit comments

Comments
 (0)