summaryrefslogtreecommitdiff
path: root/scripts/dev/gen_stub.php
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/dev/gen_stub.php')
-rwxr-xr-xscripts/dev/gen_stub.php12
1 files changed, 10 insertions, 2 deletions
diff --git a/scripts/dev/gen_stub.php b/scripts/dev/gen_stub.php
index c6f9557fb4..253c188b2a 100755
--- a/scripts/dev/gen_stub.php
+++ b/scripts/dev/gen_stub.php
@@ -532,8 +532,7 @@ function funcInfoToCode(FuncInfo $funcInfo): string {
$argKind = $argInfo->isVariadic ? "ARG_VARIADIC" : "ARG";
$argType = $argInfo->type;
if ($argType !== null) {
- $simpleArgType = $argType->tryToSimpleType();
- if ($simpleArgType !== null) {
+ if (null !== $simpleArgType = $argType->tryToSimpleType()) {
if ($simpleArgType->isBuiltin) {
$code .= sprintf(
"\tZEND_%s_TYPE_INFO(%s, %s, %s, %d)\n",
@@ -547,6 +546,15 @@ function funcInfoToCode(FuncInfo $funcInfo): string {
$simpleArgType->toEscapedName(), $argType->isNullable()
);
}
+ } else if (null !== $representableType = $argType->tryToRepresentableType()) {
+ if ($representableType->classType !== null) {
+ throw new Exception('Unimplemented');
+ }
+ $code .= sprintf(
+ "\tZEND_%s_TYPE_MASK(%s, %s, %s)\n",
+ $argKind, $argInfo->getSendByString(), $argInfo->name,
+ $representableType->toTypeMask()
+ );
} else {
throw new Exception('Unimplemented');
}