@@ -1270,7 +1270,7 @@ class FuncInfo {
1270
1270
/** @var ArgInfo[] */
1271
1271
public /* readonly */ array $ args ;
1272
1272
public /* readonly */ ReturnInfo $ return ;
1273
- public /* readonly */ int $ numRequiredArgs ;
1273
+ private /* readonly */ int $ numRequiredArgs ;
1274
1274
public /* readonly */ ?string $ cond ;
1275
1275
public bool $ isUndocumentable ;
1276
1276
private ?int $ minimumPhpVersionIdCompatibility ;
@@ -2228,6 +2228,21 @@ public function findEquivalent(array $generatedFuncInfos): ?FuncInfo {
2228
2228
return null ;
2229
2229
}
2230
2230
2231
+ public function toArgInfoCode (?int $ minPHPCompatability ): string {
2232
+ $ code = $ this ->return ->beginArgInfo (
2233
+ $ this ->getArgInfoName (),
2234
+ $ this ->numRequiredArgs ,
2235
+ $ minPHPCompatability === null || $ minPHPCompatability >= PHP_81_VERSION_ID
2236
+ );
2237
+
2238
+ foreach ($ this ->args as $ argInfo ) {
2239
+ $ code .= $ argInfo ->toZendInfo ();
2240
+ }
2241
+
2242
+ $ code .= "ZEND_END_ARG_INFO() " ;
2243
+ return $ code . "\n" ;
2244
+ }
2245
+
2231
2246
public function __clone ()
2232
2247
{
2233
2248
foreach ($ this ->args as $ key => $ argInfo ) {
@@ -5074,21 +5089,6 @@ protected function pName_FullyQualified(Name\FullyQualified $node): string {
5074
5089
return $ fileInfo ;
5075
5090
}
5076
5091
5077
- function funcInfoToCode (FileInfo $ fileInfo , FuncInfo $ funcInfo ): string {
5078
- $ code = $ funcInfo ->return ->beginArgInfo (
5079
- $ funcInfo ->getArgInfoName (),
5080
- $ funcInfo ->numRequiredArgs ,
5081
- $ fileInfo ->getMinimumPhpVersionIdCompatibility () === null || $ fileInfo ->getMinimumPhpVersionIdCompatibility () >= PHP_81_VERSION_ID
5082
- );
5083
-
5084
- foreach ($ funcInfo ->args as $ argInfo ) {
5085
- $ code .= $ argInfo ->toZendInfo ();
5086
- }
5087
-
5088
- $ code .= "ZEND_END_ARG_INFO() " ;
5089
- return $ code . "\n" ;
5090
- }
5091
-
5092
5092
/**
5093
5093
* @template T
5094
5094
* @param iterable<T> $infos
@@ -5168,7 +5168,7 @@ static function (FuncInfo $funcInfo) use (&$generatedFuncInfos, $fileInfo) {
5168
5168
$ funcInfo ->getArgInfoName (), $ generatedFuncInfo ->getArgInfoName ()
5169
5169
);
5170
5170
} else {
5171
- $ code = funcInfoToCode ($ fileInfo, $ funcInfo );
5171
+ $ code = $ funcInfo -> toArgInfoCode ($ fileInfo-> getMinimumPhpVersionIdCompatibility () );
5172
5172
}
5173
5173
5174
5174
$ generatedFuncInfos [] = $ funcInfo ;
0 commit comments