| Conditions | 4 |
| Paths | 4 |
| Total Lines | 12 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 24 | public function decode($data) |
||
| 25 | { |
||
| 26 | if (is_string($data)) { |
||
| 27 | $this->arrayData = json_decode($data, true); // true gives us associative arrays |
||
| 28 | } |
||
| 29 | |||
| 30 | if (!is_string($data) || !$this->isValidJson()) { |
||
| 31 | throw new JsonDecodingFailedException('The data provided was not proper JSON'); |
||
| 32 | } |
||
| 33 | |||
| 34 | return $this->arrayData; |
||
| 35 | } |
||
| 36 | |||
| 55 |