summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorMáté Kocsis <kocsismate@woohoolabs.com>2021-02-15 22:14:36 +0100
committerMáté Kocsis <kocsismate@woohoolabs.com>2021-02-16 13:09:56 +0100
commitbf0f6aaf18895c979dcf61ecb26bdd58a238a69b (patch)
tree830e0168c398c5ffc685e0cd39ccc2274244019c /build
parent1f04f162a6f9db6cc3019bb617062aa5e0d2101f (diff)
downloadphp-git-bf0f6aaf18895c979dcf61ecb26bdd58a238a69b.tar.gz
Improve class entry generation
Related to GH-6701
Diffstat (limited to 'build')
-rwxr-xr-xbuild/gen_stub.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/build/gen_stub.php b/build/gen_stub.php
index c036ec15d2..71fe1f4f18 100755
--- a/build/gen_stub.php
+++ b/build/gen_stub.php
@@ -1217,7 +1217,7 @@ class ClassInfo {
$escapedName = implode("_", $this->name->parts);
- $code = "zend_class_entry *register_class_$escapedName(" . implode(", ", $params) . ")\n";
+ $code = "static zend_class_entry *register_class_$escapedName(" . (empty($params) ? "void" : implode(", ", $params)) . ")\n";
$code .= "{\n";
$code .= "\tzend_class_entry ce, *class_entry;\n\n";
@@ -1260,7 +1260,7 @@ class ClassInfo {
$code .= "\n\treturn class_entry;\n";
- $code .= "}\n\n";
+ $code .= "}\n";
return $code;
}
@@ -1981,10 +1981,10 @@ function generateArgInfoCode(FileInfo $fileInfo, string $stubHash): string {
}
function generateClassEntryCode(FileInfo $fileInfo): string {
- $code = "\n";
+ $code = "";
foreach ($fileInfo->classInfos as $class) {
- $code .= $class->getRegistration();
+ $code .= "\n" . $class->getRegistration();
}
return $code;