Total Complexity | 4 |
Total Lines | 25 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
12 | class QueryHandlerLocator |
||
13 | { |
||
14 | /** @var ContainerInterface */ |
||
15 | private $creator; |
||
16 | |||
17 | 2 | public function __construct(ContainerInterface $creator) |
|
20 | 2 | } |
|
21 | |||
22 | /** @throws QueryHandlerLocatorException */ |
||
23 | 2 | public function locate(HandlerIdentifier $identifier): QueryHandler |
|
24 | { |
||
25 | 2 | $stringIdentifier = $identifier->get(); |
|
26 | 2 | $this->ensureHandlerExists($stringIdentifier); |
|
27 | |||
28 | 1 | return $this->creator->get($stringIdentifier); |
|
29 | } |
||
30 | |||
31 | /** @throws UnregisteredQueryHandlerException */ |
||
32 | 2 | private function ensureHandlerExists(string $stringIdentifier) |
|
37 | ); |
||
38 | } |
||
41 |