1 | <?php |
||
9 | class Utils |
||
10 | { |
||
11 | 93 | public static function jsonDecode(ResponseInterface $response) |
|
32 | |||
33 | /** |
||
34 | * Method for flattening a nested array. |
||
35 | * |
||
36 | * @param array $data The nested array |
||
37 | * @param null $key The key to extract |
||
38 | * |
||
39 | * @return array |
||
40 | */ |
||
41 | 77 | public static function flattenJson(array $data, $key = null) |
|
45 | |||
46 | /** |
||
47 | * Method for normalize an URL string. |
||
48 | * |
||
49 | * Append the http:// prefix if not present, and add a |
||
50 | * closing url separator when missing. |
||
51 | * |
||
52 | * @param string $url The url representation. |
||
53 | * |
||
54 | * @return string |
||
55 | */ |
||
56 | 5 | public static function normalizeUrl($url) |
|
64 | |||
65 | /** |
||
66 | * Add an unlimited list of paths to a given URI. |
||
67 | * |
||
68 | * @param UriInterface $uri |
||
69 | * @param ...$paths |
||
70 | * |
||
71 | * @return UriInterface |
||
72 | */ |
||
73 | 1 | public static function addPaths(UriInterface $uri, ...$paths) |
|
77 | } |
||
78 |