Conditions | 1 |
Paths | 1 |
Total Lines | 12 |
Lines | 9 |
Ratio | 75 % |
Changes | 0 |
1 | <?php |
||
21 | public function __invoke($request, $response, $args) |
||
22 | { |
||
23 | $this->setParams($request, $response, $args); |
||
24 | $input = $this->getInput(); |
||
25 | $result = $this->getUserService()->createUser($input); |
||
|
|||
26 | |||
27 | // $client = new \Predis\Client(); |
||
28 | // $key = 'api-rest-slimphp:user:'.$result->id; |
||
29 | // $client->set($key, json_encode($result)); |
||
30 | |||
31 | return $this->jsonResponse('success', $result, 201); |
||
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.