[php-src] master: Allowed the use of formats like `@param array<>` (#18924)
Author: Saki Takamachi (SakiTakamachi)
Committer: GitHub (web-flow)
Pusher: SakiTakamachi
Date: 2025-06-25T18:36:20+09:00
Commit: https://github.com/php/php-src/commit/8b61c49987750b74bee19838c7f7c9fbbf53aace
Raw diff: https://github.com/php/php-src/commit/8b61c49987750b74bee19838c7f7c9fbbf53aace.diff
Allowed the use of formats like @param array<>
(#18924)
Changed paths:
M build/gen_stub.php
Diff:
diff --git a/build/gen_stub.php b/build/gen_stub.php
index d9327b67d042..a3dd14a56234 100755
--- a/build/gen_stub.php
+++ b/build/gen_stub.php
@@ -4533,7 +4533,7 @@ public function getVariableName(): string {
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);
}
Thread (1 message)
- Saki Takamachi via GitHub