@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | $qs .= "$paramName" . '[]=' . urlencode($value[0]) . '&'; |
| 132 | 132 | } else { |
| 133 | 133 | foreach ($value as $item => $itemValue) { |
| 134 | - if(!is_array($itemValue)) |
|
| 134 | + if (!is_array($itemValue)) |
|
| 135 | 135 | continue; |
| 136 | 136 | |
| 137 | 137 | $return = self::recursiveItemValue("[$item]", $itemValue); |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | |
| 144 | 144 | // Hash query param (eg filter[name]=john should become "filter[name]": "john") |
| 145 | 145 | foreach ($value as $item => $itemValue) { |
| 146 | - $item = strpos($item, '[')!==false ? str_replace(['%5B', '%5D'], ['[', ']'], urlencode($item)) : '[' . urlencode($item) . ']'; |
|
| 146 | + $item = strpos($item, '[') !== false ? str_replace(['%5B', '%5D'], ['[', ']'], urlencode($item)) : '[' . urlencode($item) . ']'; |
|
| 147 | 147 | $qs .= "$paramName" . $item . '=' . urlencode($itemValue) . '&'; |
| 148 | 148 | } |
| 149 | 149 | } |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | { |
| 158 | 158 | $item_values = []; |
| 159 | 159 | |
| 160 | - if(is_array($item_value)) { |
|
| 160 | + if (is_array($item_value)) { |
|
| 161 | 161 | foreach ($item_value as $key => $value) { |
| 162 | 162 | $item_values = array_merge( |
| 163 | 163 | $item_values, |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | ) |
| 168 | 168 | ); |
| 169 | 169 | } |
| 170 | - }else{ |
|
| 170 | + } else { |
|
| 171 | 171 | return [$item => $item_value]; |
| 172 | 172 | } |
| 173 | 173 | |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | } else { |
| 196 | 196 | // Hash query param (eg filter[name]=john should become "filter[name]": "john") |
| 197 | 197 | foreach ($value as $item => $itemValue) { |
| 198 | - if(!is_array($itemValue)) |
|
| 198 | + if (!is_array($itemValue)) |
|
| 199 | 199 | continue; |
| 200 | 200 | |
| 201 | 201 | $return = self::recursiveItemValue("[$item]", $itemValue); |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | } |
| 207 | 207 | |
| 208 | 208 | foreach ($value as $item => $itemValue) { |
| 209 | - $item = strpos($item, '[')!==false ? $item : "[$item]"; |
|
| 209 | + $item = strpos($item, '[') !== false ? $item : "[$item]"; |
|
| 210 | 210 | |
| 211 | 211 | $output .= str_repeat(" ", $spacesIndentation); |
| 212 | 212 | $output .= "$quote$parameter" . "$item$quote$delimiter $quote$itemValue$quote,\n"; |
@@ -131,8 +131,9 @@ discard block |
||
| 131 | 131 | $qs .= "$paramName" . '[]=' . urlencode($value[0]) . '&'; |
| 132 | 132 | } else { |
| 133 | 133 | foreach ($value as $item => $itemValue) { |
| 134 | - if(!is_array($itemValue)) |
|
| 135 | - continue; |
|
| 134 | + if(!is_array($itemValue)) { |
|
| 135 | + continue; |
|
| 136 | + } |
|
| 136 | 137 | |
| 137 | 138 | $return = self::recursiveItemValue("[$item]", $itemValue); |
| 138 | 139 | |
@@ -167,7 +168,7 @@ discard block |
||
| 167 | 168 | ) |
| 168 | 169 | ); |
| 169 | 170 | } |
| 170 | - }else{ |
|
| 171 | + } else{ |
|
| 171 | 172 | return [$item => $item_value]; |
| 172 | 173 | } |
| 173 | 174 | |
@@ -195,8 +196,9 @@ discard block |
||
| 195 | 196 | } else { |
| 196 | 197 | // Hash query param (eg filter[name]=john should become "filter[name]": "john") |
| 197 | 198 | foreach ($value as $item => $itemValue) { |
| 198 | - if(!is_array($itemValue)) |
|
| 199 | - continue; |
|
| 199 | + if(!is_array($itemValue)) { |
|
| 200 | + continue; |
|
| 201 | + } |
|
| 200 | 202 | |
| 201 | 203 | $return = self::recursiveItemValue("[$item]", $itemValue); |
| 202 | 204 | |