Allowed the use of formats like @param array<> (#18924)

This commit is contained in:
Saki Takamachi 2025-06-25 18:36:20 +09:00 committed by GitHub
parent aab281546c
commit 8b61c49987
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

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