@@ 62-64 (lines=3) @@ | ||
59 | */ |
|
60 | public function validateResponse($decoded) |
|
61 | { |
|
62 | if (!isset($decoded['success'], $decoded['data']) || !is_array($decoded['data'])) { |
|
63 | throw new MalformedDataException(); |
|
64 | } |
|
65 | ||
66 | if (!$decoded['success']) { |
|
67 | $message = isset($decoded['data']['message']) ? $decoded['data']['message'] : null; |
|
@@ 72-74 (lines=3) @@ | ||
69 | throw new ServerErrorException($message, $code); |
|
70 | } |
|
71 | ||
72 | if (!isset($decoded['data']['locations']) || !is_array($decoded['data']['locations'])) { |
|
73 | throw new MalformedDataException(); |
|
74 | } |
|
75 | } |
|
76 | ||
77 | /** |