Conditions | 2 |
Paths | 3 |
Total Lines | 10 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
15 | public function __invoke(string $subForumId): JsonResponse |
||
16 | { |
||
17 | try { |
||
18 | $this->bus->addHandler(FindSubForumQuery::class, FindSubForumQueryHandler::class); |
||
19 | |||
20 | return JsonResponse::create( |
||
21 | $this->bus->dispatch(new FindSubForumQuery($subForumId)) |
||
22 | ); |
||
23 | } catch (SubForumNotExist $e) { |
||
24 | return JsonResponse::create(['message' => $e->getMessage()], 404); |
||
25 | } |
||
28 |