| Conditions | 2 |
| Paths | 2 |
| Total Lines | 15 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | 4 | public function __invoke( |
|
| 16 | 4 | Request $request, |
|
| 17 | 4 | Response $response, |
|
| 18 | 1 | array $args |
|
| 19 | ): Response { |
||
| 20 | 4 | $input = (array) $request->getParsedBody(); |
|
| 21 | 4 | $userId = $this->getAndValidateUserId($input); |
|
| 22 | $query = ''; |
||
| 23 | 4 | if (isset($args['query'])) { |
|
| 24 | $query = $args['query']; |
||
| 25 | } |
||
| 26 | $status = $request->getParam('status', null); |
||
| 27 | $tasks = $this->getTaskService()->search($query, $userId, $status); |
||
| 28 | |||
| 29 | return $this->jsonResponse($response, 'success', $tasks, 200); |
||
| 30 | } |
||
| 32 |