@@ -1060,6 +1060,10 @@ public function getDeclarationClassName(): string {
1060
1060
return implode ('_ ' , $ this ->className ->getParts ());
1061
1061
}
1062
1062
1063
+ public function getDeclarationName (): string {
1064
+ return "{$ this ->getDeclarationClassName ()}_ {$ this ->methodName }" ;
1065
+ }
1066
+
1063
1067
public function getDeclaration (): string {
1064
1068
return "ZEND_METHOD( {$ this ->getDeclarationClassName ()}, $ this ->methodName ); \n" ;
1065
1069
}
@@ -1068,6 +1072,10 @@ public function getArgInfoName(): string {
1068
1072
return "arginfo_class_ {$ this ->getDeclarationClassName ()}_ {$ this ->methodName }" ;
1069
1073
}
1070
1074
1075
+ public function getFramelessFunctionInfosName (): string {
1076
+ return "frameless_function_infos_ {$ this ->className }_ {$ this ->methodName }" ;
1077
+ }
1078
+
1071
1079
public function getMethodSynopsisFilename (): string
1072
1080
{
1073
1081
$ parts = [...$ this ->className ->getParts (), ltrim ($ this ->methodName , '_ ' )];
@@ -1331,12 +1339,12 @@ public function getFramelessDeclaration(): ?string {
1331
1339
}
1332
1340
1333
1341
foreach ($ this ->framelessFunctionInfos as $ framelessFunctionInfo ) {
1334
- $ code .= "ZEND_FRAMELESS_FUNCTION( {$ this ->name ->getFunctionName ()}, {$ framelessFunctionInfo ->arity }); \n" ;
1342
+ $ code .= "ZEND_FRAMELESS_FUNCTION( {$ this ->name ->getDeclarationName ()}, {$ framelessFunctionInfo ->arity }); \n" ;
1335
1343
}
1336
1344
1337
1345
$ code .= 'static const zend_frameless_function_info ' . $ this ->getFramelessFunctionInfosName () . "[] = { \n" ;
1338
1346
foreach ($ this ->framelessFunctionInfos as $ framelessFunctionInfo ) {
1339
- $ code .= "\t{ ZEND_FRAMELESS_FUNCTION_NAME( {$ this ->name ->getFunctionName ()}, {$ framelessFunctionInfo ->arity }), {$ framelessFunctionInfo ->arity } }, \n" ;
1347
+ $ code .= "\t{ ZEND_FRAMELESS_FUNCTION_NAME( {$ this ->name ->getDeclarationName ()}, {$ framelessFunctionInfo ->arity }), {$ framelessFunctionInfo ->arity } }, \n" ;
1340
1348
}
1341
1349
$ code .= "\t{ 0 }, \n" ;
1342
1350
$ code .= "}; \n" ;
@@ -1362,10 +1370,10 @@ public function getFunctionEntry(): string {
1362
1370
$ functionEntryCode = null ;
1363
1371
1364
1372
if (!empty ($ this ->framelessFunctionInfos )) {
1365
- if ($ this ->isMethod ()) {
1366
- throw new Exception ('Frameless methods are not supported yet ' );
1373
+ if ($ this ->isMethod () && !( $ this -> flags & Modifiers:: STATIC ) ) {
1374
+ throw new Exception ('Frameless methods must be static ' );
1367
1375
}
1368
- if ($ this ->name ->getNamespace ()) {
1376
+ if (! $ this -> isMethod () && $ this ->name ->getNamespace ()) {
1369
1377
throw new Exception ('Namespaced direct calls to frameless functions are not supported yet ' );
1370
1378
}
1371
1379
if ($ this ->alias ) {
0 commit comments