@@ -226,20 +226,16 @@ public function getNamedArgumentsVariants(): ?array
226
226
*/
227
227
private function getParameters (): array
228
228
{
229
- if ($ this ->parameters === null ) {
230
- $ this ->parameters = array_map (fn (ReflectionParameter $ reflection ): PhpParameterReflection => new PhpParameterReflection (
231
- $ this ->initializerExprTypeResolver ,
232
- $ reflection ,
233
- $ this ->phpDocParameterTypes [$ reflection ->getName ()] ?? null ,
234
- $ this ->getDeclaringClass (),
235
- $ this ->phpDocParameterOutTypes [$ reflection ->getName ()] ?? null ,
236
- $ this ->immediatelyInvokedCallableParameters [$ reflection ->getName ()] ?? TrinaryLogic::createMaybe (),
237
- $ this ->phpDocClosureThisTypeParameters [$ reflection ->getName ()] ?? null ,
238
- $ this ->attributeReflectionFactory ->fromNativeReflection ($ reflection ->getAttributes (), InitializerExprContext::fromReflectionParameter ($ reflection )),
239
- ), $ this ->reflection ->getParameters ());
240
- }
241
-
242
- return $ this ->parameters ;
229
+ return $ this ->parameters ??= array_map (fn (ReflectionParameter $ reflection ): PhpParameterReflection => new PhpParameterReflection (
230
+ $ this ->initializerExprTypeResolver ,
231
+ $ reflection ,
232
+ $ this ->phpDocParameterTypes [$ reflection ->getName ()] ?? null ,
233
+ $ this ->getDeclaringClass (),
234
+ $ this ->phpDocParameterOutTypes [$ reflection ->getName ()] ?? null ,
235
+ $ this ->immediatelyInvokedCallableParameters [$ reflection ->getName ()] ?? TrinaryLogic::createMaybe (),
236
+ $ this ->phpDocClosureThisTypeParameters [$ reflection ->getName ()] ?? null ,
237
+ $ this ->attributeReflectionFactory ->fromNativeReflection ($ reflection ->getAttributes (), InitializerExprContext::fromReflectionParameter ($ reflection )),
238
+ ), $ this ->reflection ->getParameters ());
243
239
}
244
240
245
241
private function isVariadic (): bool
@@ -342,14 +338,10 @@ private function getPhpDocReturnType(): Type
342
338
343
339
private function getNativeReturnType (): Type
344
340
{
345
- if ($ this ->nativeReturnType === null ) {
346
- $ this ->nativeReturnType = TypehintHelper::decideTypeFromReflection (
347
- $ this ->reflection ->getReturnType (),
348
- selfClass: $ this ->declaringClass ,
349
- );
350
- }
351
-
352
- return $ this ->nativeReturnType ;
341
+ return $ this ->nativeReturnType ??= TypehintHelper::decideTypeFromReflection (
342
+ $ this ->reflection ->getReturnType (),
343
+ selfClass: $ this ->declaringClass ,
344
+ );
353
345
}
354
346
355
347
public function getDeprecatedDescription (): ?string
0 commit comments