Skip to content

Commit 110e6e4

Browse files
committed
Make gen_stub.php compatible with PHP 7.1 again
Not worth bumping requirements over this...
1 parent 177c455 commit 110e6e4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

build/gen_stub.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -560,8 +560,8 @@ function parseDocComment(DocComment $comment): array {
560560
$tags = [];
561561
foreach (explode("\n", $commentText) as $commentLine) {
562562
$regex = '/^\*\s*@([a-z-]+)(?:\s+(.+))?$/';
563-
if (preg_match($regex, trim($commentLine), $matches, PREG_UNMATCHED_AS_NULL)) {
564-
$tags[] = new DocCommentTag($matches[1], $matches[2]);
563+
if (preg_match($regex, trim($commentLine), $matches)) {
564+
$tags[] = new DocCommentTag($matches[1], $matches[2] ?? null);
565565
}
566566
}
567567

0 commit comments

Comments
 (0)