@@ -1118,6 +1118,10 @@ public function getDeclarationClassName(): string {
1118
1118
return implode ('_ ' , $ this ->className ->getParts ());
1119
1119
}
1120
1120
1121
+ public function getDeclarationName (): string {
1122
+ return "{$ this ->getDeclarationClassName ()}_ {$ this ->methodName }" ;
1123
+ }
1124
+
1121
1125
public function getDeclaration (): string {
1122
1126
return "ZEND_METHOD( {$ this ->getDeclarationClassName ()}, $ this ->methodName ); \n" ;
1123
1127
}
@@ -1126,6 +1130,10 @@ public function getArgInfoName(): string {
1126
1130
return "arginfo_class_ {$ this ->getDeclarationClassName ()}_ {$ this ->methodName }" ;
1127
1131
}
1128
1132
1133
+ public function getFramelessFunctionInfosName (): string {
1134
+ return "frameless_function_infos_ {$ this ->className }_ {$ this ->methodName }" ;
1135
+ }
1136
+
1129
1137
public function getMethodSynopsisFilename (): string
1130
1138
{
1131
1139
$ parts = [...$ this ->className ->getParts (), ltrim ($ this ->methodName , '_ ' )];
@@ -1396,12 +1404,12 @@ public function getFramelessDeclaration(FuncInfo $funcInfo): ?string {
1396
1404
}
1397
1405
1398
1406
foreach ($ this ->framelessFunctionInfos as $ framelessFunctionInfo ) {
1399
- $ code .= "ZEND_FRAMELESS_FUNCTION( {$ this ->name ->getFunctionName ()}, {$ framelessFunctionInfo ->arity }); \n" ;
1407
+ $ code .= "ZEND_FRAMELESS_FUNCTION( {$ this ->name ->getDeclarationName ()}, {$ framelessFunctionInfo ->arity }); \n" ;
1400
1408
}
1401
1409
1402
1410
$ code .= 'static const zend_frameless_function_info ' . $ this ->getFramelessFunctionInfosName () . "[] = { \n" ;
1403
1411
foreach ($ this ->framelessFunctionInfos as $ framelessFunctionInfo ) {
1404
- $ code .= "\t{ ZEND_FRAMELESS_FUNCTION_NAME( {$ this ->name ->getFunctionName ()}, {$ framelessFunctionInfo ->arity }), {$ framelessFunctionInfo ->arity } }, \n" ;
1412
+ $ code .= "\t{ ZEND_FRAMELESS_FUNCTION_NAME( {$ this ->name ->getDeclarationName ()}, {$ framelessFunctionInfo ->arity }), {$ framelessFunctionInfo ->arity } }, \n" ;
1405
1413
}
1406
1414
$ code .= "\t{ 0 }, \n" ;
1407
1415
$ code .= "}; \n" ;
@@ -1427,10 +1435,10 @@ public function getFunctionEntry(): string {
1427
1435
$ functionEntryCode = null ;
1428
1436
1429
1437
if (!empty ($ this ->framelessFunctionInfos )) {
1430
- if ($ this ->isMethod ()) {
1431
- throw new Exception ('Frameless methods are not supported yet ' );
1438
+ if ($ this ->isMethod () && !( $ this -> flags & Modifiers:: STATIC ) ) {
1439
+ throw new Exception ('Frameless methods must be static ' );
1432
1440
}
1433
- if ($ this ->name ->getNamespace ()) {
1441
+ if (! $ this -> isMethod () && $ this ->name ->getNamespace ()) {
1434
1442
throw new Exception ('Namespaced direct calls to frameless functions are not supported yet ' );
1435
1443
}
1436
1444
if ($ this ->alias ) {
@@ -5161,7 +5169,7 @@ function findEquivalentFuncInfo(array $generatedFuncInfos, FuncInfo $funcInfo):
5161
5169
function generateCodeWithConditions(
5162
5170
iterable $infos, string $separator, Closure $codeGenerator, ?string $parentCond = null): string {
5163
5171
$code = "";
5164
-
5172
+
5165
5173
// For combining the conditional blocks of the infos with the same condition
5166
5174
$openCondition = null;
5167
5175
foreach ($infos as $info) {
0 commit comments