Skip to content

Commit 7d8596e

Browse files
committed
Fix method/parameter confusion
1 parent edab2e4 commit 7d8596e

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

src/TargetMethodParameter.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,20 @@
99
*/
1010
final class TargetMethodParameter
1111
{
12-
1312
/**
1413
* @param T $attribute
1514
* @param class-string $class
1615
* The name of the target class.
17-
* @param non-empty-string $name
18-
* The name of the target parameter.
1916
* @param non-empty-string $method
2017
* The name of the target method.
18+
* @param non-empty-string $name
19+
* The name of the target parameter.
2120
*/
2221
public function __construct(
2322
public object $attribute,
2423
public string $class,
25-
public string $name,
2624
public string $method,
25+
public string $name,
2726
) {
2827
}
2928
}

src/TransientCollectionRenderer.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,17 +59,17 @@ private static function targetsToArray(iterable $targetByClass): array
5959
foreach ($targets as $t) {
6060
$a = [ $t->arguments, $class ];
6161

62+
if ($t instanceof TransientTargetMethodParameter) {
63+
$a[] = $t->method;
64+
}
65+
6266
if ($t instanceof TransientTargetMethod
6367
|| $t instanceof TransientTargetProperty
6468
|| $t instanceof TransientTargetMethodParameter
6569
) {
6670
$a[] = $t->name;
6771
}
6872

69-
if ($t instanceof TransientTargetMethodParameter) {
70-
$a[] = $t->method;
71-
}
72-
7373
$by[$t->attribute][] = $a;
7474
}
7575
}

0 commit comments

Comments
 (0)