Conditions | 2 |
Paths | 1 |
Total Lines | 10 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 2 |
Changes | 2 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
18 | public static function respondFrom($method) |
||
19 | { |
||
20 | 3 | return function () use ($method) { |
|
21 | 3 | if (is_array($method[0])) { |
|
22 | 2 | $response = call_user_func_array($method[0], $method[1] ?? []); |
|
23 | } else { |
||
24 | 1 | $response = app()->call(...$method); |
|
|
|||
25 | } |
||
26 | |||
27 | 3 | throw new HttpResponseException($response); |
|
28 | 3 | }; |
|
31 |