Conditions | 4 |
Paths | 4 |
Total Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
26 | public function __construct($data, $httpCode) |
||
27 | { |
||
28 | if ($this->isValidJson($data)) { |
||
29 | $data = json_decode($data, true); |
||
30 | } |
||
31 | $this->data = $data; |
||
32 | |||
33 | if (is_array($data) && array_key_exists('cod', $data)) { |
||
34 | $this->httpCode = (int) $data['cod']; |
||
35 | } else { |
||
36 | $this->httpCode = $httpCode; |
||
37 | } |
||
38 | } |
||
39 | |||
120 |