Completed
Push — master ( 49871a...b83d60 )
by
unknown
22s queued 14s
created
classes/helpers/FrmStylesHelper.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
 				'-' => 'down',
144 144
 				'+' => 'up',
145 145
 			);
146
-			$class = 'frm_arrow' . $arrow[ $icon ];
146
+			$class = 'frm_arrow' . $arrow[$icon];
147 147
 		} else {
148 148
 			// frm_minus1_icon.
149 149
 			$key   = str_replace( 'p', '', $key );
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
 				'-' => 'minus',
152 152
 				'+' => 'plus',
153 153
 			);
154
-			$class = 'frm_' . $plus[ $icon ];
154
+			$class = 'frm_' . $plus[$icon];
155 155
 		}
156 156
 
157 157
 		if ( $key ) {
@@ -177,8 +177,8 @@  discard block
 block discarded – undo
177 177
 		?>
178 178
 		<div class="btn-group" id="frm_<?php echo esc_attr( $name ); ?>_select">
179 179
 			<button class="multiselect dropdown-toggle btn btn-default" data-toggle="dropdown" type="button">
180
-				<?php FrmAppHelper::icon_by_class( 'frmfont ' . self::icon_key_to_class( $style->post_content[ $name ], '+', $type ) ); ?>
181
-				<?php FrmAppHelper::icon_by_class( 'frmfont ' . self::icon_key_to_class( $style->post_content[ $name ], '-', $type ) ); ?>
180
+				<?php FrmAppHelper::icon_by_class( 'frmfont ' . self::icon_key_to_class( $style->post_content[$name], '+', $type ) ); ?>
181
+				<?php FrmAppHelper::icon_by_class( 'frmfont ' . self::icon_key_to_class( $style->post_content[$name], '-', $type ) ); ?>
182 182
 				<b class="caret"></b>
183 183
 			</button>
184 184
 			<ul class="multiselect-container frm-dropdown-menu">
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
 					<li <?php echo $style->post_content['collapse_icon'] == $key ? 'class="active"' : ''; ?>>
187 187
 						<a href="javascript:void(0);">
188 188
 							<label>
189
-								<input type="radio" value="<?php echo esc_attr( $key ); ?>" name="<?php echo esc_attr( $frm_style->get_field_name( $name ) ); ?>" <?php checked( $style->post_content[ $name ], $key ); ?> />
189
+								<input type="radio" value="<?php echo esc_attr( $key ); ?>" name="<?php echo esc_attr( $frm_style->get_field_name( $name ) ); ?>" <?php checked( $style->post_content[$name], $key ); ?> />
190 190
 								<span>
191 191
 									<?php
192 192
 									FrmAppHelper::icon_by_class( 'frmfont ' . self::icon_key_to_class( $key, '+', $type ) );
@@ -437,13 +437,13 @@  discard block
 block discarded – undo
437 437
 		$vars   = array_diff( $vars, $remove );
438 438
 
439 439
 		foreach ( $vars as $var ) {
440
-			if ( ! isset( $settings[ $var ] ) ) {
440
+			if ( ! isset( $settings[$var] ) ) {
441 441
 				continue;
442 442
 			}
443
-			if ( ! isset( $defaults[ $var ] ) ) {
444
-				$defaults[ $var ] = '';
443
+			if ( ! isset( $defaults[$var] ) ) {
444
+				$defaults[$var] = '';
445 445
 			}
446
-			$show = empty( $defaults ) || ( $settings[ $var ] !== '' && $settings[ $var ] !== $defaults[ $var ] );
446
+			$show = empty( $defaults ) || ( $settings[$var] !== '' && $settings[$var] !== $defaults[$var] );
447 447
 			if ( $show ) {
448 448
 				echo '--' . esc_html( str_replace( '_', '-', $var ) ) . ':' . self::css_var_prepare_value( $settings, $var ) . ';'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
449 449
 			}
@@ -461,7 +461,7 @@  discard block
 block discarded – undo
461 461
 	 * @return string
462 462
 	 */
463 463
 	private static function css_var_prepare_value( $settings, $key ) {
464
-		$value = $settings[ $key ];
464
+		$value = $settings[$key];
465 465
 
466 466
 		switch ( $key ) {
467 467
 			case 'font':
@@ -493,7 +493,7 @@  discard block
 block discarded – undo
493 493
 				break;
494 494
 		}//end switch
495 495
 
496
-		return esc_html( $settings[ $key ] );
496
+		return esc_html( $settings[$key] );
497 497
 	}
498 498
 
499 499
 	/**
@@ -542,8 +542,8 @@  discard block
 block discarded – undo
542 542
 
543 543
 		$checkbox_opts = array( 'important_style', 'auto_width', 'submit_style', 'collapse_icon', 'center_form' );
544 544
 		foreach ( $checkbox_opts as $opt ) {
545
-			if ( ! isset( $settings[ $opt ] ) ) {
546
-				$settings[ $opt ] = 0;
545
+			if ( ! isset( $settings[$opt] ) ) {
546
+				$settings[$opt] = 0;
547 547
 			}
548 548
 		}
549 549
 
@@ -591,9 +591,9 @@  discard block
 block discarded – undo
591 591
 		);
592 592
 
593 593
 		array_map(
594
-			function ( $key ) use ( $defaults, $font_size, $base_font_size, &$settings ) {
595
-				if ( isset( $settings[ $key ] ) ) {
596
-					$settings[ $key ] = round( self::get_base_font_size_scale( $key, $font_size, $defaults ) * $base_font_size ) . 'px';
594
+			function( $key ) use ( $defaults, $font_size, $base_font_size, &$settings ) {
595
+				if ( isset( $settings[$key] ) ) {
596
+					$settings[$key] = round( self::get_base_font_size_scale( $key, $font_size, $defaults ) * $base_font_size ) . 'px';
597 597
 				}
598 598
 			},
599 599
 			$font_sizes_to_update
@@ -610,11 +610,11 @@  discard block
 block discarded – undo
610 610
 	 * @return float
611 611
 	 */
612 612
 	private static function get_base_font_size_scale( $key, $value, $defaults ) {
613
-		if ( empty( $defaults[ $key ] ) || ! is_numeric( (int) $defaults[ $key ] ) || ! is_numeric( (int) $value ) || 0 === (int) $value ) {
613
+		if ( empty( $defaults[$key] ) || ! is_numeric( (int) $defaults[$key] ) || ! is_numeric( (int) $value ) || 0 === (int) $value ) {
614 614
 			return 1;
615 615
 		}
616 616
 
617
-		return round( (int) $defaults[ $key ] / (int) $value, 2 );
617
+		return round( (int) $defaults[$key] / (int) $value, 2 );
618 618
 	}
619 619
 
620 620
 	/**
@@ -627,7 +627,7 @@  discard block
 block discarded – undo
627 627
 				$css = '';
628 628
 			}
629 629
 			foreach ( $opts as $opt ) {
630
-				self::get_color_output( $css, $settings[ $opt ] );
630
+				self::get_color_output( $css, $settings[$opt] );
631 631
 			}
632 632
 		}
633 633
 	}
@@ -840,13 +840,13 @@  discard block
 block discarded – undo
840 840
 	 */
841 841
 	private static function get_default_style_count( $style_id, $conversational_style_id ) {
842 842
 		$substrings = array_map(
843
-			function ( $value ) {
843
+			function( $value ) {
844 844
 				$substring = serialize( array( 'custom_style' => $value ) );
845 845
 				return substr( $substring, 5, -1 );
846 846
 			},
847 847
 			array( '1', 1 )
848 848
 		);
849
-		$where      = array(
849
+		$where = array(
850 850
 			'status' => 'published',
851 851
 			0        => array(
852 852
 				'options NOT LIKE' => 'custom_style',
Please login to merge, or discard this patch.