mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Allowed the use of formats like @param array<> (#18924)
This commit is contained in:
@@ -4533,7 +4533,7 @@ class DocCommentTag {
|
||||
|
||||
if ($this->name === "param") {
|
||||
// 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") {
|
||||
preg_match('/^\s*\$(?<name>\w+).*$/', $value, $matches);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user