@@ -561,22 +561,25 @@ private function createNativeMethodVariant(
561561 ?Type $ phpDocReturnType
562562 ): FunctionVariantWithPhpDocs
563563 {
564+ $ parameters = [];
565+ foreach ($ methodSignature ->getParameters () as $ parameterSignature ) {
566+ $ parameters [] = new NativeParameterWithPhpDocsReflection (
567+ $ parameterSignature ->getName (),
568+ $ parameterSignature ->isOptional (),
569+ $ stubPhpDocParameterTypes [$ parameterSignature ->getName ()] ?? $ parameterSignature ->getType (),
570+ $ stubPhpDocParameterTypes [$ parameterSignature ->getName ()] ?? new MixedType (),
571+ new MixedType (true ), // todo
572+ $ parameterSignature ->passedByReference (),
573+ $ stubPhpDocParameterVariadicity [$ parameterSignature ->getName ()] ?? $ parameterSignature ->isVariadic (),
574+ null ,
575+ isset ($ stubPhpDocParameterTypes [$ parameterSignature ->getName ()])
576+ );
577+ }
578+
564579 return new FunctionVariantWithPhpDocs (
565580 TemplateTypeMap::createEmpty (),
566581 null ,
567- array_map (static function (ParameterSignature $ parameterSignature ) use ($ stubPhpDocParameterTypes , $ stubPhpDocParameterVariadicity ): NativeParameterWithPhpDocsReflection {
568- return new NativeParameterWithPhpDocsReflection (
569- $ parameterSignature ->getName (),
570- $ parameterSignature ->isOptional (),
571- $ stubPhpDocParameterTypes [$ parameterSignature ->getName ()] ?? $ parameterSignature ->getType (),
572- $ stubPhpDocParameterTypes [$ parameterSignature ->getName ()] ?? new MixedType (),
573- new MixedType (true ), // todo
574- $ parameterSignature ->passedByReference (),
575- $ stubPhpDocParameterVariadicity [$ parameterSignature ->getName ()] ?? $ parameterSignature ->isVariadic (),
576- null ,
577- isset ($ stubPhpDocParameterTypes [$ parameterSignature ->getName ()])
578- );
579- }, $ methodSignature ->getParameters ()),
582+ $ parameters ,
580583 $ methodSignature ->isVariadic (),
581584 $ phpDocReturnType ?? $ methodSignature ->getReturnType (),
582585 $ phpDocReturnType ?? new MixedType (),
0 commit comments