Skip to content

Commit dedd083

Browse files
committed
Fix "\u{...}" char overflow in parser
1 parent d8c3e18 commit dedd083

5 files changed

Lines changed: 8 additions & 8 deletions

File tree

‎README.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
</a>
44

55
<p align="center">
6-
<a href="https://packagist.org/packages/type-lang/phpdoc"><img src="https://poser.pugx.org/type-lang/phpdoc/require/php?style=for-the-badge" alt="PHP 8.4+"></a>
6+
<a href="https://packagist.org/packages/type-lang/phpdoc"><img src="https://poser.pugx.org/type-lang/phpdoc/require/php?style=for-the-badge" alt="PHP 8.1+"></a>
77
<a href="https://packagist.org/packages/type-lang/phpdoc"><img src="https://poser.pugx.org/type-lang/phpdoc/version?style=for-the-badge" alt="Latest Stable Version"></a>
88
<a href="https://packagist.org/packages/type-lang/phpdoc"><img src="https://poser.pugx.org/type-lang/phpdoc/v/unstable?style=for-the-badge" alt="Latest Unstable Version"></a>
99
<a href="https://raw.githubusercontent.com/php-type-language/phpdoc/blob/master/LICENSE"><img src="https://poser.pugx.org/type-lang/phpdoc/license?style=for-the-badge" alt="License MIT"></a>
@@ -38,7 +38,7 @@ comment's description and tags:
3838
```php
3939
use TypeLang\PhpDoc\DocBlockParser;
4040

41-
$parser = new DocBlockParser();
41+
$parser = DocBlockParser::createDefault();
4242

4343
$block = $parser->parse(<<<'PHPDOC'
4444
/**
@@ -52,7 +52,7 @@ $block = $parser->parse(<<<'PHPDOC'
5252

5353
// The leading description (everything before the first tag)
5454
echo $block->description;
55-
// "Sends a notification to the given recipient."
55+
// "Sends a notification to the given recipient.\n"
5656

5757
// Tags form an ordered, countable, iterable collection
5858
echo \count($block); // 3

‎src/DocBlock/Description/TaggedDescription.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ final class TaggedDescription implements
2222
{
2323
/**
2424
* Gets a list of {@see ComponentInterface} components that make up the
25-
* {@see TaggedDescriptionInterface} in the order in which these
25+
* {@see TaggedDescription} in the order in which these
2626
* elements are defined.
2727
*
2828
* @var list<ComponentInterface>

‎src/DocBlock/DocBlock.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* Represents a parsed DocBlock comment.
1212
*
1313
* A structured view over the two logical parts of any documentation block:
14-
* An instance of description and an ordered set of ta
14+
* the description and an ordered list of tags.
1515
*
1616
* The object is a read-only, IMMUTABLE value. It is a snapshot of a comment
1717
* and never mutates. It additionally behaves as a collection of its tags, so
@@ -137,7 +137,7 @@ public function getIterator(): \Traversable
137137
* Returns the number of tags contained in the comment.
138138
*
139139
* The value is always non-negative and equals the number of entries
140-
* exposed by {@see DocBlockInterface::$tags}.
140+
* exposed by {@see DocBlock::$tags}.
141141
*
142142
* ```
143143
* $count = \count($block); // e.g. 4

‎src/Parser/Splitter/SplitterInterface.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ interface SplitterInterface
1717
* the returned section, relative to the beginning.
1818
*
1919
* ```
20-
* $result = $parser->parse(<<<'DOC'
20+
* $result = $splitter->split(<<<'DOC'
2121
* /**
2222
* * Example line 1
2323
* *

‎src/Platform/PlatformInterface.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
use TypeLang\PhpDoc\Parser\Grammar\CombinatorInterface;
99

1010
/**
11-
* A platform contributes a named set of tags, aliases and combinators to the
11+
* A platform contributes a set of tags, aliases and combinators to the
1212
* parser.
1313
*
1414
* A platform is self-contained: its aliases point to its own tags, and its tags

0 commit comments

Comments
 (0)