Conditions | 3 |
Paths | 2 |
Total Lines | 7 |
Code Lines | 4 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
10 | 4 | public function handle(Response $response): AuthResponse |
|
11 | { |
||
12 | 4 | $decoded = json_decode($response->getBody(), true); |
|
13 | 4 | if (array_key_exists('user_id', $decoded) && array_key_exists('key', $decoded)) { |
|
14 | 1 | return new AuthResponse(true, $decoded['user_id'], $decoded['key']); |
|
15 | } |
||
16 | 3 | return new AuthResponse(false); |
|
17 | } |
||
19 |