mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
gen_stub: simplify FuncInfo::getFramelessDeclaration()
This commit is contained in:
parent
988da4c951
commit
49f1685cde
1 changed files with 5 additions and 11 deletions
|
@ -1482,27 +1482,21 @@ class FuncInfo {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$php84MinimumCompatibility = $this->minimumPhpVersionIdCompatibility === null || $this->minimumPhpVersionIdCompatibility >= PHP_84_VERSION_ID;
|
|
||||||
|
|
||||||
$code = '';
|
$code = '';
|
||||||
|
$infos = '';
|
||||||
if (!$php84MinimumCompatibility) {
|
|
||||||
$code .= "#if (PHP_VERSION_ID >= " . PHP_84_VERSION_ID . ")\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach ($this->framelessFunctionInfos as $framelessFunctionInfo) {
|
foreach ($this->framelessFunctionInfos as $framelessFunctionInfo) {
|
||||||
$code .= "ZEND_FRAMELESS_FUNCTION({$this->name->getFunctionName()}, {$framelessFunctionInfo->arity});\n";
|
$code .= "ZEND_FRAMELESS_FUNCTION({$this->name->getFunctionName()}, {$framelessFunctionInfo->arity});\n";
|
||||||
|
$infos .= "\t{ ZEND_FRAMELESS_FUNCTION_NAME({$this->name->getFunctionName()}, {$framelessFunctionInfo->arity}), {$framelessFunctionInfo->arity} },\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
$code .= 'static const zend_frameless_function_info ' . $this->getFramelessFunctionInfosName() . "[] = {\n";
|
$code .= 'static const zend_frameless_function_info ' . $this->getFramelessFunctionInfosName() . "[] = {\n";
|
||||||
foreach ($this->framelessFunctionInfos as $framelessFunctionInfo) {
|
$code .= $infos;
|
||||||
$code .= "\t{ ZEND_FRAMELESS_FUNCTION_NAME({$this->name->getFunctionName()}, {$framelessFunctionInfo->arity}), {$framelessFunctionInfo->arity} },\n";
|
|
||||||
}
|
|
||||||
$code .= "\t{ 0 },\n";
|
$code .= "\t{ 0 },\n";
|
||||||
$code .= "};\n";
|
$code .= "};\n";
|
||||||
|
|
||||||
|
$php84MinimumCompatibility = $this->minimumPhpVersionIdCompatibility === null || $this->minimumPhpVersionIdCompatibility >= PHP_84_VERSION_ID;
|
||||||
if (!$php84MinimumCompatibility) {
|
if (!$php84MinimumCompatibility) {
|
||||||
$code .= "#endif\n";
|
return "#if (PHP_VERSION_ID >= " . PHP_84_VERSION_ID . ")\n$code#endif\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
return $code;
|
return $code;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue