From bf0f6aaf18895c979dcf61ecb26bdd58a238a69b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Kocsis?= Date: Mon, 15 Feb 2021 22:14:36 +0100 Subject: Improve class entry generation Related to GH-6701 --- build/gen_stub.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'build') 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; -- cgit v1.2.1