Completed
Pull Request — master (#2600)
by
unknown
43s
created
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.
classes/models/FrmStyle.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -134,22 +134,22 @@  discard block
 block discarded – undo
134 134
 			$default_settings = $this->get_defaults();
135 135
 
136 136
 			foreach ( $default_settings as $setting => $default ) {
137
-				if ( ! isset( $new_instance['post_content'][ $setting ] ) ) {
138
-					$new_instance['post_content'][ $setting ] = $default;
137
+				if ( ! isset( $new_instance['post_content'][$setting] ) ) {
138
+					$new_instance['post_content'][$setting] = $default;
139 139
 				}
140 140
 
141 141
 				if ( $this->is_color( $setting ) ) {
142
-					$color_val = $new_instance['post_content'][ $setting ];
142
+					$color_val = $new_instance['post_content'][$setting];
143 143
 
144 144
 					if ( $color_val !== '' && false !== strpos( $color_val, 'rgb' ) ) {
145 145
 						// Maybe sanitize if invalid rgba value is entered.
146 146
 						$this->maybe_sanitize_rgba_value( $color_val );
147 147
 					}
148
-					$new_instance['post_content'][ $setting ] = str_replace( '#', '', $color_val );
149
-				} elseif ( in_array( $setting, array( 'submit_style', 'important_style', 'auto_width' ), true ) && ! isset( $new_instance['post_content'][ $setting ] ) ) {
150
-					$new_instance['post_content'][ $setting ] = 0;
148
+					$new_instance['post_content'][$setting] = str_replace( '#', '', $color_val );
149
+				} elseif ( in_array( $setting, array( 'submit_style', 'important_style', 'auto_width' ), true ) && ! isset( $new_instance['post_content'][$setting] ) ) {
150
+					$new_instance['post_content'][$setting] = 0;
151 151
 				} elseif ( $setting === 'font' ) {
152
-					$new_instance['post_content'][ $setting ] = $this->force_balanced_quotation( $new_instance['post_content'][ $setting ] );
152
+					$new_instance['post_content'][$setting] = $this->force_balanced_quotation( $new_instance['post_content'][$setting] );
153 153
 				}
154 154
 			}
155 155
 
@@ -265,14 +265,14 @@  discard block
 block discarded – undo
265 265
 		$sanitized_settings = array();
266 266
 
267 267
 		foreach ( $valid_keys as $key ) {
268
-			if ( isset( $settings[ $key ] ) ) {
269
-				$sanitized_settings[ $key ] = sanitize_textarea_field( $settings[ $key ] );
268
+			if ( isset( $settings[$key] ) ) {
269
+				$sanitized_settings[$key] = sanitize_textarea_field( $settings[$key] );
270 270
 			} else {
271
-				$sanitized_settings[ $key ] = $defaults[ $key ];
271
+				$sanitized_settings[$key] = $defaults[$key];
272 272
 			}
273 273
 
274 274
 			if ( 'custom_css' !== $key && 'single_style_custom_css' !== $key ) {
275
-				$sanitized_settings[ $key ] = $this->strip_invalid_characters( $sanitized_settings[ $key ] );
275
+				$sanitized_settings[$key] = $this->strip_invalid_characters( $sanitized_settings[$key] );
276 276
 			}
277 277
 		}
278 278
 		return $sanitized_settings;
@@ -578,13 +578,13 @@  discard block
 block discarded – undo
578 578
 			$style->post_content = $this->override_defaults( $style->post_content );
579 579
 			$style->post_content = wp_parse_args( $style->post_content, $default_values );
580 580
 
581
-			$styles[ $style->ID ] = $style;
581
+			$styles[$style->ID] = $style;
582 582
 		}//end foreach
583 583
 
584 584
 		if ( ! $default_style ) {
585 585
 			$default_style = reset( $styles );
586 586
 
587
-			$styles[ $default_style->ID ]->menu_order = 1;
587
+			$styles[$default_style->ID]->menu_order = 1;
588 588
 		}
589 589
 
590 590
 		return $styles;
@@ -839,7 +839,7 @@  discard block
 block discarded – undo
839 839
 				continue;
840 840
 			}
841 841
 
842
-			if ( $value && $char === $value[ strlen( $value ) - 1 ] ) {
842
+			if ( $value && $char === $value[strlen( $value ) - 1] ) {
843 843
 				$value = $char . $value;
844 844
 			} else {
845 845
 				$value .= $char;
Please login to merge, or discard this patch.