Passed
Push — main ( 137754...ffd9e1 )
by TARIQ
04:53
created
packages/kirki-framework/control-react-select/src/Field/ReactSelect.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -90,13 +90,13 @@  discard block
 block discarded – undo
90 90
 	 * @param WP_Customize_Manager $wp_customize The customizer instance.
91 91
 	 * @return array
92 92
 	 */
93
-	public function filter_setting_args( $args, $wp_customize ) {
93
+	public function filter_setting_args($args, $wp_customize) {
94 94
 
95
-		if ( $args['settings'] === $this->args['settings'] ) {
96
-			$args = parent::filter_setting_args( $args, $wp_customize );
95
+		if ($args['settings'] === $this->args['settings']) {
96
+			$args = parent::filter_setting_args($args, $wp_customize);
97 97
 
98
-			if ( isset( $args['multiple'] ) ) {
99
-				$multiple_and_max             = self::get_multiple_and_max( $args['multiple'] );
98
+			if (isset($args['multiple'])) {
99
+				$multiple_and_max             = self::get_multiple_and_max($args['multiple']);
100 100
 				$args['multiple']             = $multiple_and_max['multiple'];
101 101
 				$args['max_selection_number'] = $multiple_and_max['max_selection_number'];
102 102
 			} else {
@@ -104,19 +104,19 @@  discard block
 block discarded – undo
104 104
 			}
105 105
 
106 106
 			// Set the sanitize-callback if none is defined.
107
-			if ( ! isset( $args['sanitize_callback'] ) || ! $args['sanitize_callback'] ) {
108
-				$args['sanitize_callback'] = ! $args['multiple'] ? 'sanitize_text_field' : function( $values ) use ( $args ) {
107
+			if (!isset($args['sanitize_callback']) || !$args['sanitize_callback']) {
108
+				$args['sanitize_callback'] = !$args['multiple'] ? 'sanitize_text_field' : function($values) use ($args) {
109 109
 					$values           = (array) $values;
110 110
 					$sanitized_values = [];
111 111
 
112 112
 					// If total selected values > max_selection_number, then we need to remove the excess.
113
-					if ( count( $values ) > $args['max_selection_number'] ) {
114
-						for ( $i = 0; $i < $args['max_selection_number']; $i++ ) {
115
-							$sanitized_values[ $i ] = isset( $values[ $i ] ) ? sanitize_text_field( $values[ $i ] ) : '';
113
+					if (count($values) > $args['max_selection_number']) {
114
+						for ($i = 0; $i < $args['max_selection_number']; $i++) {
115
+							$sanitized_values[$i] = isset($values[$i]) ? sanitize_text_field($values[$i]) : '';
116 116
 						}
117 117
 					} else {
118
-						foreach ( $values as $index => $subvalue ) {
119
-							$sanitized_values[ $index ] = sanitize_text_field( $subvalue );
118
+						foreach ($values as $index => $subvalue) {
119
+							$sanitized_values[$index] = sanitize_text_field($subvalue);
120 120
 						}
121 121
 					}
122 122
 
@@ -138,13 +138,13 @@  discard block
 block discarded – undo
138 138
 	 * @param WP_Customize_Manager $wp_customize The customizer instance.
139 139
 	 * @return array
140 140
 	 */
141
-	public function filter_control_args( $args, $wp_customize ) {
141
+	public function filter_control_args($args, $wp_customize) {
142 142
 
143
-		if ( $args['settings'] === $this->args['settings'] ) {
144
-			$args = parent::filter_control_args( $args, $wp_customize );
143
+		if ($args['settings'] === $this->args['settings']) {
144
+			$args = parent::filter_control_args($args, $wp_customize);
145 145
 
146
-			if ( isset( $args['multiple'] ) ) {
147
-				$multiple_and_max             = self::get_multiple_and_max( $args['multiple'] );
146
+			if (isset($args['multiple'])) {
147
+				$multiple_and_max             = self::get_multiple_and_max($args['multiple']);
148 148
 				$args['multiple']             = $multiple_and_max['multiple'];
149 149
 				$args['max_selection_number'] = $multiple_and_max['max_selection_number'];
150 150
 			}
@@ -165,23 +165,23 @@  discard block
 block discarded – undo
165 165
 	 * @param bool|int $multiple The provided $multiple value.
166 166
 	 * @return array
167 167
 	 */
168
-	public static function get_multiple_and_max( $multiple ) {
168
+	public static function get_multiple_and_max($multiple) {
169 169
 
170 170
 		$max_selection_number = 999;
171 171
 
172
-		if ( is_numeric( $multiple ) ) {
172
+		if (is_numeric($multiple)) {
173 173
 			$multiple = (int) $multiple;
174 174
 
175 175
 			/**
176 176
 			 * Treat -1 as unlimited just like in WordPress's get_posts (well, in this Kirki case, it's 999 :).
177 177
 			 * Also treat 0 as "unlimited" because 1 it self will disable the multiple selection.
178 178
 			 */
179
-			if ( 0 >= $multiple ) {
179
+			if (0 >= $multiple) {
180 180
 				$max_selection_number = 999;
181 181
 				$multiple             = true;
182 182
 			} else {
183 183
 				// If $multiple is > 1.
184
-				if ( 1 < $multiple ) {
184
+				if (1 < $multiple) {
185 185
 					$max_selection_number = $multiple;
186 186
 					$multiple             = true;
187 187
 				} else {
Please login to merge, or discard this patch.
packages/kirki-framework/control-react-select/src/Control/ReactSelect.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 		// Enqueue the script.
99 99
 		wp_enqueue_script(
100 100
 			'kirki-control-select',
101
-			URL::get_from_path( dirname( dirname( __DIR__ ) ) . '/dist/control.js' ),
101
+			URL::get_from_path(dirname(dirname(__DIR__)) . '/dist/control.js'),
102 102
 			[
103 103
 				'customize-controls',
104 104
 				'customize-base',
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 		);
115 115
 
116 116
 		// Enqueue the style.
117
-		wp_enqueue_style( 'kirki-control-select-style', URL::get_from_path( dirname( dirname( __DIR__ ) ) . '/dist/control.css' ), [], self::$control_ver );
117
+		wp_enqueue_style('kirki-control-select-style', URL::get_from_path(dirname(dirname(__DIR__)) . '/dist/control.css'), [], self::$control_ver);
118 118
 
119 119
 	}
120 120
 
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
 	 */
132 132
 	public static function get_control_path_url() {
133 133
 
134
-		return URL::get_from_path( dirname( __DIR__ ) );
134
+		return URL::get_from_path(dirname(__DIR__));
135 135
 
136 136
 	}
137 137
 
@@ -148,25 +148,25 @@  discard block
 block discarded – undo
148 148
 
149 149
 		parent::to_json();
150 150
 
151
-		if ( isset( $this->json['label'] ) ) {
152
-			$this->json['label'] = html_entity_decode( $this->json['label'] );
151
+		if (isset($this->json['label'])) {
152
+			$this->json['label'] = html_entity_decode($this->json['label']);
153 153
 		}
154 154
 
155
-		if ( isset( $this->json['description'] ) ) {
156
-			$this->json['description'] = html_entity_decode( $this->json['description'] );
155
+		if (isset($this->json['description'])) {
156
+			$this->json['description'] = html_entity_decode($this->json['description']);
157 157
 		}
158 158
 
159 159
 		// @link https://react-select.com/props
160 160
 		$this->json['isClearable'] = $this->clearable;
161 161
 		$this->json['isMulti']     = $this->multiple;
162
-		$this->json['placeholder'] = ( $this->placeholder ) ? $this->placeholder : esc_html__( 'Select...', 'kirki' );
162
+		$this->json['placeholder'] = ($this->placeholder) ? $this->placeholder : esc_html__('Select...', 'kirki');
163 163
 
164 164
 		// Will be a custom implementation, couldn't find an official prop to set this in react-select.
165 165
 		$this->json['maxSelectionNumber'] = $this->max_selection_number;
166 166
 
167 167
 		$this->json['messages'] = [
168 168
 			// translators: %s is the limit of selection number.
169
-			'maxLimitReached' => sprintf( esc_html__( 'You can only select %s items', 'kirki' ), $this->max_selection_number ),
169
+			'maxLimitReached' => sprintf(esc_html__('You can only select %s items', 'kirki'), $this->max_selection_number),
170 170
 		];
171 171
 
172 172
 	}
Please login to merge, or discard this patch.
packages/kirki-framework/control-checkbox/src/Field/Checkbox_Toggle.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -42,10 +42,10 @@
 block discarded – undo
42 42
 	 * @param WP_Customize_Manager $wp_customize The customizer instance.
43 43
 	 * @return array
44 44
 	 */
45
-	public function filter_control_args( $args, $wp_customize ) {
45
+	public function filter_control_args($args, $wp_customize) {
46 46
 
47
-		if ( $args['settings'] === $this->args['settings'] ) {
48
-			$args         = parent::filter_control_args( $args, $wp_customize );
47
+		if ($args['settings'] === $this->args['settings']) {
48
+			$args         = parent::filter_control_args($args, $wp_customize);
49 49
 			$args['type'] = 'kirki-toggle';
50 50
 		}
51 51
 
Please login to merge, or discard this patch.
packages/kirki-framework/control-checkbox/src/Field/Checkbox_Switch.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -44,10 +44,10 @@
 block discarded – undo
44 44
 	 * @param WP_Customize_Manager $wp_customize The customizer instance.
45 45
 	 * @return array
46 46
 	 */
47
-	public function filter_control_args( $args, $wp_customize ) {
47
+	public function filter_control_args($args, $wp_customize) {
48 48
 
49
-		if ( $args['settings'] === $this->args['settings'] ) {
50
-			$args         = parent::filter_control_args( $args, $wp_customize );
49
+		if ($args['settings'] === $this->args['settings']) {
50
+			$args         = parent::filter_control_args($args, $wp_customize);
51 51
 			$args['type'] = 'kirki-switch';
52 52
 		}
53 53
 
Please login to merge, or discard this patch.
packages/kirki-framework/control-checkbox/src/Field/Checkbox.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -55,22 +55,22 @@  discard block
 block discarded – undo
55 55
 	 * @param WP_Customize_Manager $wp_customize The customizer instance.
56 56
 	 * @return array
57 57
 	 */
58
-	public function filter_setting_args( $args, $wp_customize ) {
58
+	public function filter_setting_args($args, $wp_customize) {
59 59
 
60
-		if ( $args['settings'] === $this->args['settings'] ) {
61
-			$args = parent::filter_setting_args( $args, $wp_customize );
60
+		if ($args['settings'] === $this->args['settings']) {
61
+			$args = parent::filter_setting_args($args, $wp_customize);
62 62
 
63 63
 			// Set the sanitize-callback if none is defined.
64
-			if ( ! isset( $args['sanitize_callback'] ) || ! $args['sanitize_callback'] ) {
65
-				$args['sanitize_callback'] = function( $value ) {
66
-					return ( '0' === $value || 'false' === $value ) ? false : (bool) $value;
64
+			if (!isset($args['sanitize_callback']) || !$args['sanitize_callback']) {
65
+				$args['sanitize_callback'] = function($value) {
66
+					return ('0' === $value || 'false' === $value) ? false : (bool) $value;
67 67
 				};
68 68
 			}
69 69
 
70
-			$args['default'] = isset( $args['default'] ) ? $args['default'] : false;
70
+			$args['default'] = isset($args['default']) ? $args['default'] : false;
71 71
 
72 72
 			// Make sure the default is formatted as boolean.
73
-			$args['default'] = (bool) ( 1 === $args['default'] || '1' === $args['default'] || true === $args['default'] || 'true' === $args['default'] || 'on' === $args['default'] );
73
+			$args['default'] = (bool) (1 === $args['default'] || '1' === $args['default'] || true === $args['default'] || 'true' === $args['default'] || 'on' === $args['default']);
74 74
 		}
75 75
 
76 76
 		return $args;
@@ -86,10 +86,10 @@  discard block
 block discarded – undo
86 86
 	 * @param WP_Customize_Manager $wp_customize The customizer instance.
87 87
 	 * @return array
88 88
 	 */
89
-	public function filter_control_args( $args, $wp_customize ) {
89
+	public function filter_control_args($args, $wp_customize) {
90 90
 
91
-		if ( $args['settings'] === $this->args['settings'] ) {
92
-			$args         = parent::filter_control_args( $args, $wp_customize );
91
+		if ($args['settings'] === $this->args['settings']) {
92
+			$args         = parent::filter_control_args($args, $wp_customize);
93 93
 			$args['type'] = 'kirki-checkbox';
94 94
 		}
95 95
 
Please login to merge, or discard this patch.
packages/kirki-framework/control-checkbox/src/Control/Checkbox_Toggle.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
 namespace Kirki\Control;
12 12
 
13 13
 // Exit if accessed directly.
14
-if ( ! defined( 'ABSPATH' ) ) {
14
+if (!defined('ABSPATH')) {
15 15
 	exit;
16 16
 }
17 17
 
Please login to merge, or discard this patch.
packages/kirki-framework/control-checkbox/src/Control/Checkbox_Switch.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 use Kirki\URL;
15 15
 
16 16
 // Exit if accessed directly.
17
-if ( ! defined( 'ABSPATH' ) ) {
17
+if (!defined('ABSPATH')) {
18 18
 	exit;
19 19
 }
20 20
 
@@ -56,10 +56,10 @@  discard block
 block discarded – undo
56 56
 		parent::enqueue();
57 57
 
58 58
 		// Enqueue the script.
59
-		wp_enqueue_script( 'kirki-control-checkbox', URL::get_from_path( dirname( dirname( __DIR__ ) ) . '/dist/control.js' ), [ 'jquery', 'customize-base', 'kirki-control-base' ], self::$control_ver, false );
59
+		wp_enqueue_script('kirki-control-checkbox', URL::get_from_path(dirname(dirname(__DIR__)) . '/dist/control.js'), ['jquery', 'customize-base', 'kirki-control-base'], self::$control_ver, false);
60 60
 
61 61
 		// Enqueue the style.
62
-		wp_enqueue_style( 'kirki-control-checkbox-style', URL::get_from_path( dirname( dirname( __DIR__ ) ) . '/dist/control.css' ), [], self::$control_ver );
62
+		wp_enqueue_style('kirki-control-checkbox-style', URL::get_from_path(dirname(dirname(__DIR__)) . '/dist/control.css'), [], self::$control_ver);
63 63
 
64 64
 	}
65 65
 
@@ -73,11 +73,11 @@  discard block
 block discarded – undo
73 73
 		// Get the basics from the parent class.
74 74
 		parent::to_json();
75 75
 
76
-		$this->json['checkboxType'] = str_ireplace( 'kirki-', '', $this->type );
76
+		$this->json['checkboxType'] = str_ireplace('kirki-', '', $this->type);
77 77
 
78 78
 		$this->json['defaultChoices'] = [
79
-			'on'  => __( 'On', 'kirki' ),
80
-			'off' => __( 'Off', 'kirki' ),
79
+			'on'  => __('On', 'kirki'),
80
+			'off' => __('Off', 'kirki'),
81 81
 		];
82 82
 
83 83
 	}
Please login to merge, or discard this patch.
packages/kirki-framework/control-checkbox/src/Control/Checkbox.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -53,10 +53,10 @@
 block discarded – undo
53 53
 		parent::enqueue();
54 54
 
55 55
 		// Enqueue the script.
56
-		wp_enqueue_script( 'kirki-control-checkbox', URL::get_from_path( dirname( dirname( __DIR__ ) ) . '/dist/control.js' ), [ 'jquery', 'customize-base', 'kirki-control-base' ], self::$control_ver, false );
56
+		wp_enqueue_script('kirki-control-checkbox', URL::get_from_path(dirname(dirname(__DIR__)) . '/dist/control.js'), ['jquery', 'customize-base', 'kirki-control-base'], self::$control_ver, false);
57 57
 
58 58
 		// Enqueue the style.
59
-		wp_enqueue_style( 'kirki-control-checkbox-style', URL::get_from_path( dirname( dirname( __DIR__ ) ) . '/dist/control.css' ), [], self::$control_ver );
59
+		wp_enqueue_style('kirki-control-checkbox-style', URL::get_from_path(dirname(dirname(__DIR__)) . '/dist/control.css'), [], self::$control_ver);
60 60
 	}
61 61
 
62 62
 	/**
Please login to merge, or discard this patch.
kirki-4.0.24/packages/kirki-framework/field-dimensions/src/Dimensions.php 1 patch
Spacing   +63 added lines, -63 removed lines patch added patch discarded remove patch
@@ -38,40 +38,40 @@  discard block
 block discarded – undo
38 38
 	 * @access public
39 39
 	 * @param array $args The arguments of the field.
40 40
 	 */
41
-	public function init( $args = array() ) {
41
+	public function init($args = array()) {
42 42
 
43
-		add_action( 'customize_controls_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
44
-		add_action( 'customize_preview_init', array( $this, 'enqueue_customize_preview_scripts' ) );
45
-		add_filter( 'kirki_output_control_classnames', array( $this, 'output_control_classnames' ) );
43
+		add_action('customize_controls_enqueue_scripts', array($this, 'enqueue_scripts'));
44
+		add_action('customize_preview_init', array($this, 'enqueue_customize_preview_scripts'));
45
+		add_filter('kirki_output_control_classnames', array($this, 'output_control_classnames'));
46 46
 
47
-		$args['required'] = isset( $args['required'] ) ? (array) $args['required'] : array();
47
+		$args['required'] = isset($args['required']) ? (array) $args['required'] : array();
48 48
 
49 49
 		$labels = array(
50
-			'left-top'       => esc_html__( 'Left Top', 'kirki' ),
51
-			'left-center'    => esc_html__( 'Left Center', 'kirki' ),
52
-			'left-bottom'    => esc_html__( 'Left Bottom', 'kirki' ),
53
-			'right-top'      => esc_html__( 'Right Top', 'kirki' ),
54
-			'right-center'   => esc_html__( 'Right Center', 'kirki' ),
55
-			'right-bottom'   => esc_html__( 'Right Bottom', 'kirki' ),
56
-			'center-top'     => esc_html__( 'Center Top', 'kirki' ),
57
-			'center-center'  => esc_html__( 'Center Center', 'kirki' ),
58
-			'center-bottom'  => esc_html__( 'Center Bottom', 'kirki' ),
59
-			'font-size'      => esc_html__( 'Font Size', 'kirki' ),
60
-			'font-weight'    => esc_html__( 'Font Weight', 'kirki' ),
61
-			'line-height'    => esc_html__( 'Line Height', 'kirki' ),
62
-			'font-style'     => esc_html__( 'Font Style', 'kirki' ),
63
-			'letter-spacing' => esc_html__( 'Letter Spacing', 'kirki' ),
64
-			'word-spacing'   => esc_html__( 'Word Spacing', 'kirki' ),
65
-			'top'            => esc_html__( 'Top', 'kirki' ),
66
-			'bottom'         => esc_html__( 'Bottom', 'kirki' ),
67
-			'left'           => esc_html__( 'Left', 'kirki' ),
68
-			'right'          => esc_html__( 'Right', 'kirki' ),
69
-			'center'         => esc_html__( 'Center', 'kirki' ),
70
-			'size'           => esc_html__( 'Size', 'kirki' ),
71
-			'spacing'        => esc_html__( 'Spacing', 'kirki' ),
72
-			'width'          => esc_html__( 'Width', 'kirki' ),
73
-			'height'         => esc_html__( 'Height', 'kirki' ),
74
-			'invalid-value'  => esc_html__( 'Invalid Value', 'kirki' ),
50
+			'left-top'       => esc_html__('Left Top', 'kirki'),
51
+			'left-center'    => esc_html__('Left Center', 'kirki'),
52
+			'left-bottom'    => esc_html__('Left Bottom', 'kirki'),
53
+			'right-top'      => esc_html__('Right Top', 'kirki'),
54
+			'right-center'   => esc_html__('Right Center', 'kirki'),
55
+			'right-bottom'   => esc_html__('Right Bottom', 'kirki'),
56
+			'center-top'     => esc_html__('Center Top', 'kirki'),
57
+			'center-center'  => esc_html__('Center Center', 'kirki'),
58
+			'center-bottom'  => esc_html__('Center Bottom', 'kirki'),
59
+			'font-size'      => esc_html__('Font Size', 'kirki'),
60
+			'font-weight'    => esc_html__('Font Weight', 'kirki'),
61
+			'line-height'    => esc_html__('Line Height', 'kirki'),
62
+			'font-style'     => esc_html__('Font Style', 'kirki'),
63
+			'letter-spacing' => esc_html__('Letter Spacing', 'kirki'),
64
+			'word-spacing'   => esc_html__('Word Spacing', 'kirki'),
65
+			'top'            => esc_html__('Top', 'kirki'),
66
+			'bottom'         => esc_html__('Bottom', 'kirki'),
67
+			'left'           => esc_html__('Left', 'kirki'),
68
+			'right'          => esc_html__('Right', 'kirki'),
69
+			'center'         => esc_html__('Center', 'kirki'),
70
+			'size'           => esc_html__('Size', 'kirki'),
71
+			'spacing'        => esc_html__('Spacing', 'kirki'),
72
+			'width'          => esc_html__('Width', 'kirki'),
73
+			'height'         => esc_html__('Height', 'kirki'),
74
+			'invalid-value'  => esc_html__('Invalid Value', 'kirki'),
75 75
 		);
76 76
 
77 77
 		/**
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 					'wrapper_opts'      => array(
86 86
 						'gap' => 'small',
87 87
 					),
88
-					'sanitize_callback' => isset( $args['sanitize_callback'] ) ? $args['sanitize_callback'] : array( __CLASS__, 'sanitize' ),
88
+					'sanitize_callback' => isset($args['sanitize_callback']) ? $args['sanitize_callback'] : array(__CLASS__, 'sanitize'),
89 89
 					'choices'           => array(
90 90
 						'type'        => 'hidden',
91 91
 						'parent_type' => 'kirki-dimensions',
@@ -95,14 +95,14 @@  discard block
 block discarded – undo
95 95
 			)
96 96
 		);
97 97
 
98
-		$args['choices']           = isset( $args['choices'] ) ? $args['choices'] : array();
99
-		$args['choices']['labels'] = isset( $args['choices']['labels'] ) ? $args['choices']['labels'] : array();
98
+		$args['choices']           = isset($args['choices']) ? $args['choices'] : array();
99
+		$args['choices']['labels'] = isset($args['choices']['labels']) ? $args['choices']['labels'] : array();
100 100
 
101
-		if ( isset( $args['transport'] ) && 'auto' === $args['transport'] ) {
101
+		if (isset($args['transport']) && 'auto' === $args['transport']) {
102 102
 			$args['transport'] = 'postMessage';
103 103
 		}
104 104
 
105
-		$total_items = count( $args['default'] );
105
+		$total_items = count($args['default']);
106 106
 		$item_count  = 0;
107 107
 
108 108
 		$width = 100;
@@ -110,35 +110,35 @@  discard block
 block discarded – undo
110 110
 		$break_indexes = array();
111 111
 
112 112
 		// The 'kirki-group-break' only supports 12 group items inside a group.
113
-		if ( 2 === $total_items ) {
113
+		if (2 === $total_items) {
114 114
 			$width = 50;
115
-		} elseif ( 3 === $total_items ) {
115
+		} elseif (3 === $total_items) {
116 116
 			$width = 33;
117
-		} elseif ( 4 === $total_items ) {
117
+		} elseif (4 === $total_items) {
118 118
 			$width = 25;
119
-		} elseif ( 5 === $total_items ) {
120
-			array_push( $break_indexes, 3 );
119
+		} elseif (5 === $total_items) {
120
+			array_push($break_indexes, 3);
121 121
 			$width = 33;
122
-		} elseif ( 6 === $total_items ) {
123
-			array_push( $break_indexes, 3 );
122
+		} elseif (6 === $total_items) {
123
+			array_push($break_indexes, 3);
124 124
 			$width = 33;
125
-		} elseif ( 7 === $total_items || 8 === $total_items ) {
126
-			array_push( $break_indexes, 4 );
125
+		} elseif (7 === $total_items || 8 === $total_items) {
126
+			array_push($break_indexes, 4);
127 127
 			$width = 25;
128
-		} elseif ( 9 === $total_items ) {
129
-			array_push( $break_indexes, 3, 6 );
128
+		} elseif (9 === $total_items) {
129
+			array_push($break_indexes, 3, 6);
130 130
 			$width = 33;
131
-		} elseif ( $total_items > 9 ) {
132
-			array_push( $break_indexes, 4, 8 );
131
+		} elseif ($total_items > 9) {
132
+			array_push($break_indexes, 4, 8);
133 133
 			$width = 25;
134 134
 		}
135 135
 
136
-		foreach ( $args['default'] as $choice => $default ) {
136
+		foreach ($args['default'] as $choice => $default) {
137 137
 			$item_count++;
138 138
 
139 139
 			$label = $choice;
140
-			$label = isset( $labels[ $choice ] ) ? $labels[ $choice ] : $label;
141
-			$label = isset( $args['choices']['labels'][ $choice ] ) ? $args['choices']['labels'][ $choice ] : $label;
140
+			$label = isset($labels[$choice]) ? $labels[$choice] : $label;
141
+			$label = isset($args['choices']['labels'][$choice]) ? $args['choices']['labels'][$choice] : $label;
142 142
 
143 143
 			$wrapper_attrs = array(
144 144
 				'data-kirki-parent-control-type'    => 'kirki-dimensions',
@@ -146,15 +146,15 @@  discard block
 block discarded – undo
146 146
 				'class'                             => '{default_class} kirki-group-item kirki-w' . $width,
147 147
 			);
148 148
 
149
-			if ( $item_count === 1 ) {
149
+			if ($item_count === 1) {
150 150
 				$wrapper_attrs['class'] .= ' kirki-group-start';
151 151
 			}
152 152
 
153
-			if ( in_array( $item_count, $break_indexes, true ) ) {
153
+			if (in_array($item_count, $break_indexes, true)) {
154 154
 				$wrapper_attrs['class'] .= ' kirki-group-break';
155 155
 			}
156 156
 
157
-			if ( $item_count === $total_items ) {
157
+			if ($item_count === $total_items) {
158 158
 				$wrapper_attrs['class'] .= ' kirki-group-end';
159 159
 			}
160 160
 
@@ -190,14 +190,14 @@  discard block
 block discarded – undo
190 190
 	 * @param array $value The value.
191 191
 	 * @return array
192 192
 	 */
193
-	public static function sanitize( $value ) {
193
+	public static function sanitize($value) {
194 194
 
195
-		if ( ! is_array( $value ) ) {
195
+		if (!is_array($value)) {
196 196
 			return array();
197 197
 		}
198 198
 
199
-		foreach ( $value as $key => $val ) {
200
-			$value[ $key ] = sanitize_text_field( $val );
199
+		foreach ($value as $key => $val) {
200
+			$value[$key] = sanitize_text_field($val);
201 201
 		}
202 202
 
203 203
 		return $value;
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
 	 * @param WP_Customize_Manager $wp_customize The customizer instance.
213 213
 	 * @return void
214 214
 	 */
215
-	public function add_setting( $wp_customize ) {}
215
+	public function add_setting($wp_customize) {}
216 216
 
217 217
 	/**
218 218
 	 * Override the parent method. No need for a control.
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
 	 * @param WP_Customize_Manager $wp_customize The customizer instance.
223 223
 	 * @return void
224 224
 	 */
225
-	public function add_control( $wp_customize ) {}
225
+	public function add_control($wp_customize) {}
226 226
 
227 227
 	/**
228 228
 	 * Enqueue scripts & styles.
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
 	 */
234 234
 	public function enqueue_scripts() {
235 235
 
236
-		wp_enqueue_style( 'kirki-field-dimensions', URL::get_from_path( dirname( __DIR__ ) . '/dist/control.css' ), array(), '1.0' );
236
+		wp_enqueue_style('kirki-field-dimensions', URL::get_from_path(dirname(__DIR__) . '/dist/control.css'), array(), '1.0');
237 237
 
238 238
 	}
239 239
 
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
 	 */
247 247
 	public function enqueue_customize_preview_scripts() {
248 248
 
249
-		wp_enqueue_script( 'kirki-field-dimensions', URL::get_from_path( dirname( __DIR__ ) ) . '/dist/preview.js', array( 'wp-hooks' ), '1.0', true );
249
+		wp_enqueue_script('kirki-field-dimensions', URL::get_from_path(dirname(__DIR__)) . '/dist/preview.js', array('wp-hooks'), '1.0', true);
250 250
 
251 251
 	}
252 252
 
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
 	 * @param array $classnames The array of classnames.
259 259
 	 * @return array
260 260
 	 */
261
-	public function output_control_classnames( $classnames ) {
261
+	public function output_control_classnames($classnames) {
262 262
 
263 263
 		$classnames['kirki-dimensions'] = '\Kirki\Field\CSS\Dimensions';
264 264
 		return $classnames;
Please login to merge, or discard this patch.