diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2019-08-09 14:33:59 +0200 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2019-08-09 14:51:25 +0200 |
commit | 3b2f2ce4748328fc696cd3d27887bf61e22ca023 (patch) | |
tree | 349c1673fafd88f006afc123d46cd78f003d87fd /scripts | |
parent | 33886f710cd45fd883d85558197e2df4eaba9ea1 (diff) | |
download | php-git-3b2f2ce4748328fc696cd3d27887bf61e22ca023.tar.gz |
Make uninitialized DateTime an Error
This avoids many spurious false return values.
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/dev/gen_stub.php | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/scripts/dev/gen_stub.php b/scripts/dev/gen_stub.php index 9a71e7db82..59b7d448f6 100755 --- a/scripts/dev/gen_stub.php +++ b/scripts/dev/gen_stub.php @@ -199,7 +199,7 @@ function parseClass(Stmt\Class_ $class): ClassInfo { $className = $class->name->toString(); foreach ($class as $stmt) { if (!$stmt instanceof Stmt\ClassMethod) { - throw new Exception("Not implemented"); + throw new Exception("Not implemented class statement"); } $funcs[] = parseFunctionLike($className . '_' . $stmt->name->toString(), $stmt); @@ -230,7 +230,7 @@ function parseStubFile(string $fileName) { $text = trim($comment->getText()); if (preg_match('/^#if\s+(.+)$/', $text, $matches)) { if ($cond !== null) { - throw new Exception("Not implemented"); + throw new Exception("Not implemented preprocessor directive"); } $cond = $matches[1]; } else if ($text === '#endif') { @@ -284,7 +284,11 @@ function funcInfoToCode(FuncInfo $funcInfo): string { $returnType->toTypeCode(), $returnType->isNullable ); } else { - throw new Exception("Not implemented"); + $code .= sprintf( + "ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_%s, %d, %d, %s, %d)\n", + $funcInfo->name, $funcInfo->return->byRef, $funcInfo->numRequiredArgs, + $returnType->name, $returnType->isNullable + ); } } else { $code .= sprintf( |