Total Complexity | 3 |
Total Lines | 32 |
Duplicated Lines | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
8 | class Response extends \UAPAY\Response |
||
9 | { |
||
10 | /** |
||
11 | * @var string |
||
12 | */ |
||
13 | protected $id; |
||
14 | |||
15 | /** |
||
16 | * Handle decoded JSON |
||
17 | * |
||
18 | * @throws Exception\JSON |
||
19 | */ |
||
20 | protected function json_handle() |
||
21 | { |
||
22 | parent::json_handle(); |
||
23 | |||
24 | if (!isset($this->json['data']['id'])) |
||
25 | { |
||
26 | throw new Exception\JSON('data does not contain the id field!'); |
||
27 | } |
||
28 | |||
29 | $this->id = $this->json['data']['id']; |
||
30 | } |
||
31 | |||
32 | /** |
||
33 | * Get session id |
||
34 | * |
||
35 | * @return string id session |
||
36 | */ |
||
37 | public function id() |
||
40 | } |
||
41 | } |
||
42 |