@@ -22,15 +22,15 @@ final class Collection
2222 * @param array<class-string, array<array{ mixed[], class-string, non-empty-string }>> $targetProperties
2323 * Where _key_ is an attribute class and _value_ an array of arrays
2424 * where 0 are the attribute arguments, 1 is a target class, and 2 is the target property.
25- * @param array<class-string, array<array{ mixed[], class-string, non-empty-string, non-empty-string }>> $targetMethodParameters
25+ * @param array<class-string, array<array{ mixed[], class-string, non-empty-string, non-empty-string }>> $targetParameters
2626 * Where _key_ is an attribute class and _value_ an array of arrays where 0 are the
2727 * attribute arguments, 1 is a target class, 2 is the target method, and 3 is the target parameter.
2828 */
2929 public function __construct (
3030 private array $ targetClasses ,
3131 private array $ targetMethods ,
3232 private array $ targetProperties ,
33- private array $ targetMethodParameters ,
33+ private array $ targetParameters ,
3434 ) {
3535 }
3636
@@ -118,13 +118,13 @@ private static function createMethodAttribute(
118118 *
119119 * @param class-string<T> $attribute
120120 *
121- * @return array<TargetMethodParameter <T>>
121+ * @return array<TargetParameter <T>>
122122 */
123- public function findTargetMethodParameters (string $ attribute ): array
123+ public function findTargetParameters (string $ attribute ): array
124124 {
125125 return array_map (
126- fn (array $ t ) => self ::createMethodParameterAttribute ($ attribute , ...$ t ),
127- $ this ->targetMethodParameters [$ attribute ] ?? [],
126+ fn (array $ t ) => self ::createParameterAttribute ($ attribute , ...$ t ),
127+ $ this ->targetParameters [$ attribute ] ?? [],
128128 );
129129 }
130130
@@ -137,9 +137,9 @@ public function findTargetMethodParameters(string $attribute): array
137137 * @param non-empty-string $method
138138 * @param non-empty-string $parameter
139139 *
140- * @return TargetMethodParameter <T>
140+ * @return TargetParameter <T>
141141 */
142- private static function createMethodParameterAttribute (
142+ private static function createParameterAttribute (
143143 string $ attribute ,
144144 array $ arguments ,
145145 string $ class ,
@@ -148,7 +148,7 @@ private static function createMethodParameterAttribute(
148148 ): object {
149149 try {
150150 $ a = new $ attribute (...$ arguments );
151- return new TargetMethodParameter ($ a , $ class , $ method , $ parameter );
151+ return new TargetParameter ($ a , $ class , $ method , $ parameter );
152152 } catch (Throwable $ e ) {
153153 throw new RuntimeException (
154154 "An error occurred while instantiating attribute $ attribute on parameter $ class:: $ method( $ parameter) " ,
@@ -247,16 +247,16 @@ public function filterTargetMethods(callable $predicate): array
247247 /**
248248 * @param callable(class-string $attribute, class-string $class, non-empty-string $method, non-empty-string $parameter):bool $predicate
249249 *
250- * @return array<TargetMethodParameter <object>>
250+ * @return array<TargetParameter <object>>
251251 */
252- public function filterTargetMethodParameters (callable $ predicate ): array
252+ public function filterTargetParameters (callable $ predicate ): array
253253 {
254254 $ ar = [];
255255
256- foreach ($ this ->targetMethodParameters as $ attribute => $ references ) {
256+ foreach ($ this ->targetParameters as $ attribute => $ references ) {
257257 foreach ($ references as [$ arguments , $ class , $ method , $ parameter ]) {
258258 if ($ predicate ($ attribute , $ class , $ method , $ parameter )) {
259- $ ar [] = self ::createMethodParameterAttribute (
259+ $ ar [] = self ::createParameterAttribute (
260260 $ attribute ,
261261 $ arguments ,
262262 $ class ,
0 commit comments