@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | // Store back |
| 128 | - $data[$key] = $parts; |
|
| 128 | + $data[ $key ] = $parts; |
|
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | return $data; |
@@ -161,16 +161,16 @@ discard block |
||
| 161 | 161 | */ |
| 162 | 162 | public static function buildFontsMarkupScript(Collection $collection) |
| 163 | 163 | { |
| 164 | - $families_array = []; |
|
| 164 | + $families_array = [ ]; |
|
| 165 | 165 | |
| 166 | 166 | list($names, $mapping) = $collection->getScriptData(); |
| 167 | 167 | |
| 168 | 168 | foreach ($names as $name => $sizes) { |
| 169 | 169 | $family = $name . ':' . implode(',', $sizes); |
| 170 | - if (isset($mapping[$name])) { |
|
| 171 | - $family .= ':' . implode(',', $mapping[$name]); |
|
| 170 | + if (isset($mapping[ $name ])) { |
|
| 171 | + $family .= ':' . implode(',', $mapping[ $name ]); |
|
| 172 | 172 | } |
| 173 | - $families_array[] = $family; |
|
| 173 | + $families_array[ ] = $family; |
|
| 174 | 174 | } |
| 175 | 175 | $families = "'" . implode("', '", $families_array) . "'"; |
| 176 | 176 | |
@@ -234,26 +234,26 @@ discard block |
||
| 234 | 234 | * |
| 235 | 235 | * @return null|string |
| 236 | 236 | */ |
| 237 | - public static function buildGoogleFontsUrl(array $fonts, $subsets = []) |
|
| 237 | + public static function buildGoogleFontsUrl(array $fonts, $subsets = [ ]) |
|
| 238 | 238 | { |
| 239 | 239 | $base_url = 'https://fonts.googleapis.com/css'; |
| 240 | - $font_args = []; |
|
| 241 | - $family = []; |
|
| 240 | + $font_args = [ ]; |
|
| 241 | + $family = [ ]; |
|
| 242 | 242 | |
| 243 | 243 | $fonts = self::dedupValues($fonts, false); // no sort |
| 244 | 244 | foreach ($fonts as $font_name => $font_weight) { |
| 245 | 245 | // Trimming end colon handles edge case of being given an empty $font_weight |
| 246 | - $family[] = trim(trim($font_name) . ':' . implode(',', $font_weight), ':'); |
|
| 246 | + $family[ ] = trim(trim($font_name) . ':' . implode(',', $font_weight), ':'); |
|
| 247 | 247 | } |
| 248 | 248 | |
| 249 | - $font_args['family'] = implode('|', $family); |
|
| 249 | + $font_args[ 'family' ] = implode('|', $family); |
|
| 250 | 250 | |
| 251 | - if (! empty($subsets)) { |
|
| 251 | + if (!empty($subsets)) { |
|
| 252 | 252 | if (is_array($subsets)) { |
| 253 | 253 | $subsets = array_unique($subsets); |
| 254 | 254 | $subsets = implode(',', $subsets); |
| 255 | 255 | } |
| 256 | - $font_args['subset'] = trim($subsets); |
|
| 256 | + $font_args[ 'subset' ] = trim($subsets); |
|
| 257 | 257 | } |
| 258 | 258 | |
| 259 | 259 | $url = $base_url . '?' . http_build_query($font_args); |
@@ -270,15 +270,15 @@ discard block |
||
| 270 | 270 | */ |
| 271 | 271 | public static function arrayFlattenIterative(array $arr) |
| 272 | 272 | { |
| 273 | - $flat = []; |
|
| 273 | + $flat = [ ]; |
|
| 274 | 274 | $stack = array_values($arr); |
| 275 | 275 | |
| 276 | - while (! empty($stack)) { |
|
| 276 | + while (!empty($stack)) { |
|
| 277 | 277 | $value = array_shift($stack); |
| 278 | 278 | if (is_array($value)) { |
| 279 | 279 | $stack = array_merge(array_values($value), $stack); |
| 280 | 280 | } else { |
| 281 | - $flat[] = $value; |
|
| 281 | + $flat[ ] = $value; |
|
| 282 | 282 | } |
| 283 | 283 | } |
| 284 | 284 | |