@@ -398,7 +398,7 @@ private function processStmtNode(
398
398
$ hasYield = false ;
399
399
$ throwPoints = [];
400
400
$ this ->processAttributeGroups ($ stmt ->attrGroups , $ scope , $ nodeCallback );
401
- [$ templateTypeMap , $ phpDocParameterTypes , $ phpDocReturnType , $ phpDocThrowType , $ deprecatedDescription , $ isDeprecated , $ isInternal , $ isFinal , $ isPure ] = $ this ->getPhpDocs ($ scope , $ stmt );
401
+ [$ templateTypeMap , $ phpDocParameterTypes , $ phpDocReturnType , $ phpDocThrowType , $ deprecatedDescription , $ isDeprecated , $ isInternal , $ isFinal , $ isPure, $ acceptsNamedArguments ] = $ this ->getPhpDocs ($ scope , $ stmt );
402
402
403
403
foreach ($ stmt ->params as $ param ) {
404
404
$ this ->processParamNode ($ param , $ scope , $ nodeCallback );
@@ -419,6 +419,7 @@ private function processStmtNode(
419
419
$ isInternal ,
420
420
$ isFinal ,
421
421
$ isPure ,
422
+ $ acceptsNamedArguments ,
422
423
);
423
424
$ nodeCallback (new InFunctionNode ($ stmt ), $ functionScope );
424
425
@@ -453,7 +454,7 @@ private function processStmtNode(
453
454
$ hasYield = false ;
454
455
$ throwPoints = [];
455
456
$ this ->processAttributeGroups ($ stmt ->attrGroups , $ scope , $ nodeCallback );
456
- [$ templateTypeMap , $ phpDocParameterTypes , $ phpDocReturnType , $ phpDocThrowType , $ deprecatedDescription , $ isDeprecated , $ isInternal , $ isFinal , $ isPure ] = $ this ->getPhpDocs ($ scope , $ stmt );
457
+ [$ templateTypeMap , $ phpDocParameterTypes , $ phpDocReturnType , $ phpDocThrowType , $ deprecatedDescription , $ isDeprecated , $ isInternal , $ isFinal , $ isPure, $ acceptsNamedArguments ] = $ this ->getPhpDocs ($ scope , $ stmt );
457
458
458
459
foreach ($ stmt ->params as $ param ) {
459
460
$ this ->processParamNode ($ param , $ scope , $ nodeCallback );
@@ -474,6 +475,7 @@ private function processStmtNode(
474
475
$ isInternal ,
475
476
$ isFinal ,
476
477
$ isPure ,
478
+ $ acceptsNamedArguments ,
477
479
);
478
480
479
481
if ($ stmt ->name ->toLowerString () === '__construct ' ) {
@@ -637,7 +639,7 @@ private function processStmtNode(
637
639
638
640
foreach ($ stmt ->props as $ prop ) {
639
641
$ this ->processStmtNode ($ prop , $ scope , $ nodeCallback );
640
- [,,,,,,,,,$ isReadOnly , $ docComment ] = $ this ->getPhpDocs ($ scope , $ stmt );
642
+ [,,,,,,,,,, $ isReadOnly , $ docComment ] = $ this ->getPhpDocs ($ scope , $ stmt );
641
643
$ nodeCallback (
642
644
new ClassPropertyNode (
643
645
$ prop ->name ->toString (),
@@ -3828,7 +3830,7 @@ private function processNodesForTraitUse($node, ClassReflection $traitReflection
3828
3830
}
3829
3831
3830
3832
/**
3831
- * @return array{TemplateTypeMap, Type[], ?Type, ?Type, ?string, bool, bool, bool, bool|null, bool, string|null}
3833
+ * @return array{TemplateTypeMap, Type[], ?Type, ?Type, ?string, bool, bool, bool, bool|null, bool, bool, string|null}
3832
3834
*/
3833
3835
public function getPhpDocs (Scope $ scope , Node \FunctionLike |Node \Stmt \Property $ node ): array
3834
3836
{
@@ -3841,6 +3843,7 @@ public function getPhpDocs(Scope $scope, Node\FunctionLike|Node\Stmt\Property $n
3841
3843
$ isInternal = false ;
3842
3844
$ isFinal = false ;
3843
3845
$ isPure = false ;
3846
+ $ acceptsNamedArguments = true ;
3844
3847
$ isReadOnly = $ scope ->isInClass () && $ scope ->getClassReflection ()->isImmutable ();
3845
3848
$ docComment = $ node ->getDocComment () !== null
3846
3849
? $ node ->getDocComment ()->getText ()
@@ -3948,10 +3951,11 @@ public function getPhpDocs(Scope $scope, Node\FunctionLike|Node\Stmt\Property $n
3948
3951
$ isInternal = $ resolvedPhpDoc ->isInternal ();
3949
3952
$ isFinal = $ resolvedPhpDoc ->isFinal ();
3950
3953
$ isPure = $ resolvedPhpDoc ->isPure ();
3954
+ $ acceptsNamedArguments = $ resolvedPhpDoc ->acceptsNamedArguments ();
3951
3955
$ isReadOnly = $ isReadOnly || $ resolvedPhpDoc ->isReadOnly ();
3952
3956
}
3953
3957
3954
- return [$ templateTypeMap , $ phpDocParameterTypes , $ phpDocReturnType , $ phpDocThrowType , $ deprecatedDescription , $ isDeprecated , $ isInternal , $ isFinal , $ isPure , $ isReadOnly , $ docComment ];
3958
+ return [$ templateTypeMap , $ phpDocParameterTypes , $ phpDocReturnType , $ phpDocThrowType , $ deprecatedDescription , $ isDeprecated , $ isInternal , $ isFinal , $ isPure , $ acceptsNamedArguments , $ isReadOnly , $ docComment ];
3955
3959
}
3956
3960
3957
3961
private function transformStaticType (ClassReflection $ declaringClass , Type $ type ): Type
0 commit comments