Conditions | 2 |
Paths | 2 |
Total Lines | 15 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
52 | protected function determineResponseHandler() |
||
53 | { |
||
54 | $handler = collect($this->commandConfig['handlers']) |
||
55 | ->map(function (string $handlerClassName) { |
||
56 | return new $handlerClassName(request()); |
||
57 | }) |
||
58 | ->filter(function (BaseHandler $handler) { |
||
59 | return $handler->canHandleCurrentRequest(); |
||
60 | })->first(); |
||
61 | |||
62 | if (!$handler) { |
||
63 | throw RequestCouldNotBeProcessed::noHandlerFound(request()); |
||
64 | } |
||
65 | return $handler; |
||
66 | } |
||
67 | } |