| Conditions | 3 |
| Paths | 3 |
| Total Lines | 13 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 3.1825 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 33 | 15 | public function convert(string $dataString) |
|
| 34 | { |
||
| 35 | 15 | $unserialized = unserialize($dataString, ['allowed_classes' => false]); |
|
| 36 | 15 | if ($unserialized) { |
|
| 37 | 1 | return $unserialized; |
|
| 38 | } |
||
| 39 | |||
| 40 | 14 | $decoded = json_decode($dataString, true); |
|
| 41 | 14 | if ($decoded) { |
|
| 42 | 11 | return $decoded; |
|
| 43 | } |
||
| 44 | |||
| 45 | 3 | return false; |
|
| 46 | } |
||
| 48 |