@@ -162,7 +162,6 @@ private function getParameterTypeFromDocComment(ReflectionParameter $parameter):
162162
163163 $ pattern = '/@param(.*)\$ ' . $ parameter ->getName () . '\W/ ' ;
164164
165- /** @var list<array{string}> $matches */
166165 preg_match_all ($ pattern , $ docComment , $ matches , PREG_SET_ORDER );
167166
168167 if (count ($ matches ) === 0 ) {
@@ -186,6 +185,7 @@ private function getParameterTypeFromDocComment(ReflectionParameter $parameter):
186185 }
187186
188187 $ type = preg_replace ('/(^\s+)|(\s+$)/ ' , '' , $ type );
188+ assert ($ type !== null );
189189
190190 if ($ type === '' ) {
191191 throw new JsonMapperException (sprintf (
@@ -208,6 +208,7 @@ private function getParameterTypeFromDocComment(ReflectionParameter $parameter):
208208
209209 return $ this ->createUnionType (
210210 array_map (
211+ // @phpstan-ignore argument.type
211212 fn (string |array $ value ) => $ this ->convertDocCommentType ($ value , $ parameter ),
212213 $ parsedType ,
213214 ),
@@ -232,6 +233,7 @@ private function convertDocCommentType(string|array $type, ReflectionParameter $
232233 return new ArrayType (
233234 $ this ->createUnionType (
234235 array_map (
236+ // @phpstan-ignore argument.type
235237 fn (string |array $ type ) => $ this ->convertDocCommentType ($ type , $ reflectionParameter ),
236238 $ type ,
237239 ),
@@ -252,7 +254,7 @@ private function getParameterTypeFromReflection(ReflectionType $type, Reflection
252254 if ($ type instanceof ReflectionUnionType) {
253255 return $ this ->createUnionType (
254256 array_map (
255- function (ReflectionNamedType |ReflectionIntersectionType $ type ) use ($ reflectionParameter ): SimpleType |ClassType |EnumType | ArrayType {
257+ function (ReflectionNamedType |ReflectionIntersectionType $ type ) use ($ reflectionParameter ): SimpleType |ClassType |EnumType {
256258 if ($ type instanceof ReflectionIntersectionType) {
257259 $ this ->throwOnIntersectionType ($ reflectionParameter );
258260 }
@@ -375,7 +377,7 @@ private function convertNamedType(string $namedType, bool $isReflection, Reflect
375377 );
376378 }
377379
378- /** @psalm- var class-string $namedType */
380+ /** @var class-string $namedType */
379381 return new Type \ClassType ($ namedType );
380382 }
381383
0 commit comments