Skip to content

Commit 741ebec

Browse files
committed
Fix test failures for doc comments on declare nodes
1 parent 1884296 commit 741ebec

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/ASTConverter/ASTConverter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1896,13 +1896,13 @@ private static function phpParserDeclareListToAstDeclares(array $declares, int $
18961896
];
18971897
$doc_comment = self::extractPhpdocComment($declare->getAttribute('comments')) ?? $first_doc_comment;
18981898
$first_doc_comment = null;
1899-
if (self::$ast_version >= 45) {
1899+
if (self::$ast_version >= 50) {
19001900
if (PHP_VERSION_ID >= 70100) {
19011901
$children['docComment'] = $doc_comment;
19021902
}
19031903
}
19041904
$node = new ast\Node(ast\AST_CONST_ELEM, 0, $children, $declare->getAttribute('startLine'));
1905-
if (self::$ast_version < 45 && is_string($doc_comment)) {
1905+
if (self::$ast_version < 50 && is_string($doc_comment)) {
19061906
if (PHP_VERSION_ID >= 70100) {
19071907
$node->docComment = $doc_comment;
19081908
}

0 commit comments

Comments
 (0)