Skip to content

Commit e6627cc

Browse files
authored
gen_stub: fix regexps with unintentional range due to - character placement (#12004)
1 parent 807a05e commit e6627cc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

build/gen_stub.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ public static function fromString(string $typeString): SimpleType
272272
}
273273

274274
$matches = [];
275-
$isArray = preg_match("/array\s*<\s*([A-Za-z0-9_-|]+)?(\s*,\s*)?([A-Za-z0-9_-|]+)?\s*>/i", $typeString, $matches);
275+
$isArray = preg_match("/array\s*<\s*([A-Za-z0-9_|-]+)?(\s*,\s*)?([A-Za-z0-9_|-]+)?\s*>/i", $typeString, $matches);
276276
if ($isArray) {
277277
if (empty($matches[1]) || empty($matches[3])) {
278278
throw new Exception("array<> type hint must have both a key and a value");

0 commit comments

Comments
 (0)