Conditions | 4 |
Paths | 4 |
Total Lines | 19 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
53 | public static function urlDecode(string $string): array |
||
54 | { |
||
55 | $raw_data = explode('&', urldecode($string)); |
||
56 | $data = []; |
||
57 | |||
58 | foreach ($raw_data as $row) { |
||
59 | [$key, $value] = explode('=', $row); |
||
60 | |||
61 | if (self::isUrlEncode($value)) { |
||
62 | $value = urldecode($value); |
||
63 | if (self::isJson($value)) { |
||
64 | $value = json_decode($value, true); |
||
65 | } |
||
66 | } |
||
67 | |||
68 | $data[$key] = $value; |
||
69 | } |
||
70 | |||
71 | return $data; |
||
72 | } |
||
74 | } |