Completed
Pull Request — master (#2600)
by
unknown
40s
created
classes/models/FrmStyle.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -129,21 +129,21 @@  discard block
 block discarded – undo
129 129
 			$default_settings = $this->get_defaults();
130 130
 
131 131
 			foreach ( $default_settings as $setting => $default ) {
132
-				if ( ! isset( $new_instance['post_content'][ $setting ] ) ) {
133
-					$new_instance['post_content'][ $setting ] = $default;
132
+				if ( ! isset( $new_instance['post_content'][$setting] ) ) {
133
+					$new_instance['post_content'][$setting] = $default;
134 134
 				}
135 135
 
136 136
 				if ( $this->is_color( $setting ) ) {
137
-					$color_val = $new_instance['post_content'][ $setting ];
137
+					$color_val = $new_instance['post_content'][$setting];
138 138
 					if ( $color_val !== '' && false !== strpos( $color_val, 'rgb' ) ) {
139 139
 						// Maybe sanitize if invalid rgba value is entered.
140 140
 						$this->maybe_sanitize_rgba_value( $color_val );
141 141
 					}
142
-					$new_instance['post_content'][ $setting ] = str_replace( '#', '', $color_val );
143
-				} elseif ( in_array( $setting, array( 'submit_style', 'important_style', 'auto_width' ), true ) && ! isset( $new_instance['post_content'][ $setting ] ) ) {
144
-					$new_instance['post_content'][ $setting ] = 0;
142
+					$new_instance['post_content'][$setting] = str_replace( '#', '', $color_val );
143
+				} elseif ( in_array( $setting, array( 'submit_style', 'important_style', 'auto_width' ), true ) && ! isset( $new_instance['post_content'][$setting] ) ) {
144
+					$new_instance['post_content'][$setting] = 0;
145 145
 				} elseif ( $setting === 'font' ) {
146
-					$new_instance['post_content'][ $setting ] = $this->force_balanced_quotation( $new_instance['post_content'][ $setting ] );
146
+					$new_instance['post_content'][$setting] = $this->force_balanced_quotation( $new_instance['post_content'][$setting] );
147 147
 				}
148 148
 			}
149 149
 
@@ -253,14 +253,14 @@  discard block
 block discarded – undo
253 253
 		$valid_keys         = array_keys( $defaults );
254 254
 		$sanitized_settings = array();
255 255
 		foreach ( $valid_keys as $key ) {
256
-			if ( isset( $settings[ $key ] ) ) {
257
-				$sanitized_settings[ $key ] = sanitize_textarea_field( $settings[ $key ] );
256
+			if ( isset( $settings[$key] ) ) {
257
+				$sanitized_settings[$key] = sanitize_textarea_field( $settings[$key] );
258 258
 			} else {
259
-				$sanitized_settings[ $key ] = $defaults[ $key ];
259
+				$sanitized_settings[$key] = $defaults[$key];
260 260
 			}
261 261
 
262 262
 			if ( 'custom_css' !== $key && 'single_style_custom_css' !== $key ) {
263
-				$sanitized_settings[ $key ] = $this->strip_invalid_characters( $sanitized_settings[ $key ] );
263
+				$sanitized_settings[$key] = $this->strip_invalid_characters( $sanitized_settings[$key] );
264 264
 			}
265 265
 		}
266 266
 		return $sanitized_settings;
@@ -550,13 +550,13 @@  discard block
 block discarded – undo
550 550
 			$style->post_content = $this->override_defaults( $style->post_content );
551 551
 			$style->post_content = wp_parse_args( $style->post_content, $default_values );
552 552
 
553
-			$styles[ $style->ID ] = $style;
553
+			$styles[$style->ID] = $style;
554 554
 		}
555 555
 
556 556
 		if ( ! $default_style ) {
557 557
 			$default_style = reset( $styles );
558 558
 
559
-			$styles[ $default_style->ID ]->menu_order = 1;
559
+			$styles[$default_style->ID]->menu_order = 1;
560 560
 		}
561 561
 
562 562
 		return $styles;
@@ -805,7 +805,7 @@  discard block
 block discarded – undo
805 805
 				continue;
806 806
 			}
807 807
 
808
-			if ( $value && $char === $value[ strlen( $value ) - 1 ] ) {
808
+			if ( $value && $char === $value[strlen( $value ) - 1] ) {
809 809
 				$value = $char . $value;
810 810
 			} else {
811 811
 				$value .= $char;
Please login to merge, or discard this patch.
classes/helpers/FrmCssScopeHelper.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -24,13 +24,13 @@  discard block
 block discarded – undo
24 24
 		$buffer = '';
25 25
 
26 26
 		while ( $i < $length ) {
27
-			$char = $css[ $i ];
27
+			$char = $css[$i];
28 28
 			
29 29
 			if ( '@' === $char ) {
30 30
 				$brace_pos = strpos( $css, '{', $i );
31 31
 				if ( false === $brace_pos ) {
32 32
 					$buffer .= $char;
33
-					++$i;
33
+					++ $i;
34 34
 					continue;
35 35
 				}
36 36
 
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 			}//end if
83 83
 			
84 84
 			$buffer .= $char;
85
-			++$i;
85
+			++ $i;
86 86
 		}//end while
87 87
 		
88 88
 		return implode( '', $output );
@@ -109,13 +109,13 @@  discard block
 block discarded – undo
109 109
 		$prefix_length = strlen( $prefix );
110 110
 
111 111
 		while ( $i < $length ) {
112
-			$char = $css[ $i ];
112
+			$char = $css[$i];
113 113
 			
114 114
 			if ( '@' === $char ) {
115 115
 				$brace_pos = strpos( $css, '{', $i );
116 116
 				if ( false === $brace_pos ) {
117 117
 					$buffer .= $char;
118
-					++$i;
118
+					++ $i;
119 119
 					continue;
120 120
 				}
121 121
 				
@@ -142,9 +142,9 @@  discard block
 block discarded – undo
142 142
 				
143 143
 				if ( '' !== $selector && '' !== trim( $declarations ) ) {
144 144
 					// Handle multiple selectors
145
-					$selectors            = array_filter(
145
+					$selectors = array_filter(
146 146
 						array_map( 'trim', explode( ',', $selector ) ),
147
-						function ( $s ) {
147
+						function( $s ) {
148 148
 							return '' !== $s;
149 149
 						}
150 150
 					);
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
 			}//end if
168 168
 			
169 169
 			$buffer .= $char;
170
-			++$i;
170
+			++ $i;
171 171
 		}//end while
172 172
 		return implode( '', $output );
173 173
 	}
@@ -219,11 +219,11 @@  discard block
 block discarded – undo
219 219
 		$in_string   = false;
220 220
 		$string_char = '';
221 221
 		
222
-		for ( $i = $open_pos + 1; $i < $length; $i++ ) {
223
-			$char = $css[ $i ];
222
+		for ( $i = $open_pos + 1; $i < $length; $i ++ ) {
223
+			$char = $css[$i];
224 224
 			
225 225
 			// Handle string literals to avoid matching braces inside strings
226
-			if ( ( '"' === $char || "'" === $char ) && ( 0 === $i || '\\' !== $css[ $i - 1 ] ) ) {
226
+			if ( ( '"' === $char || "'" === $char ) && ( 0 === $i || '\\' !== $css[$i - 1] ) ) {
227 227
 				if ( ! $in_string ) {
228 228
 					$in_string   = true;
229 229
 					$string_char = $char;
@@ -239,9 +239,9 @@  discard block
 block discarded – undo
239 239
 			}
240 240
 			
241 241
 			if ( '{' === $char ) {
242
-				++$level;
242
+				++ $level;
243 243
 			} elseif ( '}' === $char ) {
244
-				--$level;
244
+				-- $level;
245 245
 				if ( 0 === $level ) {
246 246
 					return $i;
247 247
 				}
Please login to merge, or discard this patch.