Skip to content

Commit 5535741

Browse files
committed
Add support for the never type in gen_stub.php
1 parent 6d805ed commit 5535741

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

build/gen_stub.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ public static function fromPhpDoc(string $type): SimpleType
154154
case "resource":
155155
case "mixed":
156156
case "static":
157+
case "never":
157158
return new SimpleType(strtolower($type), true);
158159
case "self":
159160
throw new Exception('The exact class name must be used instead of "self"');
@@ -205,6 +206,8 @@ public function toTypeCode(): string {
205206
return "IS_MIXED";
206207
case "static":
207208
return "IS_STATIC";
209+
case "never":
210+
return "IS_NEVER";
208211
default:
209212
throw new Exception("Not implemented: $this->name");
210213
}
@@ -235,6 +238,8 @@ public function toTypeMask() {
235238
return "MAY_BE_ANY";
236239
case "static":
237240
return "MAY_BE_STATIC";
241+
case "never":
242+
return "MAY_BE_NEVER";
238243
default:
239244
throw new Exception("Not implemented: $this->name");
240245
}

0 commit comments

Comments
 (0)