Completed
Pull Request — master (#2624)
by
unknown
42s
created
classes/controllers/FrmEntriesAJAXSubmitController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
 			foreach ( $errors as $field => $error ) {
89 89
 				$field_id         = str_replace( 'field', '', $field );
90 90
 				$error            = self::maybe_modify_ajax_error( $error, $field_id, $form, $errors );
91
-				$obj[ $field_id ] = $error;
91
+				$obj[$field_id] = $error;
92 92
 			}
93 93
 
94 94
 			$response['errors']        = $obj;
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 	private static function fix_woocommerce_conflict() {
120 120
 		add_action(
121 121
 			'wp_print_footer_scripts',
122
-			function () {
122
+			function() {
123 123
 				if ( ! function_exists( 'get_current_screen' ) ) {
124 124
 					require_once ABSPATH . 'wp-admin/includes/screen.php';
125 125
 				}
Please login to merge, or discard this patch.
classes/controllers/FrmElementorController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
 		if ( is_admin() ) {
19 19
 			add_action(
20 20
 				'elementor/editor/after_enqueue_styles',
21
-				function () {
21
+				function() {
22 22
 					wp_enqueue_style( 'font_icons', FrmAppHelper::plugin_url() . '/css/font_icons.css', array(), FrmAppHelper::plugin_version() );
23 23
 				}
24 24
 			);
Please login to merge, or discard this patch.
classes/controllers/FrmApplicationsController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -154,7 +154,7 @@
 block discarded – undo
154 154
 	private static function sort_templates( $applications ) {
155 155
 		usort(
156 156
 			$applications,
157
-			function ( $a, $b ) {
157
+			function( $a, $b ) {
158 158
 				return strcmp( $a['name'], $b['name'] );
159 159
 			}
160 160
 		);
Please login to merge, or discard this patch.
classes/views/shared/errors.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
19 19
 $show_messages = apply_filters( 'frm_message_list', $show_messages );
20 20
 if ( is_array( $show_messages ) && count( $show_messages ) > 0 ) {
21 21
 	// Define a callback function to add 'data-action' attribute to allowed HTML tags
22
-	$add_data_action_callback = function ( $allowed_html ) {
22
+	$add_data_action_callback = function( $allowed_html ) {
23 23
 		$allowed_html['span']['data-action'] = true;
24 24
 		return $allowed_html;
25 25
 	};
Please login to merge, or discard this patch.
classes/views/xml/xml.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -18,17 +18,17 @@  discard block
 block discarded – undo
18 18
 
19 19
 foreach ( $type as $tb_type ) {
20 20
 
21
-	if ( ! isset( $tables[ $tb_type ] ) ) {
21
+	if ( ! isset( $tables[$tb_type] ) ) {
22 22
 		do_action( 'frm_xml_import_' . $tb_type, $args );
23 23
 		continue;
24 24
 	}
25 25
 
26
-	if ( ! isset( $records[ $tb_type ] ) ) {
26
+	if ( ! isset( $records[$tb_type] ) ) {
27 27
 		// No records.
28 28
 		continue;
29 29
 	}
30 30
 
31
-	$item_ids = $records[ $tb_type ];
31
+	$item_ids = $records[$tb_type];
32 32
 
33 33
 	if ( in_array( $tb_type, array( 'styles', 'actions' ), true ) ) {
34 34
 		include __DIR__ . '/posts_xml.php';
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 		include FrmProAppHelper::plugin_path() . '/classes/views/xml/' . $tb_type . '_xml.php';
39 39
 	}
40 40
 
41
-	unset( $item_ids, $records[ $tb_type ], $tb_type );
41
+	unset( $item_ids, $records[$tb_type], $tb_type );
42 42
 }//end foreach
43 43
 
44 44
 /**
Please login to merge, or discard this patch.
classes/helpers/FrmAppHelper.php 2 patches
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -524,7 +524,8 @@  discard block
 block discarded – undo
524 524
 
525 525
 		if ( $src === 'get' ) {
526 526
 			$value = isset( $_POST[ $param ] ) ? wp_unslash( $_POST[ $param ] ) : ( isset( $_GET[ $param ] ) ? wp_unslash( $_GET[ $param ] ) : $default ); // phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
527
-			if ( ! isset( $_POST[ $param ] ) && isset( $_GET[ $param ] ) && ! is_array( $value ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
527
+			if ( ! isset( $_POST[ $param ] ) && isset( $_GET[ $param ] ) && ! is_array( $value ) ) {
528
+// phpcs:ignore WordPress.Security.NonceVerification.Missing
528 529
 				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
529 530
 				$value = htmlspecialchars_decode( wp_unslash( $_GET[ $param ] ) );
530 531
 			}
@@ -612,7 +613,8 @@  discard block
 block discarded – undo
612 613
 				$value = wp_unslash( $_GET[ $args['param'] ] );
613 614
 			}
614 615
 		} elseif ( $args['type'] === 'post' ) {
615
-			if ( isset( $_POST[ $args['param'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
616
+			if ( isset( $_POST[ $args['param'] ] ) ) {
617
+// phpcs:ignore WordPress.Security.NonceVerification.Missing
616 618
 				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
617 619
 				$value = wp_unslash( $_POST[ $args['param'] ] );
618 620
 				if ( $args['serialized'] === true && is_serialized_string( $value ) && is_serialized( $value ) ) {
Please login to merge, or discard this patch.
Spacing   +86 added lines, -86 removed lines patch added patch discarded remove patch
@@ -334,7 +334,7 @@  discard block
 block discarded – undo
334 334
 			'fill'   => '#4d4d4d',
335 335
 			'orange' => '#f05a24',
336 336
 		);
337
-		$atts     = array_merge( $defaults, $atts );
337
+		$atts = array_merge( $defaults, $atts );
338 338
 
339 339
 		return '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 599.68 601.37" width="' . esc_attr( $atts['width'] ) . '" height="' . esc_attr( $atts['height'] ) . '">
340 340
 			<path fill="' . esc_attr( $atts['orange'] ) . '" d="M289.6 384h140v76h-140z"/>
@@ -627,7 +627,7 @@  discard block
 block discarded – undo
627 627
 	 * @return string
628 628
 	 */
629 629
 	public static function get_server_value( $value ) {
630
-		return isset( $_SERVER[ $value ] ) ? wp_strip_all_tags( wp_unslash( $_SERVER[ $value ] ) ) : '';
630
+		return isset( $_SERVER[$value] ) ? wp_strip_all_tags( wp_unslash( $_SERVER[$value] ) ) : '';
631 631
 	}
632 632
 
633 633
 	/**
@@ -661,7 +661,7 @@  discard block
 block discarded – undo
661 661
 		$ip         = '';
662 662
 
663 663
 		foreach ( $ip_options as $key ) {
664
-			if ( ! isset( $_SERVER[ $key ] ) ) {
664
+			if ( ! isset( $_SERVER[$key] ) ) {
665 665
 				continue;
666 666
 			}
667 667
 
@@ -738,10 +738,10 @@  discard block
 block discarded – undo
738 738
 		}
739 739
 
740 740
 		if ( $src === 'get' ) {
741
-			$value = isset( $_POST[ $param ] ) ? wp_unslash( $_POST[ $param ] ) : ( isset( $_GET[ $param ] ) ? wp_unslash( $_GET[ $param ] ) : $default ); // phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
742
-			if ( ! isset( $_POST[ $param ] ) && isset( $_GET[ $param ] ) && ! is_array( $value ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
741
+			$value = isset( $_POST[$param] ) ? wp_unslash( $_POST[$param] ) : ( isset( $_GET[$param] ) ? wp_unslash( $_GET[$param] ) : $default ); // phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
742
+			if ( ! isset( $_POST[$param] ) && isset( $_GET[$param] ) && ! is_array( $value ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
743 743
 				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
744
-				$value = htmlspecialchars_decode( wp_unslash( $_GET[ $param ] ) );
744
+				$value = htmlspecialchars_decode( wp_unslash( $_GET[$param] ) );
745 745
 			}
746 746
 			self::sanitize_value( $sanitize, $value );
747 747
 		} else {
@@ -762,7 +762,7 @@  discard block
 block discarded – undo
762 762
 				}
763 763
 
764 764
 				$p     = trim( $p, ']' );
765
-				$value = $value[ $p ] ?? $default;
765
+				$value = $value[$p] ?? $default;
766 766
 			}
767 767
 		}
768 768
 
@@ -828,26 +828,26 @@  discard block
 block discarded – undo
828 828
 			'sanitize'   => 'sanitize_text_field',
829 829
 			'serialized' => false,
830 830
 		);
831
-		$args     = wp_parse_args( $args, $defaults );
831
+		$args = wp_parse_args( $args, $defaults );
832 832
 
833 833
 		$value = $args['default'];
834 834
 		if ( $args['type'] === 'get' ) {
835
-			if ( $_GET && isset( $_GET[ $args['param'] ] ) ) {
835
+			if ( $_GET && isset( $_GET[$args['param']] ) ) {
836 836
 				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
837
-				$value = wp_unslash( $_GET[ $args['param'] ] );
837
+				$value = wp_unslash( $_GET[$args['param']] );
838 838
 			}
839 839
 		} elseif ( $args['type'] === 'post' ) {
840
-			if ( isset( $_POST[ $args['param'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
840
+			if ( isset( $_POST[$args['param']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
841 841
 				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
842
-				$value = wp_unslash( $_POST[ $args['param'] ] );
842
+				$value = wp_unslash( $_POST[$args['param']] );
843 843
 				if ( $args['serialized'] === true && is_serialized_string( $value ) && is_serialized( $value ) ) {
844 844
 					self::unserialize_or_decode( $value );
845 845
 				}
846 846
 			}
847
-		} elseif ( isset( $_REQUEST[ $args['param'] ] ) ) {
847
+		} elseif ( isset( $_REQUEST[$args['param']] ) ) {
848 848
 			// phpcs:ignore WordPress.Security.NonceVerification.Missing
849 849
 				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
850
-				$value = wp_unslash( $_REQUEST[ $args['param'] ] );
850
+				$value = wp_unslash( $_REQUEST[$args['param']] );
851 851
 		}
852 852
 
853 853
 		self::sanitize_value( $args['sanitize'], $value );
@@ -895,7 +895,7 @@  discard block
 block discarded – undo
895 895
 		if ( is_array( $value ) ) {
896 896
 			$temp_values = $value;
897 897
 			foreach ( $temp_values as $k => $v ) {
898
-				self::sanitize_value( $sanitize, $value[ $k ] );
898
+				self::sanitize_value( $sanitize, $value[$k] );
899 899
 			}
900 900
 			return;
901 901
 		}
@@ -912,8 +912,8 @@  discard block
 block discarded – undo
912 912
 	public static function sanitize_request( $sanitize_method, &$values ) {
913 913
 		$temp_values = $values;
914 914
 		foreach ( $temp_values as $k => $val ) {
915
-			if ( isset( $sanitize_method[ $k ] ) ) {
916
-				$values[ $k ] = call_user_func( $sanitize_method[ $k ], $val );
915
+			if ( isset( $sanitize_method[$k] ) ) {
916
+				$values[$k] = call_user_func( $sanitize_method[$k], $val );
917 917
 			}
918 918
 		}
919 919
 	}
@@ -976,7 +976,7 @@  discard block
 block discarded – undo
976 976
 		if ( is_array( $value ) ) {
977 977
 			$temp_values = $value;
978 978
 			foreach ( $temp_values as $k => $v ) {
979
-				self::decode_specialchars( $value[ $k ] );
979
+				self::decode_specialchars( $value[$k] );
980 980
 			}
981 981
 		} else {
982 982
 			self::decode_amp( $value );
@@ -1115,7 +1115,7 @@  discard block
 block discarded – undo
1115 1115
 	 * @return array
1116 1116
 	 */
1117 1117
 	public static function add_allowed_submit_button_tags( $allowed_html ) {
1118
-		$allowed_html['input']                    = array(
1118
+		$allowed_html['input'] = array(
1119 1119
 			'type'           => true,
1120 1120
 			'value'          => true,
1121 1121
 			'formnovalidate' => true,
@@ -1142,7 +1142,7 @@  discard block
 block discarded – undo
1142 1142
 			$allowed_html = $html;
1143 1143
 		} elseif ( ! empty( $allowed ) ) {
1144 1144
 			foreach ( (array) $allowed as $a ) {
1145
-				$allowed_html[ $a ] = $html[ $a ] ?? array();
1145
+				$allowed_html[$a] = $html[$a] ?? array();
1146 1146
 			}
1147 1147
 		}
1148 1148
 
@@ -1330,8 +1330,8 @@  discard block
 block discarded – undo
1330 1330
 		}
1331 1331
 
1332 1332
 		global $wp_query;
1333
-		if ( isset( $wp_query->query_vars[ $param ] ) ) {
1334
-			$value = $wp_query->query_vars[ $param ];
1333
+		if ( isset( $wp_query->query_vars[$param] ) ) {
1334
+			$value = $wp_query->query_vars[$param];
1335 1335
 		}
1336 1336
 
1337 1337
 		return $value;
@@ -1363,9 +1363,9 @@  discard block
 block discarded – undo
1363 1363
 			'frm_keyalt_icon'       => 'frm_key_icon',
1364 1364
 			'frm_keyalt_solid_icon' => 'frm_key_solid_icon',
1365 1365
 		);
1366
-		if ( isset( $deprecated[ $icon ] ) ) {
1367
-			$icon  = $deprecated[ $icon ];
1368
-			$class = str_replace( $icon, $deprecated[ $icon ], $class );
1366
+		if ( isset( $deprecated[$icon] ) ) {
1367
+			$icon  = $deprecated[$icon];
1368
+			$class = str_replace( $icon, $deprecated[$icon], $class );
1369 1369
 		}
1370 1370
 
1371 1371
 		if ( $icon === $class ) {
@@ -1495,7 +1495,7 @@  discard block
 block discarded – undo
1495 1495
 	 * @return string|void
1496 1496
 	 */
1497 1497
 	public static function array_to_html_params( $atts, $echo = false ) {
1498
-		$callback = function () use ( $atts ) {
1498
+		$callback = function() use ( $atts ) {
1499 1499
 			if ( $atts ) {
1500 1500
 				foreach ( $atts as $key => $value ) {
1501 1501
 					echo ' ' . esc_attr( $key ) . '="' . esc_attr( $value ) . '"';
@@ -1683,7 +1683,7 @@  discard block
 block discarded – undo
1683 1683
 			'value'       => false,
1684 1684
 			'class'       => '',
1685 1685
 		);
1686
-		$atts     = array_merge( $defaults, $atts );
1686
+		$atts = array_merge( $defaults, $atts );
1687 1687
 
1688 1688
 		if ( $atts['input_id'] === 'template' && empty( $atts['tosearch'] ) ) {
1689 1689
 			$atts['tosearch'] = 'frm-card';
@@ -1761,7 +1761,7 @@  discard block
 block discarded – undo
1761 1761
 				'new_file_path' => self::plugin_path() . '/js',
1762 1762
 			)
1763 1763
 		);
1764
-		$new_file  = new FrmCreateFile( $file_atts );
1764
+		$new_file = new FrmCreateFile( $file_atts );
1765 1765
 
1766 1766
 		$files = array(
1767 1767
 			self::plugin_path() . '/js/formidable.min.js',
@@ -1978,8 +1978,8 @@  discard block
 block discarded – undo
1978 1978
 	 */
1979 1979
 	private static function get_dropdown_value_and_label_from_option( $option, $key, $args ) {
1980 1980
 		if ( is_array( $option ) ) {
1981
-			$value = $option[ $args['value_key'] ] ?? '';
1982
-			$label = $option[ $args['label_key'] ] ?? '';
1981
+			$value = $option[$args['value_key']] ?? '';
1982
+			$label = $option[$args['label_key']] ?? '';
1983 1983
 		} else {
1984 1984
 			$value = $key;
1985 1985
 			$label = $option;
@@ -2379,8 +2379,8 @@  discard block
 block discarded – undo
2379 2379
 			return $error;
2380 2380
 		}
2381 2381
 
2382
-		$nonce_value = $_REQUEST && isset( $_REQUEST[ $nonce_name ] ) ? sanitize_text_field( wp_unslash( $_REQUEST[ $nonce_name ] ) ) : '';
2383
-		if ( $_REQUEST && ( ! isset( $_REQUEST[ $nonce_name ] ) || ! wp_verify_nonce( $nonce_value, $nonce ) ) ) {
2382
+		$nonce_value = $_REQUEST && isset( $_REQUEST[$nonce_name] ) ? sanitize_text_field( wp_unslash( $_REQUEST[$nonce_name] ) ) : '';
2383
+		if ( $_REQUEST && ( ! isset( $_REQUEST[$nonce_name] ) || ! wp_verify_nonce( $nonce_value, $nonce ) ) ) {
2384 2384
 			$frm_settings = self::get_settings();
2385 2385
 			$error        = $frm_settings->admin_permission;
2386 2386
 		}
@@ -2434,7 +2434,7 @@  discard block
 block discarded – undo
2434 2434
 			} else {
2435 2435
 				foreach ( $value as $k => $v ) {
2436 2436
 					if ( ! is_array( $v ) ) {
2437
-						$value[ $k ] = call_user_func( $original_function, $v );
2437
+						$value[$k] = call_user_func( $original_function, $v );
2438 2438
 					}
2439 2439
 				}
2440 2440
 			}
@@ -2487,7 +2487,7 @@  discard block
 block discarded – undo
2487 2487
 			if ( is_array( $value ) ) {
2488 2488
 				$return = array_merge( $return, self::array_flatten( $value, $keys ) );
2489 2489
 			} elseif ( $keys === 'keep' ) {
2490
-					$return[ $key ] = $value;
2490
+					$return[$key] = $value;
2491 2491
 			} else {
2492 2492
 				$return[] = $value;
2493 2493
 			}
@@ -2579,11 +2579,11 @@  discard block
 block discarded – undo
2579 2579
 		}
2580 2580
 
2581 2581
 		$ver = $default;
2582
-		if ( ! isset( $wp_scripts->registered[ $handle ] ) ) {
2582
+		if ( ! isset( $wp_scripts->registered[$handle] ) ) {
2583 2583
 			return $ver;
2584 2584
 		}
2585 2585
 
2586
-		$query = $wp_scripts->registered[ $handle ];
2586
+		$query = $wp_scripts->registered[$handle];
2587 2587
 		if ( is_object( $query ) && ! empty( $query->ver ) ) {
2588 2588
 			$ver = $query->ver;
2589 2589
 		}
@@ -2600,7 +2600,7 @@  discard block
 block discarded – undo
2600 2600
 	 * @return string|null
2601 2601
 	 */
2602 2602
 	public static function js_redirect( $url, $echo = false ) {
2603
-		$callback = function () use ( $url ) {
2603
+		$callback = function() use ( $url ) {
2604 2604
 			echo '<script type="text/javascript">window.location="' . esc_url_raw( $url ) . '"</script>';
2605 2605
 		};
2606 2606
 		return self::clip( $callback, $echo );
@@ -2701,7 +2701,7 @@  discard block
 block discarded – undo
2701 2701
 			$suffix = 2;
2702 2702
 			do {
2703 2703
 				$key_check = $key . $separator . $suffix;
2704
-				++$suffix;
2704
+				++ $suffix;
2705 2705
 			} while ( in_array( $key_check, $similar_keys, true ) );
2706 2706
 
2707 2707
 			$key = $key_check;
@@ -2815,7 +2815,7 @@  discard block
 block discarded – undo
2815 2815
 
2816 2816
 		foreach ( array( 'name', 'description' ) as $var ) {
2817 2817
 			$default_val    = $record->{$var} ?? '';
2818
-			$values[ $var ] = self::get_param( $var, $default_val, 'get', 'wp_kses_post' );
2818
+			$values[$var] = self::get_param( $var, $default_val, 'get', 'wp_kses_post' );
2819 2819
 			unset( $var, $default_val );
2820 2820
 		}
2821 2821
 
@@ -2888,9 +2888,9 @@  discard block
 block discarded – undo
2888 2888
 			$meta_value = FrmEntryMeta::get_meta_value( $record, $field->id );
2889 2889
 		}//end if
2890 2890
 
2891
-		$field_type = $post_values['field_options'][ 'type_' . $field->id ] ?? $field->type;
2892
-		if ( isset( $post_values['item_meta'][ $field->id ] ) ) {
2893
-			$new_value = $post_values['item_meta'][ $field->id ];
2891
+		$field_type = $post_values['field_options']['type_' . $field->id] ?? $field->type;
2892
+		if ( isset( $post_values['item_meta'][$field->id] ) ) {
2893
+			$new_value = $post_values['item_meta'][$field->id];
2894 2894
 			self::unserialize_or_decode( $new_value );
2895 2895
 		} else {
2896 2896
 			$new_value = $meta_value;
@@ -2911,7 +2911,7 @@  discard block
 block discarded – undo
2911 2911
 
2912 2912
 		$field_array = array_merge( (array) $field->field_options, $field_array );
2913 2913
 
2914
-		$values['fields'][ $field->id ] = $field_array;
2914
+		$values['fields'][$field->id] = $field_array;
2915 2915
 	}
2916 2916
 
2917 2917
 	/**
@@ -2961,11 +2961,11 @@  discard block
 block discarded – undo
2961 2961
 		}
2962 2962
 
2963 2963
 		foreach ( $form->options as $opt => $value ) {
2964
-			if ( isset( $post_values[ $opt ] ) ) {
2965
-				$values[ $opt ] = $post_values[ $opt ];
2966
-				self::unserialize_or_decode( $values[ $opt ] );
2964
+			if ( isset( $post_values[$opt] ) ) {
2965
+				$values[$opt] = $post_values[$opt];
2966
+				self::unserialize_or_decode( $values[$opt] );
2967 2967
 			} else {
2968
-				$values[ $opt ] = $value;
2968
+				$values[$opt] = $value;
2969 2969
 			}
2970 2970
 		}
2971 2971
 
@@ -2984,8 +2984,8 @@  discard block
 block discarded – undo
2984 2984
 		$form_defaults = FrmFormsHelper::get_default_opts();
2985 2985
 
2986 2986
 		foreach ( $form_defaults as $opt => $default ) {
2987
-			if ( ! isset( $values[ $opt ] ) || $values[ $opt ] == '' ) {
2988
-				$values[ $opt ] = $post_values && isset( $post_values['options'][ $opt ] ) ? $post_values['options'][ $opt ] : $default;
2987
+			if ( ! isset( $values[$opt] ) || $values[$opt] == '' ) {
2988
+				$values[$opt] = $post_values && isset( $post_values['options'][$opt] ) ? $post_values['options'][$opt] : $default;
2989 2989
 			}
2990 2990
 
2991 2991
 			unset( $opt, $default );
@@ -2996,8 +2996,8 @@  discard block
 block discarded – undo
2996 2996
 		}
2997 2997
 
2998 2998
 		foreach ( array( 'before', 'after', 'submit' ) as $h ) {
2999
-			if ( ! isset( $values[ $h . '_html' ] ) ) {
3000
-				$values[ $h . '_html' ] = ( $post_values['options'][ $h . '_html' ] ?? FrmFormsHelper::get_default_html( $h ) );
2999
+			if ( ! isset( $values[$h . '_html'] ) ) {
3000
+				$values[$h . '_html'] = ( $post_values['options'][$h . '_html'] ?? FrmFormsHelper::get_default_html( $h ) );
3001 3001
 			}
3002 3002
 			unset( $h );
3003 3003
 		}
@@ -3215,12 +3215,12 @@  discard block
 block discarded – undo
3215 3215
 		if ( ! is_numeric( $levels ) ) {
3216 3216
 			// Show time in specified unit.
3217 3217
 			$levels = self::get_unit( $levels );
3218
-			if ( isset( $time_strings[ $levels ] ) ) {
3218
+			if ( isset( $time_strings[$levels] ) ) {
3219 3219
 				$diff         = array(
3220 3220
 					$levels => self::time_format( $levels, $diff ),
3221 3221
 				);
3222 3222
 				$time_strings = array(
3223
-					$levels => $time_strings[ $levels ],
3223
+					$levels => $time_strings[$levels],
3224 3224
 				);
3225 3225
 			}
3226 3226
 
@@ -3228,13 +3228,13 @@  discard block
 block discarded – undo
3228 3228
 		}
3229 3229
 
3230 3230
 		foreach ( $time_strings as $k => $v ) {
3231
-			if ( isset( $diff[ $k ] ) && $diff[ $k ] ) {
3232
-				$time_strings[ $k ] = $diff[ $k ] . ' ' . ( $diff[ $k ] > 1 ? $v[1] : $v[0] );
3233
-			} elseif ( isset( $diff[ $k ] ) && count( $time_strings ) === 1 ) {
3231
+			if ( isset( $diff[$k] ) && $diff[$k] ) {
3232
+				$time_strings[$k] = $diff[$k] . ' ' . ( $diff[$k] > 1 ? $v[1] : $v[0] );
3233
+			} elseif ( isset( $diff[$k] ) && count( $time_strings ) === 1 ) {
3234 3234
 				// Account for 0.
3235
-				$time_strings[ $k ] = $diff[ $k ] . ' ' . $v[1];
3235
+				$time_strings[$k] = $diff[$k] . ' ' . $v[1];
3236 3236
 			} else {
3237
-				unset( $time_strings[ $k ] );
3237
+				unset( $time_strings[$k] );
3238 3238
 			}
3239 3239
 		}
3240 3240
 
@@ -3258,8 +3258,8 @@  discard block
 block discarded – undo
3258 3258
 			'y' => 'y',
3259 3259
 			'd' => 'days',
3260 3260
 		);
3261
-		if ( isset( $return[ $unit ] ) ) {
3262
-			return $diff[ $return[ $unit ] ];
3261
+		if ( isset( $return[$unit] ) ) {
3262
+			return $diff[$return[$unit]];
3263 3263
 		}
3264 3264
 
3265 3265
 		$total = $diff['days'] * self::convert_time( 'd', $unit );
@@ -3267,11 +3267,11 @@  discard block
 block discarded – undo
3267 3267
 		$times = array( 'h', 'i', 's' );
3268 3268
 
3269 3269
 		foreach ( $times as $time ) {
3270
-			if ( ! isset( $diff[ $time ] ) ) {
3270
+			if ( ! isset( $diff[$time] ) ) {
3271 3271
 				continue;
3272 3272
 			}
3273 3273
 
3274
-			$total += $diff[ $time ] * self::convert_time( $time, $unit );
3274
+			$total += $diff[$time] * self::convert_time( $time, $unit );
3275 3275
 		}
3276 3276
 
3277 3277
 		return floor( $total );
@@ -3296,7 +3296,7 @@  discard block
 block discarded – undo
3296 3296
 			'y' => DAY_IN_SECONDS * 365.25,
3297 3297
 		);
3298 3298
 
3299
-		return $convert[ $from ] / $convert[ $to ];
3299
+		return $convert[$from] / $convert[$to];
3300 3300
 	}
3301 3301
 
3302 3302
 	/**
@@ -3308,7 +3308,7 @@  discard block
 block discarded – undo
3308 3308
 	 */
3309 3309
 	private static function get_unit( $unit ) {
3310 3310
 		$units = self::get_time_strings();
3311
-		if ( isset( $units[ $unit ] ) || is_numeric( $unit ) ) {
3311
+		if ( isset( $units[$unit] ) || is_numeric( $unit ) ) {
3312 3312
 			return $unit;
3313 3313
 		}
3314 3314
 
@@ -3429,17 +3429,17 @@  discard block
 block discarded – undo
3429 3429
 
3430 3430
 					case 1:
3431 3431
 						$l2 = $name;
3432
-						self::add_value_to_array( $name, $l2, $this_val, $vars[ $l1 ] );
3432
+						self::add_value_to_array( $name, $l2, $this_val, $vars[$l1] );
3433 3433
 						break;
3434 3434
 
3435 3435
 					case 2:
3436 3436
 						$l3 = $name;
3437
-						self::add_value_to_array( $name, $l3, $this_val, $vars[ $l1 ][ $l2 ] );
3437
+						self::add_value_to_array( $name, $l3, $this_val, $vars[$l1][$l2] );
3438 3438
 						break;
3439 3439
 
3440 3440
 					case 3:
3441 3441
 						$l4 = $name;
3442
-						self::add_value_to_array( $name, $l4, $this_val, $vars[ $l1 ][ $l2 ][ $l3 ] );
3442
+						self::add_value_to_array( $name, $l4, $this_val, $vars[$l1][$l2][$l3] );
3443 3443
 				}
3444 3444
 
3445 3445
 				unset( $this_val, $n );
@@ -3462,8 +3462,8 @@  discard block
 block discarded – undo
3462 3462
 	public static function add_value_to_array( $name, $l1, $val, &$vars ) {
3463 3463
 		if ( $name == '' ) {
3464 3464
 			$vars[] = $val;
3465
-		} elseif ( ! isset( $vars[ $l1 ] ) ) {
3466
-			$vars[ $l1 ] = $val;
3465
+		} elseif ( ! isset( $vars[$l1] ) ) {
3466
+			$vars[$l1] = $val;
3467 3467
 		}
3468 3468
 	}
3469 3469
 
@@ -3487,7 +3487,7 @@  discard block
 block discarded – undo
3487 3487
 			'new_tab'       => __( 'This option will open the link in a new browser tab. Please note that some popup blockers may prevent this from happening, in which case the link will be displayed.', 'formidable' ),
3488 3488
 		);
3489 3489
 
3490
-		if ( ! isset( $tooltips[ $name ] ) ) {
3490
+		if ( ! isset( $tooltips[$name] ) ) {
3491 3491
 			return;
3492 3492
 		}
3493 3493
 
@@ -3497,7 +3497,7 @@  discard block
 block discarded – undo
3497 3497
 			echo ' class="frm_help"';
3498 3498
 		}
3499 3499
 
3500
-		echo ' title="' . esc_attr( $tooltips[ $name ] );
3500
+		echo ' title="' . esc_attr( $tooltips[$name] );
3501 3501
 
3502 3502
 		if ( 'open' != $class ) {
3503 3503
 			echo '"';
@@ -3569,13 +3569,13 @@  discard block
 block discarded – undo
3569 3569
 	 * @return void
3570 3570
 	 */
3571 3571
 	private static function prepare_action_slashes( $val, $key, &$post_content ) {
3572
-		if ( ! isset( $post_content[ $key ] ) || is_numeric( $val ) ) {
3572
+		if ( ! isset( $post_content[$key] ) || is_numeric( $val ) ) {
3573 3573
 			return;
3574 3574
 		}
3575 3575
 
3576 3576
 		if ( is_array( $val ) ) {
3577 3577
 			foreach ( $val as $k1 => $v1 ) {
3578
-				self::prepare_action_slashes( $v1, $k1, $post_content[ $key ] );
3578
+				self::prepare_action_slashes( $v1, $k1, $post_content[$key] );
3579 3579
 				unset( $k1, $v1 );
3580 3580
 			}
3581 3581
 		} else {
@@ -3583,7 +3583,7 @@  discard block
 block discarded – undo
3583 3583
 			$val = stripslashes( $val );
3584 3584
 
3585 3585
 			// Add backslashes before double quotes and forward slashes only
3586
-			$post_content[ $key ] = addcslashes( $val, '"\\/' );
3586
+			$post_content[$key] = addcslashes( $val, '"\\/' );
3587 3587
 		}
3588 3588
 	}
3589 3589
 
@@ -3713,14 +3713,14 @@  discard block
 block discarded – undo
3713 3713
 			}
3714 3714
 
3715 3715
 			$key = $input['name'];
3716
-			if ( isset( $formatted[ $key ] ) ) {
3717
-				if ( is_array( $formatted[ $key ] ) ) {
3718
-					$formatted[ $key ][] = $input['value'];
3716
+			if ( isset( $formatted[$key] ) ) {
3717
+				if ( is_array( $formatted[$key] ) ) {
3718
+					$formatted[$key][] = $input['value'];
3719 3719
 				} else {
3720
-					$formatted[ $key ] = array( $formatted[ $key ], $input['value'] );
3720
+					$formatted[$key] = array( $formatted[$key], $input['value'] );
3721 3721
 				}
3722 3722
 			} else {
3723
-				$formatted[ $key ] = $input['value'];
3723
+				$formatted[$key] = $input['value'];
3724 3724
 			}
3725 3725
 		}
3726 3726
 
@@ -4444,8 +4444,8 @@  discard block
 block discarded – undo
4444 4444
 		}
4445 4445
 
4446 4446
 		foreach ( $keys as $key ) {
4447
-			if ( isset( $values[ $key ] ) ) {
4448
-				$values[ $key ] = self::kses( $values[ $key ], 'all' );
4447
+			if ( isset( $values[$key] ) ) {
4448
+				$values[$key] = self::kses( $values[$key], 'all' );
4449 4449
 			}
4450 4450
 		}
4451 4451
 
@@ -4512,7 +4512,7 @@  discard block
 block discarded – undo
4512 4512
 				'role',
4513 4513
 				'style',
4514 4514
 			);
4515
-			$safe      = in_array( $key, $safe_keys, true );
4515
+			$safe = in_array( $key, $safe_keys, true );
4516 4516
 		}//end if
4517 4517
 
4518 4518
 		/**
@@ -4656,7 +4656,7 @@  discard block
 block discarded – undo
4656 4656
 			return 0;
4657 4657
 		}
4658 4658
 
4659
-		return strlen( $parts[ count( $parts ) - 1 ] );
4659
+		return strlen( $parts[count( $parts ) - 1] );
4660 4660
 	}
4661 4661
 
4662 4662
 	/**
@@ -4676,7 +4676,7 @@  discard block
 block discarded – undo
4676 4676
 
4677 4677
 		add_filter(
4678 4678
 			'option_gmt_offset',
4679
-			function ( $offset ) {
4679
+			function( $offset ) {
4680 4680
 				if ( ! is_string( $offset ) || is_numeric( $offset ) ) {
4681 4681
 					// Leave a valid value alone.
4682 4682
 					return $offset;
@@ -4775,7 +4775,7 @@  discard block
 block discarded – undo
4775 4775
 			return;
4776 4776
 		}
4777 4777
 
4778
-		$ajax_callback = function () use ( $option ) {
4778
+		$ajax_callback = function() use ( $option ) {
4779 4779
 			self::dismiss_warning_message( $option );
4780 4780
 		};
4781 4781
 
@@ -4785,7 +4785,7 @@  discard block
 block discarded – undo
4785 4785
 
4786 4786
 		add_filter(
4787 4787
 			'frm_message_list',
4788
-			function ( $show_messages ) use ( $message, $option ) {
4788
+			function( $show_messages ) use ( $message, $option ) {
4789 4789
 				if ( get_option( $option, false ) ) {
4790 4790
 					return $show_messages;
4791 4791
 				}
Please login to merge, or discard this patch.
formidable.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -148,7 +148,7 @@
 block discarded – undo
148 148
 
149 149
 register_deactivation_hook(
150 150
 	__FILE__,
151
-	function () {
151
+	function() {
152 152
 		if ( ! class_exists( 'FrmCronController', false ) ) {
153 153
 			require_once __DIR__ . '/classes/controllers/FrmCronController.php';
154 154
 		}
Please login to merge, or discard this patch.
stripe/controllers/FrmStrpLiteLinkController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -149,7 +149,7 @@
 block discarded – undo
149 149
 			'form'  => $entry->form_id,
150 150
 			'value' => $action->post_content['description'],
151 151
 		);
152
-		$new_values     = array( 'description' => FrmTransLiteAppHelper::process_shortcodes( $shortcode_atts ) );
152
+		$new_values = array( 'description' => FrmTransLiteAppHelper::process_shortcodes( $shortcode_atts ) );
153 153
 		FrmStrpLiteAppHelper::call_stripe_helper_class( 'update_intent', $intent->id, $new_values );
154 154
 	}
155 155
 
Please login to merge, or discard this patch.
classes/views/frm-forms/form.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@
 block discarded – undo
52 52
 			$grid_helper     = new FrmFieldGridHelper();
53 53
 			$values['count'] = 0;
54 54
 			foreach ( $values['fields'] as $field ) {
55
-				++$values['count'];
55
+				++ $values['count'];
56 56
 				$grid_helper->set_field( $field );
57 57
 				$grid_helper->maybe_begin_field_wrapper();
58 58
 				FrmFieldsController::load_single_field( $field, $values );
Please login to merge, or discard this patch.