Skip to content

Commit 14d8e84

Browse files
committed
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3: fix: Allow variadic syntax in PHPDoc parameter annotation in `gen_stub.php` (#20342)
2 parents 48b4289 + 09cb5ad commit 14d8e84

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
@@ -4087,7 +4087,7 @@ public function getType(): string {
40874087
$matches = [];
40884088

40894089
if ($this->name === "param") {
4090-
preg_match('/^\s*([\w\|\\\\\[\]<>, ]+)\s*(?:[{(]|\$\w+).*$/', $value, $matches);
4090+
preg_match('/^\s*([\w\|\\\\\[\]<>, ]+)\s*(?:[{(]|(\.\.\.)?\$\w+).*$/', $value, $matches);
40914091
} elseif ($this->name === "return" || $this->name === "var") {
40924092
preg_match('/^\s*([\w\|\\\\\[\]<>, ]+)/', $value, $matches);
40934093
}
@@ -4109,7 +4109,7 @@ public function getVariableName(): string {
41094109

41104110
if ($this->name === "param") {
41114111
// Allow for parsing extended types like callable(string):mixed in docblocks
4112-
preg_match('/^\s*(?<type>[\w\|\\\\]+(?<parens>\((?<inparens>(?:(?&parens)|[^(){}[\]]*+))++\)|\{(?&inparens)\}|\[(?&inparens)\])*+(?::(?&type))?)\s*\$(?<name>\w+).*$/', $value, $matches);
4112+
preg_match('/^\s*(?<type>[\w\|\\\\]+(?<parens>\((?<inparens>(?:(?&parens)|[^(){}[\]]*+))++\)|\{(?&inparens)\}|\[(?&inparens)\])*+(?::(?&type))?)\s*(\.\.\.)?\$(?<name>\w+).*$/', $value, $matches);
41134113
} elseif ($this->name === "prefer-ref") {
41144114
preg_match('/^\s*\$(?<name>\w+).*$/', $value, $matches);
41154115
}

0 commit comments

Comments
 (0)