Passed
Push — develop ( 3892e2...b1663d )
by Aristeides
03:47
created
core/class-kirki-util.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 		$plugins = get_plugins();
46 46
 		$_plugin = '';
47 47
 		foreach ( $plugins as $plugin => $args ) {
48
-			if ( ! $is_plugin && isset( $args['Name'] ) && ( 'Kirki' === $args['Name'] || 'Kirki Toolkit' === $args['Name'] ) ) {
48
+			if ( ! $is_plugin && isset( $args[ 'Name' ] ) && ( 'Kirki' === $args[ 'Name' ] || 'Kirki Toolkit' === $args[ 'Name' ] ) ) {
49 49
 				$is_plugin = true;
50 50
 				$_plugin   = $plugin;
51 51
 			}
@@ -82,26 +82,26 @@  discard block
 block discarded – undo
82 82
 		foreach ( Kirki::$fields as $field ) {
83 83
 
84 84
 			// Check if we have variables for this field.
85
-			if ( isset( $field['variables'] ) && $field['variables'] && ! empty( $field['variables'] ) ) {
85
+			if ( isset( $field[ 'variables' ] ) && $field[ 'variables' ] && ! empty( $field[ 'variables' ] ) ) {
86 86
 
87 87
 				// Loop through the array of variables.
88
-				foreach ( $field['variables'] as $field_variable ) {
88
+				foreach ( $field[ 'variables' ] as $field_variable ) {
89 89
 
90 90
 					// Is the variable ['name'] defined? If yes, then we can proceed.
91
-					if ( isset( $field_variable['name'] ) ) {
91
+					if ( isset( $field_variable[ 'name' ] ) ) {
92 92
 
93 93
 						// Sanitize the variable name.
94
-						$variable_name = esc_attr( $field_variable['name'] );
94
+						$variable_name = esc_attr( $field_variable[ 'name' ] );
95 95
 
96 96
 						// Do we have a callback function defined? If not then set $variable_callback to false.
97
-						$variable_callback = ( isset( $field_variable['callback'] ) && is_callable( $field_variable['callback'] ) ) ? $field_variable['callback'] : false;
97
+						$variable_callback = ( isset( $field_variable[ 'callback' ] ) && is_callable( $field_variable[ 'callback' ] ) ) ? $field_variable[ 'callback' ] : false;
98 98
 
99 99
 						// If we have a variable_callback defined then get the value of the option
100 100
 						// and run it through the callback function.
101 101
 						// If no callback is defined (false) then just get the value.
102
-						$variables[ $variable_name ] = Kirki_Values::get_value( $field['settings'] );
102
+						$variables[ $variable_name ] = Kirki_Values::get_value( $field[ 'settings' ] );
103 103
 						if ( $variable_callback ) {
104
-							$variables[ $variable_name ] = call_user_func( $field_variable['callback'], Kirki_Values::get_value( $field['settings'] ) );
104
+							$variables[ $variable_name ] = call_user_func( $field_variable[ 'callback' ], Kirki_Values::get_value( $field[ 'settings' ] ) );
105 105
 						}
106 106
 					}
107 107
 				}
@@ -128,31 +128,31 @@  discard block
 block discarded – undo
128 128
 		if (
129 129
 			self::is_plugin() ||
130 130
 			false === strpos( $url, 'wordpress.org' ) || (
131
-				! isset( $request['body'] ) ||
132
-				! isset( $request['body']['plugins'] ) ||
133
-				! isset( $request['body']['translations'] ) ||
134
-				! isset( $request['body']['locale'] ) ||
135
-				! isset( $request['body']['all'] )
131
+				! isset( $request[ 'body' ] ) ||
132
+				! isset( $request[ 'body' ][ 'plugins' ] ) ||
133
+				! isset( $request[ 'body' ][ 'translations' ] ) ||
134
+				! isset( $request[ 'body' ][ 'locale' ] ) ||
135
+				! isset( $request[ 'body' ][ 'all' ] )
136 136
 			)
137 137
 		) {
138 138
 			return $request;
139 139
 		}
140 140
 
141
-		$plugins = json_decode( $request['body']['plugins'], true );
142
-		if ( ! isset( $plugins['plugins'] ) ) {
141
+		$plugins = json_decode( $request[ 'body' ][ 'plugins' ], true );
142
+		if ( ! isset( $plugins[ 'plugins' ] ) ) {
143 143
 			return $request;
144 144
 		}
145 145
 		$exists = false;
146
-		foreach ( $plugins['plugins'] as $plugin ) {
147
-			if ( isset( $plugin['Name'] ) && 'Kirki Toolkit' === $plugin['Name'] ) {
146
+		foreach ( $plugins[ 'plugins' ] as $plugin ) {
147
+			if ( isset( $plugin[ 'Name' ] ) && 'Kirki Toolkit' === $plugin[ 'Name' ] ) {
148 148
 				$exists = true;
149 149
 			}
150 150
 		}
151 151
 		// Inject data.
152 152
 		if ( ! $exists && defined( 'KIRKI_PLUGIN_FILE' ) ) {
153
-			$plugins['plugins']['kirki/kirki.php'] = get_plugin_data( KIRKI_PLUGIN_FILE );
153
+			$plugins[ 'plugins' ][ 'kirki/kirki.php' ] = get_plugin_data( KIRKI_PLUGIN_FILE );
154 154
 		}
155
-		$request['body']['plugins'] = wp_json_encode( $plugins );
155
+		$request[ 'body' ][ 'plugins' ] = wp_json_encode( $plugins );
156 156
 		return $request;
157 157
 	}
158 158
 
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
 		// We only need the major version.
175 175
 		if ( 'major' === $context ) {
176 176
 			$version_parts = explode( '.', $wp_version );
177
-			return ( $only_numeric ) ? absint( $version_parts[0] ) : $version_parts[0];
177
+			return ( $only_numeric ) ? absint( $version_parts[ 0 ] ) : $version_parts[ 0 ];
178 178
 		}
179 179
 
180 180
 		// If we got this far, we want the full monty.
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
 			if ( false !== strpos( $wp_version, '-' ) ) {
184 184
 				// We're on a dev version.
185 185
 				$version_parts = explode( '-', $wp_version );
186
-				return floatval( $version_parts[0] );
186
+				return floatval( $version_parts[ 0 ] );
187 187
 			}
188 188
 			return floatval( $wp_version );
189 189
 		}
Please login to merge, or discard this patch.
core/class-kirki-setting-site-option.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 	 * @return mixed
34 34
 	 */
35 35
 	protected function get_root_value( $default = null ) {
36
-		return get_site_option( $this->id_data['base'], $default );
36
+		return get_site_option( $this->id_data[ 'base' ], $default );
37 37
 	}
38 38
 
39 39
 	/**
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 	 * @return bool Whether the multidimensional root was updated successfully.
46 46
 	 */
47 47
 	protected function set_root_value( $value ) {
48
-		return update_site_option( $this->id_data['base'], $value );
48
+		return update_site_option( $this->id_data[ 'base' ], $value );
49 49
 	}
50 50
 
51 51
 	/**
Please login to merge, or discard this patch.
core/class-kirki-l10n.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -119,7 +119,7 @@
 block discarded – undo
119 119
 		global $l10n;
120 120
 		if ( isset( $l10n[ $this->get_theme_textdomain() ] ) ) {
121 121
 			// @codingStandardsIgnoreLine WordPress.Variables.GlobalVariables.OverrideProhibited
122
-			$l10n['kirki'] = $l10n[ $this->get_theme_textdomain() ];
122
+			$l10n[ 'kirki' ] = $l10n[ $this->get_theme_textdomain() ];
123 123
 		}
124 124
 
125 125
 		// Check if the domain is "kirki".
Please login to merge, or discard this patch.
core/class-kirki-helper.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 
37 37
 		// Handle the arguments, merge one by one.
38 38
 		$args  = func_get_args();
39
-		$array = $args[0];
39
+		$array = $args[ 0 ];
40 40
 		if ( ! is_array( $array ) ) {
41 41
 			return $array;
42 42
 		}
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 		}
113 113
 
114 114
 		if ( ! empty( $attachment ) ) {
115
-			return $attachment[0];
115
+			return $attachment[ 0 ];
116 116
 		}
117 117
 		return 0;
118 118
 	}
@@ -129,10 +129,10 @@  discard block
 block discarded – undo
129 129
 		$image    = wp_get_attachment_image_src( $image_id, 'full' );
130 130
 
131 131
 		return array(
132
-			'url'       => $image[0],
133
-			'width'     => $image[1],
134
-			'height'    => $image[2],
135
-			'thumbnail' => $image[3],
132
+			'url'       => $image[ 0 ],
133
+			'width'     => $image[ 1 ],
134
+			'height'    => $image[ 2 ],
135
+			'thumbnail' => $image[ 3 ],
136 136
 		);
137 137
 
138 138
 	}
@@ -153,8 +153,8 @@  discard block
 block discarded – undo
153 153
 					'suppress_filters' => false,
154 154
 				)
155 155
 			);
156
-		} elseif ( is_array( $args ) && ! isset( $args['suppress_filters'] ) ) {
157
-			$args['suppress_filters'] = false;
156
+		} elseif ( is_array( $args ) && ! isset( $args[ 'suppress_filters' ] ) ) {
157
+			$args[ 'suppress_filters' ] = false;
158 158
 		}
159 159
 
160 160
 		// Get the posts.
@@ -303,41 +303,41 @@  discard block
 block discarded – undo
303 303
 				$key = absint( $context ) / 100;
304 304
 				if ( 'A100' === $context ) {
305 305
 					$key = 10;
306
-					unset( $colors['grey'] );
306
+					unset( $colors[ 'grey' ] );
307 307
 				} elseif ( 'A200' === $context ) {
308 308
 					$key = 11;
309
-					unset( $colors['grey'] );
309
+					unset( $colors[ 'grey' ] );
310 310
 				} elseif ( 'A400' === $context ) {
311 311
 					$key = 12;
312
-					unset( $colors['grey'] );
312
+					unset( $colors[ 'grey' ] );
313 313
 				} elseif ( 'A700' === $context ) {
314 314
 					$key = 13;
315
-					unset( $colors['grey'] );
315
+					unset( $colors[ 'grey' ] );
316 316
 				}
317
-				unset( $colors['primary'] );
317
+				unset( $colors[ 'primary' ] );
318 318
 				$position_colors = array();
319 319
 				foreach ( $colors as $color_family ) {
320 320
 					if ( isset( $color_family[ $key ] ) ) {
321
-						$position_colors[] = $color_family[ $key ];
321
+						$position_colors[ ] = $color_family[ $key ];
322 322
 					}
323 323
 				}
324 324
 				return $position_colors;
325 325
 			case 'all':
326
-				unset( $colors['primary'] );
326
+				unset( $colors[ 'primary' ] );
327 327
 				$all_colors = array();
328 328
 				foreach ( $colors as $color_family ) {
329 329
 					foreach ( $color_family as $color ) {
330
-						$all_colors[] = $color;
330
+						$all_colors[ ] = $color;
331 331
 					}
332 332
 				}
333 333
 				return $all_colors;
334 334
 			case 'primary':
335
-				return $colors['primary'];
335
+				return $colors[ 'primary' ];
336 336
 			default:
337 337
 				if ( isset( $colors[ $context ] ) ) {
338 338
 					return $colors[ $context ];
339 339
 				}
340
-				return $colors['primary'];
340
+				return $colors[ 'primary' ];
341 341
 		} // End switch().
342 342
 	}
343 343
 
Please login to merge, or discard this patch.
core/class-kirki-modules.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -104,7 +104,7 @@
 block discarded – undo
104 104
 	public static function add_module( $module ) {
105 105
 
106 106
 		if ( ! in_array( $module, self::$modules, true ) ) {
107
-			self::$modules[] = $module;
107
+			self::$modules[ ] = $module;
108 108
 		}
109 109
 
110 110
 	}
Please login to merge, or discard this patch.
core/class-kirki-panel.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -46,12 +46,12 @@
 block discarded – undo
46 46
 	public function add_panel( $args ) {
47 47
 		global $wp_customize;
48 48
 
49
-		if ( ! isset( $args['type'] ) || ! array_key_exists( $args['type'], $this->panel_types ) ) {
50
-			$args['type'] = 'default';
49
+		if ( ! isset( $args[ 'type' ] ) || ! array_key_exists( $args[ 'type' ], $this->panel_types ) ) {
50
+			$args[ 'type' ] = 'default';
51 51
 		}
52
-		$panel_classname = $this->panel_types[ $args['type'] ];
52
+		$panel_classname = $this->panel_types[ $args[ 'type' ] ];
53 53
 
54
-		$wp_customize->add_panel( new $panel_classname( $wp_customize, sanitize_key( $args['id'] ), $args ) );
54
+		$wp_customize->add_panel( new $panel_classname( $wp_customize, sanitize_key( $args[ 'id' ] ), $args ) );
55 55
 
56 56
 	}
57 57
 }
Please login to merge, or discard this patch.
core/dynamic-css.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
 // Echo the styles.
21 21
 $configs = Kirki::$config;
22 22
 foreach ( $configs as $config_id => $args ) {
23
-	if ( true === $args['disable_output'] ) {
23
+	if ( true === $args[ 'disable_output' ] ) {
24 24
 		continue;
25 25
 	}
26 26
 
Please login to merge, or discard this patch.
core/class-kirki-sections.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -36,8 +36,8 @@
 block discarded – undo
36 36
 		$css = '';
37 37
 		if ( ! empty( Kirki::$sections ) ) {
38 38
 			foreach ( Kirki::$sections as $section_args ) {
39
-				if ( isset( $section_args['id'] ) && isset( $section_args['type'] ) && 'outer' === $section_args['type'] || 'kirki-outer' === $section_args['type'] ) {
40
-					$css .= '#customize-theme-controls li#accordion-section-' . $section_args['id'] . '{display:list-item!important;}';
39
+				if ( isset( $section_args[ 'id' ] ) && isset( $section_args[ 'type' ] ) && 'outer' === $section_args[ 'type' ] || 'kirki-outer' === $section_args[ 'type' ] ) {
40
+					$css .= '#customize-theme-controls li#accordion-section-' . $section_args[ 'id' ] . '{display:list-item!important;}';
41 41
 				}
42 42
 			}
43 43
 		}
Please login to merge, or discard this patch.
modules/custom-sections/panels/class-kirki-panels-nested-panel.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -49,10 +49,10 @@
 block discarded – undo
49 49
 			'panel',
50 50
 		) );
51 51
 
52
-		$array['title']          = html_entity_decode( $this->title, ENT_QUOTES, get_bloginfo( 'charset' ) );
53
-		$array['content']        = $this->get_content();
54
-		$array['active']         = $this->active();
55
-		$array['instanceNumber'] = $this->instance_number;
52
+		$array[ 'title' ]          = html_entity_decode( $this->title, ENT_QUOTES, get_bloginfo( 'charset' ) );
53
+		$array[ 'content' ]        = $this->get_content();
54
+		$array[ 'active' ]         = $this->active();
55
+		$array[ 'instanceNumber' ] = $this->instance_number;
56 56
 
57 57
 		return $array;
58 58
 	}
Please login to merge, or discard this patch.