@@ -5376,7 +5376,7 @@ private function processPropertyHooks(
53765376 $ this ->callNodeCallback ($ nodeCallback , $ hook , $ scope , $ storage );
53775377 $ this ->processAttributeGroups ($ stmt , $ hook ->attrGroups , $ scope , $ storage , $ nodeCallback );
53785378
5379- [, $ phpDocParameterTypes ,,,, $ phpDocThrowType ,,,,,,,, $ phpDocComment ] = $ this ->getPhpDocs ($ scope , $ hook );
5379+ [, $ phpDocParameterTypes ,,,, $ phpDocThrowType ,,,,,,,, $ phpDocComment,,,,,, $ resolvedPhpDoc ] = $ this ->getPhpDocs ($ scope , $ hook );
53805380
53815381 foreach ($ hook ->params as $ param ) {
53825382 $ this ->processParamNode ($ stmt , $ param , $ scope , $ storage , $ nodeCallback );
@@ -5394,6 +5394,7 @@ private function processPropertyHooks(
53945394 $ deprecatedDescription ,
53955395 $ isDeprecated ,
53965396 $ phpDocComment ,
5397+ $ resolvedPhpDoc ,
53975398 );
53985399 $ hookReflection = $ hookScope ->getFunction ();
53995400 if (!$ hookReflection instanceof PhpMethodFromParserNodeReflection) {
@@ -7266,7 +7267,7 @@ private function processNodesForCalledMethod($node, ExpressionResultStorage $sto
72667267 }
72677268
72687269 /**
7269- * @return array{TemplateTypeMap, array<string, Type>, array<string, bool>, array<string, Type>, ?Type, ?Type, ?string, bool, bool, bool, bool|null, bool, bool, string|null, Assertions, ?Type, array<string, Type>, array<(string|int), VarTag>, bool}
7270+ * @return array{TemplateTypeMap, array<string, Type>, array<string, bool>, array<string, Type>, ?Type, ?Type, ?string, bool, bool, bool, bool|null, bool, bool, string|null, Assertions, ?Type, array<string, Type>, array<(string|int), VarTag>, bool, ?ResolvedPhpDocBlock }
72707271 */
72717272 public function getPhpDocs (Scope $ scope , Node \FunctionLike |Node \Stmt \Property $ node ): array
72727273 {
@@ -7309,12 +7310,20 @@ public function getPhpDocs(Scope $scope, Node\FunctionLike|Node\Stmt\Property $n
73097310
73107311 return $ param ->var ->name ;
73117312 }, $ node ->getParams ());
7313+ $ currentResolvedPhpDoc = null ;
7314+ if ($ docComment !== null ) {
7315+ $ currentResolvedPhpDoc = $ this ->fileTypeMapper ->getResolvedPhpDoc (
7316+ $ file ,
7317+ $ class ,
7318+ $ trait ,
7319+ $ node ->name ->name ,
7320+ $ docComment ,
7321+ );
7322+ }
73127323 $ resolvedPhpDoc = $ this ->phpDocInheritanceResolver ->resolvePhpDocForMethod (
7313- $ docComment ,
7314- $ file ,
73157324 $ scope ->getClassReflection (),
7316- $ trait ,
73177325 $ node ->name ->name ,
7326+ $ currentResolvedPhpDoc ,
73187327 $ positionalParameterNames ,
73197328 );
73207329
@@ -7416,16 +7425,17 @@ public function getPhpDocs(Scope $scope, Node\FunctionLike|Node\Stmt\Property $n
74167425 $ isPure = $ resolvedPhpDoc ->isPure ();
74177426 $ isAllowedPrivateMutation = $ resolvedPhpDoc ->isAllowedPrivateMutation ();
74187427 $ acceptsNamedArguments = $ resolvedPhpDoc ->acceptsNamedArguments ();
7419- if ($ acceptsNamedArguments && $ scope ->isInClass ()) {
7420- $ acceptsNamedArguments = $ scope ->getClassReflection ()->acceptsNamedArguments ();
7421- }
74227428 $ isReadOnly = $ isReadOnly || $ resolvedPhpDoc ->isReadOnly ();
74237429 $ asserts = Assertions::createFromResolvedPhpDocBlock ($ resolvedPhpDoc );
74247430 $ selfOutType = $ resolvedPhpDoc ->getSelfOutTag () !== null ? $ resolvedPhpDoc ->getSelfOutTag ()->getType () : null ;
74257431 $ varTags = $ resolvedPhpDoc ->getVarTags ();
74267432 }
74277433
7428- return [$ templateTypeMap , $ phpDocParameterTypes , $ phpDocImmediatelyInvokedCallableParameters , $ phpDocClosureThisTypeParameters , $ phpDocReturnType , $ phpDocThrowType , $ deprecatedDescription , $ isDeprecated , $ isInternal , $ isFinal , $ isPure , $ acceptsNamedArguments , $ isReadOnly , $ docComment , $ asserts , $ selfOutType , $ phpDocParameterOutTypes , $ varTags , $ isAllowedPrivateMutation ];
7434+ if ($ acceptsNamedArguments && $ scope ->isInClass ()) {
7435+ $ acceptsNamedArguments = $ scope ->getClassReflection ()->acceptsNamedArguments ();
7436+ }
7437+
7438+ return [$ templateTypeMap , $ phpDocParameterTypes , $ phpDocImmediatelyInvokedCallableParameters , $ phpDocClosureThisTypeParameters , $ phpDocReturnType , $ phpDocThrowType , $ deprecatedDescription , $ isDeprecated , $ isInternal , $ isFinal , $ isPure , $ acceptsNamedArguments , $ isReadOnly , $ docComment , $ asserts , $ selfOutType , $ phpDocParameterOutTypes , $ varTags , $ isAllowedPrivateMutation , $ resolvedPhpDoc ];
74297439 }
74307440
74317441 private function transformStaticType (ClassReflection $ declaringClass , Type $ type ): Type
0 commit comments