| Conditions | 2 |
| Paths | 5 |
| Total Lines | 12 |
| Code Lines | 8 |
| Lines | 12 |
| Ratio | 100 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 21 | public function __invoke($request, $response, $args) |
||
| 22 | { |
||
| 23 | try { |
||
| 24 | $this->setParams($request, $response, $args); |
||
| 25 | $input = $this->request->getParsedBody(); |
||
| 26 | $result = $this->getTaskService()->updateTask($input, $this->args['id']); |
||
|
|
|||
| 27 | |||
| 28 | return $this->jsonResponse('success', $result, 200); |
||
| 29 | } catch (\Exception $ex) { |
||
| 30 | return $this->jsonResponse('error', $ex->getMessage(), $ex->getCode()); |
||
| 31 | } |
||
| 32 | } |
||
| 33 | } |
||
| 34 |
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.