| Conditions | 4 |
| Paths | 4 |
| Total Lines | 19 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 21 | public static function urlDecode(string $string): array |
||
| 22 | { |
||
| 23 | $raw_data = explode('&', urldecode($string)); |
||
| 24 | $data = []; |
||
| 25 | |||
| 26 | foreach ($raw_data as $row) { |
||
| 27 | [$key, $value] = explode('=', $row); |
||
| 28 | |||
| 29 | if (self::isUrlEncode($value)) { |
||
| 30 | $value = urldecode($value); |
||
| 31 | if (self::isJson($value)) { |
||
| 32 | $value = json_decode($value, true); |
||
| 33 | } |
||
| 34 | } |
||
| 35 | |||
| 36 | $data[$key] = $value; |
||
| 37 | } |
||
| 38 | |||
| 39 | return $data; |
||
| 40 | } |
||
| 74 | } |