Skip to content

Commit bb5f3b9

Browse files
committed
Merge remote-tracking branch 'origin/1.23.x' into 2.0.x
2 parents bdfec7c + 7e92a25 commit bb5f3b9

File tree

4 files changed

+40
-5
lines changed

4 files changed

+40
-5
lines changed

.github/workflows/apiref.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
run: "composer install --no-interaction --no-progress"
3737

3838
- name: "Run ApiGen"
39-
run: "apigen/vendor/bin/apigen -c apigen/apigen.neon --output docs -- src"
39+
run: "apigen/vendor/bin/apigen -c apigen/apigen.neon --output docs/${{ github.ref_name }} -- src"
4040

4141
- name: "Copy favicon"
4242
run: "cp apigen/favicon.png docs/favicon.png"

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ For the complete list of supported PHPDoc features check out PHPStan documentati
1313

1414
* [PHPDoc Basics](https://phpstan.org/writing-php-code/phpdocs-basics) (list of PHPDoc tags)
1515
* [PHPDoc Types](https://phpstan.org/writing-php-code/phpdoc-types) (list of PHPDoc types)
16-
* [phpdoc-parser API Reference](https://phpstan.github.io/phpdoc-parser/namespace-PHPStan.PhpDocParser.html) with all the AST node types etc.
16+
* [phpdoc-parser API Reference](https://phpstan.github.io/phpdoc-parser/2.0.x/namespace-PHPStan.PhpDocParser.html) with all the AST node types etc.
1717

18-
This parser also supports parsing [Doctrine Annotations](https://github.com/doctrine/annotations). The AST nodes live in the [PHPStan\PhpDocParser\Ast\PhpDoc\Doctrine namespace](https://phpstan.github.io/phpdoc-parser/namespace-PHPStan.PhpDocParser.Ast.PhpDoc.Doctrine.html). The support needs to be turned on by setting `bool $parseDoctrineAnnotations` to `true` in `Lexer` and `PhpDocParser` class constructors.
18+
This parser also supports parsing [Doctrine Annotations](https://github.com/doctrine/annotations). The AST nodes live in the [PHPStan\PhpDocParser\Ast\PhpDoc\Doctrine namespace](https://phpstan.github.io/phpdoc-parser/2.0.x/namespace-PHPStan.PhpDocParser.Ast.PhpDoc.Doctrine.html). The support needs to be turned on by setting `bool $parseDoctrineAnnotations` to `true` in `Lexer` and `PhpDocParser` class constructors.
1919

2020
## Installation
2121

src/Parser/PhpDocParser.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ private function parseText(TokenIterator $tokens): Ast\PhpDoc\PhpDocTextNode
207207
$text .= $tmpText;
208208

209209
// stop if we're not at EOL - meaning it's the end of PHPDoc
210-
if (!$tokens->isCurrentTokenType(Lexer::TOKEN_PHPDOC_EOL)) {
210+
if (!$tokens->isCurrentTokenType(Lexer::TOKEN_PHPDOC_EOL, Lexer::TOKEN_CLOSE_PHPDOC)) {
211211
break;
212212
}
213213

@@ -263,7 +263,7 @@ private function parseOptionalDescriptionAfterDoctrineTag(TokenIterator $tokens)
263263
$text .= $tmpText;
264264

265265
// stop if we're not at EOL - meaning it's the end of PHPDoc
266-
if (!$tokens->isCurrentTokenType(Lexer::TOKEN_PHPDOC_EOL)) {
266+
if (!$tokens->isCurrentTokenType(Lexer::TOKEN_PHPDOC_EOL, Lexer::TOKEN_CLOSE_PHPDOC)) {
267267
if (!$tokens->isPrecededByHorizontalWhitespace()) {
268268
return trim($text . $this->parseText($tokens)->text, " \t");
269269
}

tests/PHPStan/Parser/PhpDocParserTest.php

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7297,6 +7297,41 @@ public function dataTextBetweenTagsBelongsToDescription(): iterable
72977297
new PhpDocTagNode('@package', new GenericTagValueNode('foo')),
72987298
]),
72997299
];
7300+
7301+
yield [
7302+
'/** @deprecated in Drupal 8.6.0 and will be removed before Drupal 9.0.0. In
7303+
* Drupal 9 there will be no way to set the status and in Drupal 8 this
7304+
* ability has been removed because mb_*() functions are supplied using
7305+
* Symfony\'s polyfill. */',
7306+
new PhpDocNode([
7307+
new PhpDocTagNode(
7308+
'@deprecated',
7309+
new DeprecatedTagValueNode('in Drupal 8.6.0 and will be removed before Drupal 9.0.0. In
7310+
Drupal 9 there will be no way to set the status and in Drupal 8 this
7311+
ability has been removed because mb_*() functions are supplied using
7312+
Symfony\'s polyfill.')
7313+
),
7314+
]),
7315+
];
7316+
7317+
yield [
7318+
'/** @\ORM\Column() in Drupal 8.6.0 and will be removed before Drupal 9.0.0. In
7319+
* Drupal 9 there will be no way to set the status and in Drupal 8 this
7320+
* ability has been removed because mb_*() functions are supplied using
7321+
* Symfony\'s polyfill. */',
7322+
new PhpDocNode([
7323+
new PhpDocTagNode(
7324+
'@\ORM\Column',
7325+
new DoctrineTagValueNode(
7326+
new DoctrineAnnotation('@\ORM\Column', []),
7327+
'in Drupal 8.6.0 and will be removed before Drupal 9.0.0. In
7328+
Drupal 9 there will be no way to set the status and in Drupal 8 this
7329+
ability has been removed because mb_*() functions are supplied using
7330+
Symfony\'s polyfill.'
7331+
)
7332+
),
7333+
]),
7334+
];
73007335
}
73017336

73027337
/**

0 commit comments

Comments
 (0)