The doc comment array<string, array<class-string>> at position 6 could not be parsed: Unknown type name 'class-string' at position 6 in array<string, array<class-string>>.
Loading history...
21
*/
22
private array $results;
23
24
1
public function __construct(
25
private readonly LocatorInterface $locator
26
) {
27
1
$this->results = [];
28
}
29
30
1
public function lookup(string $classOrInterfaceName): \Generator
31
{
32
1
if (\array_key_exists($classOrInterfaceName, $this->results)) {
33
1
foreach ($this->results[$classOrInterfaceName] as $class) {
34
1
yield $class;
35
}
36
37
1
return;
38
}
39
40
1
$results = [];
41
1
foreach ($this->locator->lookup($classOrInterfaceName) as $class) {