mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
gen_stub: simplify generateFunctionEntries()
This commit is contained in:
parent
30c8480a39
commit
15547a2eb1
1 changed files with 2 additions and 8 deletions
|
@ -5321,19 +5321,13 @@ function generateFunctionEntries(?Name $className, array $funcInfos, ?string $co
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
$code = "\n";
|
|
||||||
|
|
||||||
if ($cond) {
|
|
||||||
$code .= "#if {$cond}\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
$functionEntryName = "ext_functions";
|
$functionEntryName = "ext_functions";
|
||||||
if ($className) {
|
if ($className) {
|
||||||
$underscoreName = implode("_", $className->getParts());
|
$underscoreName = implode("_", $className->getParts());
|
||||||
$functionEntryName = "class_{$underscoreName}_methods";
|
$functionEntryName = "class_{$underscoreName}_methods";
|
||||||
}
|
}
|
||||||
|
|
||||||
$code .= "static const zend_function_entry {$functionEntryName}[] = {\n";
|
$code = "\nstatic const zend_function_entry {$functionEntryName}[] = {\n";
|
||||||
$code .= generateCodeWithConditions($funcInfos, "", static function (FuncInfo $funcInfo) {
|
$code .= generateCodeWithConditions($funcInfos, "", static function (FuncInfo $funcInfo) {
|
||||||
return $funcInfo->getFunctionEntry();
|
return $funcInfo->getFunctionEntry();
|
||||||
}, $cond);
|
}, $cond);
|
||||||
|
@ -5341,7 +5335,7 @@ function generateFunctionEntries(?Name $className, array $funcInfos, ?string $co
|
||||||
$code .= "};\n";
|
$code .= "};\n";
|
||||||
|
|
||||||
if ($cond) {
|
if ($cond) {
|
||||||
$code .= "#endif\n";
|
$code = "\n#if {$cond}{$code}#endif\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
return $code;
|
return $code;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue