@@ -51,6 +51,23 @@ public function processNode(Node $node, Scope $scope): array
51
51
$ parts [] = sprintf ('#[%s(%s)] ' , $ attribute ->getName (), implode (', ' , $ args ));
52
52
}
53
53
54
+ foreach ($ reflection ->getParameters () as $ parameter ) {
55
+ $ parameterAttributes = [];
56
+ foreach ($ parameter ->getAttributes () as $ parameterAttribute ) {
57
+ $ parameterArgs = [];
58
+ foreach ($ parameterAttribute ->getArgumentTypes () as $ argName => $ argType ) {
59
+ $ parameterArgs [] = sprintf ('%s: %s ' , $ argName , $ argType ->describe (VerbosityLevel::precise ()));
60
+ }
61
+ $ parameterAttributes [] = sprintf ('#[%s(%s)] ' , $ parameterAttribute ->getName (), implode (', ' , $ parameterArgs ));
62
+ }
63
+
64
+ if (count ($ parameterAttributes ) === 0 ) {
65
+ continue ;
66
+ }
67
+
68
+ $ parts [] = sprintf ('$%s: %s ' , $ parameter ->getName (), implode (', ' , $ parameterAttributes ));
69
+ }
70
+
54
71
if (count ($ parts ) === 0 ) {
55
72
return [];
56
73
}
@@ -71,7 +88,7 @@ public function testRule(): void
71
88
72
89
$ this ->analyse ([__DIR__ . '/data/attribute-reflection.php ' ], [
73
90
[
74
- '#[AttributeReflectionTest\MyAttr(one: 7, two: 8)] ' ,
91
+ '#[AttributeReflectionTest\MyAttr(one: 7, two: 8)], $test: #[AttributeReflectionTest\MyAttr(one: 9, two: 10)] ' ,
75
92
28 ,
76
93
],
77
94
[
0 commit comments