@@ -184,11 +184,11 @@ discard block |
||
184 | 184 | } |
185 | 185 | |
186 | 186 | // Add the requested google-font. |
187 | - if ( ! isset( $this->fonts[ $value['font-family'] ] ) ) { |
|
188 | - $this->fonts[ $value['font-family'] ] = array(); |
|
187 | + if ( ! isset( $this->fonts[$value['font-family']] ) ) { |
|
188 | + $this->fonts[$value['font-family']] = array(); |
|
189 | 189 | } |
190 | - if ( ! in_array( $value['variant'], $this->fonts[ $value['font-family'] ], true ) ) { |
|
191 | - $this->fonts[ $value['font-family'] ][] = $value['variant']; |
|
190 | + if ( ! in_array( $value['variant'], $this->fonts[$value['font-family']], true ) ) { |
|
191 | + $this->fonts[$value['font-family']][] = $value['variant']; |
|
192 | 192 | } |
193 | 193 | } else { |
194 | 194 | |
@@ -206,12 +206,12 @@ discard block |
||
206 | 206 | |
207 | 207 | if ( 'font-family' === $output['property'] ) { |
208 | 208 | if ( ! array_key_exists( $value, $this->fonts ) ) { |
209 | - $this->fonts[ $value ] = array(); |
|
209 | + $this->fonts[$value] = array(); |
|
210 | 210 | } |
211 | 211 | } elseif ( 'font-weight' === $output['property'] ) { |
212 | 212 | foreach ( $this->fonts as $font => $variants ) { |
213 | 213 | if ( ! in_array( $value, $variants, true ) ) { |
214 | - $this->fonts[ $font ][] = $value; |
|
214 | + $this->fonts[$font][] = $value; |
|
215 | 215 | } |
216 | 216 | } |
217 | 217 | } elseif ( 'font-subset' === $output['property'] || 'subset' === $output['property'] || 'subsets' === $output['property'] ) { |
@@ -250,31 +250,31 @@ discard block |
||
250 | 250 | // Determine if this is indeed a google font or not. |
251 | 251 | // If it's not, then just remove it from the array. |
252 | 252 | if ( ! array_key_exists( $font, $this->google_fonts ) ) { |
253 | - unset( $this->fonts[ $font ] ); |
|
253 | + unset( $this->fonts[$font] ); |
|
254 | 254 | continue; |
255 | 255 | } |
256 | 256 | |
257 | 257 | // Get all valid font variants for this font. |
258 | 258 | $font_variants = array(); |
259 | - if ( isset( $this->google_fonts[ $font ]['variants'] ) ) { |
|
260 | - $font_variants = $this->google_fonts[ $font ]['variants']; |
|
259 | + if ( isset( $this->google_fonts[$font]['variants'] ) ) { |
|
260 | + $font_variants = $this->google_fonts[$font]['variants']; |
|
261 | 261 | } |
262 | 262 | foreach ( $variants as $variant ) { |
263 | 263 | |
264 | 264 | // If this is not a valid variant for this font-family |
265 | 265 | // then unset it and move on to the next one. |
266 | 266 | if ( ! in_array( $variant, $font_variants, true ) ) { |
267 | - $variant_key = array_search( $variant, $this->fonts[ $font ] ); |
|
268 | - unset( $this->fonts[ $font ][ $variant_key ] ); |
|
267 | + $variant_key = array_search( $variant, $this->fonts[$font] ); |
|
268 | + unset( $this->fonts[$font][$variant_key] ); |
|
269 | 269 | continue; |
270 | 270 | } |
271 | 271 | } |
272 | 272 | |
273 | 273 | // Check if the selected subsets exist, even in one of the selected fonts. |
274 | 274 | // If they don't, then they have to be removed otherwise the link will fail. |
275 | - if ( isset( $this->google_fonts[ $font ]['subsets'] ) ) { |
|
275 | + if ( isset( $this->google_fonts[$font]['subsets'] ) ) { |
|
276 | 276 | foreach ( $this->subsets as $subset ) { |
277 | - if ( in_array( $subset, $this->google_fonts[ $font ]['subsets'], true ) ) { |
|
277 | + if ( in_array( $subset, $this->google_fonts[$font]['subsets'], true ) ) { |
|
278 | 278 | $valid_subsets[] = $subset; |
279 | 279 | } |
280 | 280 | } |
@@ -302,8 +302,8 @@ discard block |
||
302 | 302 | |
303 | 303 | // Are we force-loading all variants? |
304 | 304 | if ( true === self::$force_load_all_variants ) { |
305 | - if ( isset( $this->google_fonts[ $font ]['variants'] ) ) { |
|
306 | - $variants = $this->google_fonts[ $font ]['variants']; |
|
305 | + if ( isset( $this->google_fonts[$font]['variants'] ) ) { |
|
306 | + $variants = $this->google_fonts[$font]['variants']; |
|
307 | 307 | } |
308 | 308 | } |
309 | 309 | $variants = implode( ',', $variants ); |
@@ -318,8 +318,8 @@ discard block |
||
318 | 318 | // Are we force-loading all subsets? |
319 | 319 | if ( true === self::$force_load_all_subsets ) { |
320 | 320 | |
321 | - if ( isset( $this->google_fonts[ $font ]['subsets'] ) ) { |
|
322 | - foreach ( $this->google_fonts[ $font ]['subsets'] as $subset ) { |
|
321 | + if ( isset( $this->google_fonts[$font]['subsets'] ) ) { |
|
322 | + foreach ( $this->google_fonts[$font]['subsets'] as $subset ) { |
|
323 | 323 | $this->subsets[] = $subset; |
324 | 324 | } |
325 | 325 | } |