@@ -1060,6 +1060,10 @@ public function getDeclarationClassName(): string {
10601060 return implode ('_ ' , $ this ->className ->getParts ());
10611061 }
10621062
1063+ public function getDeclarationName (): string {
1064+ return "{$ this ->getDeclarationClassName ()}_ {$ this ->methodName }" ;
1065+ }
1066+
10631067 public function getDeclaration (): string {
10641068 return "ZEND_METHOD( {$ this ->getDeclarationClassName ()}, $ this ->methodName ); \n" ;
10651069 }
@@ -1068,6 +1072,10 @@ public function getArgInfoName(): string {
10681072 return "arginfo_class_ {$ this ->getDeclarationClassName ()}_ {$ this ->methodName }" ;
10691073 }
10701074
1075+ public function getFramelessFunctionInfosName (): string {
1076+ return "frameless_function_infos_ {$ this ->className }_ {$ this ->methodName }" ;
1077+ }
1078+
10711079 public function getMethodSynopsisFilename (): string
10721080 {
10731081 $ parts = [...$ this ->className ->getParts (), ltrim ($ this ->methodName , '_ ' )];
@@ -1331,12 +1339,12 @@ public function getFramelessDeclaration(): ?string {
13311339 }
13321340
13331341 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" ;
13351343 }
13361344
13371345 $ code .= 'static const zend_frameless_function_info ' . $ this ->getFramelessFunctionInfosName () . "[] = { \n" ;
13381346 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" ;
13401348 }
13411349 $ code .= "\t{ 0 }, \n" ;
13421350 $ code .= "}; \n" ;
@@ -1362,10 +1370,10 @@ public function getFunctionEntry(): string {
13621370 $ functionEntryCode = null ;
13631371
13641372 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 ' );
13671375 }
1368- if ($ this ->name ->getNamespace ()) {
1376+ if (! $ this -> isMethod () && $ this ->name ->getNamespace ()) {
13691377 throw new Exception ('Namespaced direct calls to frameless functions are not supported yet ' );
13701378 }
13711379 if ($ this ->alias ) {
0 commit comments