Skip to content

Commit ae179e4

Browse files
committed
Simplify
1 parent 4e5214b commit ae179e4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

build/gen_stub.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3323,12 +3323,12 @@ public function getType(): string {
33233323
$matches = [];
33243324

33253325
if ($this->name === "param") {
3326-
preg_match('/^\s*([\w\|\\\\\[\]<>, ]+)\s*(?<type>[{(]|(\.\.\.)?\$\w+).*$/', $value, $matches);
3326+
preg_match('/^\s*([\w\|\\\\\[\]<>, ]+)\s*([{(]|(\.\.\.)?\$\w+).*$/', $value, $matches);
33273327
} elseif ($this->name === "return" || $this->name === "var") {
3328-
preg_match('/^\s*(?<type>[\w\|\\\\\[\]<>, ]+)/', $value, $matches);
3328+
preg_match('/^\s*([\w\|\\\\\[\]<>, ]+)/', $value, $matches);
33293329
}
33303330

3331-
if (!isset($matches["type"])) {
3331+
if (!isset($matches[1])) {
33323332
throw new Exception("@$this->name doesn't contain a type or has an invalid format \"$value\"");
33333333
}
33343334

0 commit comments

Comments
 (0)