Conditions | 2 |
Paths | 2 |
Total Lines | 13 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
46 | public function handle(Query $query): DTO |
||
47 | { |
||
48 | $dto = $this->wrappedCommandBus->handle($query); |
||
49 | |||
50 | if (!$dto instanceof DTO) { |
||
51 | throw new QueryReturnException(\sprintf( |
||
52 | 'Query handler for "%s" should return an instance of "%s".', |
||
53 | \get_class($query), |
||
54 | DTO::class |
||
55 | )); |
||
56 | } |
||
57 | |||
58 | return $dto; |
||
59 | } |
||
61 |