| Conditions | 4 |
| Paths | 4 |
| Total Lines | 14 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 4 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 16 | 1 | public function unpack($content) |
|
| 17 | { |
||
| 18 | 1 | if (is_numeric($content)) { |
|
| 19 | 1 | return $content; |
|
| 20 | } |
||
| 21 | 1 | if (is_bool($content)) { |
|
| 22 | 1 | return $content; |
|
| 23 | } |
||
| 24 | 1 | $encodeResult = json_decode(strval($content), true); |
|
| 25 | 1 | if (is_null($encodeResult)) { |
|
| 26 | // problems with decoding - return original string |
||
| 27 | 1 | return $content; |
|
| 28 | } |
||
| 29 | 1 | return $encodeResult; |
|
| 30 | } |
||
| 46 |