Completed
Pull Request — master (#2603)
by
unknown
40s
created
classes/controllers/FrmOnboardingWizardController.php 2 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -138,7 +138,8 @@
 block discarded – undo
138 138
 		}
139 139
 
140 140
 		// Only do this for single site installs.
141
-		if ( is_network_admin() ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
141
+		if ( is_network_admin() ) {
142
+// phpcs:ignore WordPress.Security.NonceVerification.Missing
142 143
 			self::mark_onboarding_as_skipped();
143 144
 			return;
144 145
 		}
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -368,8 +368,8 @@  discard block
 block discarded – undo
368 368
 		);
369 369
 
370 370
 		foreach ( $fields_to_update as $field => $sanitize_callback ) {
371
-			if ( isset( $_POST[ $field ] ) ) {
372
-				$usage_data[ $field ] = FrmAppHelper::get_post_param( $field, '', $sanitize_callback );
371
+			if ( isset( $_POST[$field] ) ) {
372
+				$usage_data[$field] = FrmAppHelper::get_post_param( $field, '', $sanitize_callback );
373 373
 			}
374 374
 		}
375 375
 
@@ -588,7 +588,7 @@  discard block
 block discarded – undo
588 588
 				'is-disabled' => true,
589 589
 				'help-text'   => esc_html__( 'Customize form appearance with an intuitive styling interface.', 'formidable' ),
590 590
 			);
591
-			self::$available_addons['save-entries']  = array(
591
+			self::$available_addons['save-entries'] = array(
592 592
 				'title'       => esc_html__( 'Save Entries', 'formidable' ),
593 593
 				'is-checked'  => true,
594 594
 				'is-disabled' => true,
@@ -657,7 +657,7 @@  discard block
 block discarded – undo
657 657
 				if ( ! is_plugin_active( $plugin_file ) && isset( $addon['url'] ) ) {
658 658
 					$is_installed = array_key_exists( $plugin_file, $plugins );
659 659
 
660
-					self::$available_addons[ $key ] = array(
660
+					self::$available_addons[$key] = array(
661 661
 						'title'        => $data['title'],
662 662
 						'rel'          => $is_installed ? $plugin_file : $addon['url'],
663 663
 						'is-checked'   => false,
Please login to merge, or discard this patch.
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/styles/manage.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
34 34
 					 * @param string         $row_view_file_path
35 35
 					 * @return void
36 36
 					 */
37
-					function ( $form ) use ( $styles, $default_style, $row_view_file_path ) {
37
+					function( $form ) use ( $styles, $default_style, $row_view_file_path ) {
38 38
 						$active_style_id = isset( $form->options['custom_style'] ) ? (int) $form->options['custom_style'] : 1;
39 39
 						if ( 1 === $active_style_id ) {
40 40
 							// use the default style
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
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
 			'fill'   => '#4d4d4d',
328 328
 			'orange' => '#f05a24',
329 329
 		);
330
-		$atts     = array_merge( $defaults, $atts );
330
+		$atts = array_merge( $defaults, $atts );
331 331
 
332 332
 		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'] ) . '">
333 333
 			<path fill="' . esc_attr( $atts['orange'] ) . '" d="M289.6 384h140v76h-140z"/>
@@ -615,7 +615,7 @@  discard block
 block discarded – undo
615 615
 	 * @return string
616 616
 	 */
617 617
 	public static function get_server_value( $value ) {
618
-		return isset( $_SERVER[ $value ] ) ? wp_strip_all_tags( wp_unslash( $_SERVER[ $value ] ) ) : '';
618
+		return isset( $_SERVER[$value] ) ? wp_strip_all_tags( wp_unslash( $_SERVER[$value] ) ) : '';
619 619
 	}
620 620
 
621 621
 	/**
@@ -649,7 +649,7 @@  discard block
 block discarded – undo
649 649
 		$ip         = '';
650 650
 
651 651
 		foreach ( $ip_options as $key ) {
652
-			if ( ! isset( $_SERVER[ $key ] ) ) {
652
+			if ( ! isset( $_SERVER[$key] ) ) {
653 653
 				continue;
654 654
 			}
655 655
 
@@ -726,10 +726,10 @@  discard block
 block discarded – undo
726 726
 		}
727 727
 
728 728
 		if ( $src === 'get' ) {
729
-			$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
730
-			if ( ! isset( $_POST[ $param ] ) && isset( $_GET[ $param ] ) && ! is_array( $value ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
729
+			$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
730
+			if ( ! isset( $_POST[$param] ) && isset( $_GET[$param] ) && ! is_array( $value ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
731 731
 				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
732
-				$value = htmlspecialchars_decode( wp_unslash( $_GET[ $param ] ) );
732
+				$value = htmlspecialchars_decode( wp_unslash( $_GET[$param] ) );
733 733
 			}
734 734
 			self::sanitize_value( $sanitize, $value );
735 735
 		} else {
@@ -750,7 +750,7 @@  discard block
 block discarded – undo
750 750
 				}
751 751
 
752 752
 				$p     = trim( $p, ']' );
753
-				$value = $value[ $p ] ?? $default;
753
+				$value = $value[$p] ?? $default;
754 754
 			}
755 755
 		}
756 756
 
@@ -815,26 +815,26 @@  discard block
 block discarded – undo
815 815
 			'sanitize'   => 'sanitize_text_field',
816 816
 			'serialized' => false,
817 817
 		);
818
-		$args     = wp_parse_args( $args, $defaults );
818
+		$args = wp_parse_args( $args, $defaults );
819 819
 
820 820
 		$value = $args['default'];
821 821
 		if ( $args['type'] === 'get' ) {
822
-			if ( $_GET && isset( $_GET[ $args['param'] ] ) ) {
822
+			if ( $_GET && isset( $_GET[$args['param']] ) ) {
823 823
 				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
824
-				$value = wp_unslash( $_GET[ $args['param'] ] );
824
+				$value = wp_unslash( $_GET[$args['param']] );
825 825
 			}
826 826
 		} elseif ( $args['type'] === 'post' ) {
827
-			if ( isset( $_POST[ $args['param'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
827
+			if ( isset( $_POST[$args['param']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
828 828
 				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
829
-				$value = wp_unslash( $_POST[ $args['param'] ] );
829
+				$value = wp_unslash( $_POST[$args['param']] );
830 830
 				if ( $args['serialized'] === true && is_serialized_string( $value ) && is_serialized( $value ) ) {
831 831
 					self::unserialize_or_decode( $value );
832 832
 				}
833 833
 			}
834
-		} elseif ( isset( $_REQUEST[ $args['param'] ] ) ) {
834
+		} elseif ( isset( $_REQUEST[$args['param']] ) ) {
835 835
 			// phpcs:ignore WordPress.Security.NonceVerification.Missing
836 836
 				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
837
-				$value = wp_unslash( $_REQUEST[ $args['param'] ] );
837
+				$value = wp_unslash( $_REQUEST[$args['param']] );
838 838
 		}
839 839
 
840 840
 		self::sanitize_value( $args['sanitize'], $value );
@@ -881,7 +881,7 @@  discard block
 block discarded – undo
881 881
 		if ( is_array( $value ) ) {
882 882
 			$temp_values = $value;
883 883
 			foreach ( $temp_values as $k => $v ) {
884
-				self::sanitize_value( $sanitize, $value[ $k ] );
884
+				self::sanitize_value( $sanitize, $value[$k] );
885 885
 			}
886 886
 			return;
887 887
 		}
@@ -898,8 +898,8 @@  discard block
 block discarded – undo
898 898
 	public static function sanitize_request( $sanitize_method, &$values ) {
899 899
 		$temp_values = $values;
900 900
 		foreach ( $temp_values as $k => $val ) {
901
-			if ( isset( $sanitize_method[ $k ] ) ) {
902
-				$values[ $k ] = call_user_func( $sanitize_method[ $k ], $val );
901
+			if ( isset( $sanitize_method[$k] ) ) {
902
+				$values[$k] = call_user_func( $sanitize_method[$k], $val );
903 903
 			}
904 904
 		}
905 905
 	}
@@ -961,7 +961,7 @@  discard block
 block discarded – undo
961 961
 		if ( is_array( $value ) ) {
962 962
 			$temp_values = $value;
963 963
 			foreach ( $temp_values as $k => $v ) {
964
-				self::decode_specialchars( $value[ $k ] );
964
+				self::decode_specialchars( $value[$k] );
965 965
 			}
966 966
 		} else {
967 967
 			self::decode_amp( $value );
@@ -1096,7 +1096,7 @@  discard block
 block discarded – undo
1096 1096
 	 * @return array
1097 1097
 	 */
1098 1098
 	public static function add_allowed_submit_button_tags( $allowed_html ) {
1099
-		$allowed_html['input']                    = array(
1099
+		$allowed_html['input'] = array(
1100 1100
 			'type'           => true,
1101 1101
 			'value'          => true,
1102 1102
 			'formnovalidate' => true,
@@ -1122,7 +1122,7 @@  discard block
 block discarded – undo
1122 1122
 			$allowed_html = $html;
1123 1123
 		} elseif ( ! empty( $allowed ) ) {
1124 1124
 			foreach ( (array) $allowed as $a ) {
1125
-				$allowed_html[ $a ] = $html[ $a ] ?? array();
1125
+				$allowed_html[$a] = $html[$a] ?? array();
1126 1126
 			}
1127 1127
 		}
1128 1128
 
@@ -1310,8 +1310,8 @@  discard block
 block discarded – undo
1310 1310
 		}
1311 1311
 
1312 1312
 		global $wp_query;
1313
-		if ( isset( $wp_query->query_vars[ $param ] ) ) {
1314
-			$value = $wp_query->query_vars[ $param ];
1313
+		if ( isset( $wp_query->query_vars[$param] ) ) {
1314
+			$value = $wp_query->query_vars[$param];
1315 1315
 		}
1316 1316
 
1317 1317
 		return $value;
@@ -1342,9 +1342,9 @@  discard block
 block discarded – undo
1342 1342
 			'frm_keyalt_icon'       => 'frm_key_icon',
1343 1343
 			'frm_keyalt_solid_icon' => 'frm_key_solid_icon',
1344 1344
 		);
1345
-		if ( isset( $deprecated[ $icon ] ) ) {
1346
-			$icon  = $deprecated[ $icon ];
1347
-			$class = str_replace( $icon, $deprecated[ $icon ], $class );
1345
+		if ( isset( $deprecated[$icon] ) ) {
1346
+			$icon  = $deprecated[$icon];
1347
+			$class = str_replace( $icon, $deprecated[$icon], $class );
1348 1348
 		}
1349 1349
 
1350 1350
 		if ( $icon === $class ) {
@@ -1467,7 +1467,7 @@  discard block
 block discarded – undo
1467 1467
 	 * @return string|void
1468 1468
 	 */
1469 1469
 	public static function array_to_html_params( $atts, $echo = false ) {
1470
-		$callback = function () use ( $atts ) {
1470
+		$callback = function() use ( $atts ) {
1471 1471
 			if ( $atts ) {
1472 1472
 				foreach ( $atts as $key => $value ) {
1473 1473
 					echo ' ' . esc_attr( $key ) . '="' . esc_attr( $value ) . '"';
@@ -1648,7 +1648,7 @@  discard block
 block discarded – undo
1648 1648
 			'value'       => false,
1649 1649
 			'class'       => '',
1650 1650
 		);
1651
-		$atts     = array_merge( $defaults, $atts );
1651
+		$atts = array_merge( $defaults, $atts );
1652 1652
 
1653 1653
 		if ( $atts['input_id'] === 'template' && empty( $atts['tosearch'] ) ) {
1654 1654
 			$atts['tosearch'] = 'frm-card';
@@ -1725,7 +1725,7 @@  discard block
 block discarded – undo
1725 1725
 				'new_file_path' => self::plugin_path() . '/js',
1726 1726
 			)
1727 1727
 		);
1728
-		$new_file  = new FrmCreateFile( $file_atts );
1728
+		$new_file = new FrmCreateFile( $file_atts );
1729 1729
 
1730 1730
 		$files = array(
1731 1731
 			self::plugin_path() . '/js/formidable.min.js',
@@ -1939,8 +1939,8 @@  discard block
 block discarded – undo
1939 1939
 	 */
1940 1940
 	private static function get_dropdown_value_and_label_from_option( $option, $key, $args ) {
1941 1941
 		if ( is_array( $option ) ) {
1942
-			$value = $option[ $args['value_key'] ] ?? '';
1943
-			$label = $option[ $args['label_key'] ] ?? '';
1942
+			$value = $option[$args['value_key']] ?? '';
1943
+			$label = $option[$args['label_key']] ?? '';
1944 1944
 		} else {
1945 1945
 			$value = $key;
1946 1946
 			$label = $option;
@@ -2334,8 +2334,8 @@  discard block
 block discarded – undo
2334 2334
 			return $error;
2335 2335
 		}
2336 2336
 
2337
-		$nonce_value = $_REQUEST && isset( $_REQUEST[ $nonce_name ] ) ? sanitize_text_field( wp_unslash( $_REQUEST[ $nonce_name ] ) ) : '';
2338
-		if ( $_REQUEST && ( ! isset( $_REQUEST[ $nonce_name ] ) || ! wp_verify_nonce( $nonce_value, $nonce ) ) ) {
2337
+		$nonce_value = $_REQUEST && isset( $_REQUEST[$nonce_name] ) ? sanitize_text_field( wp_unslash( $_REQUEST[$nonce_name] ) ) : '';
2338
+		if ( $_REQUEST && ( ! isset( $_REQUEST[$nonce_name] ) || ! wp_verify_nonce( $nonce_value, $nonce ) ) ) {
2339 2339
 			$frm_settings = self::get_settings();
2340 2340
 			$error        = $frm_settings->admin_permission;
2341 2341
 		}
@@ -2389,7 +2389,7 @@  discard block
 block discarded – undo
2389 2389
 			} else {
2390 2390
 				foreach ( $value as $k => $v ) {
2391 2391
 					if ( ! is_array( $v ) ) {
2392
-						$value[ $k ] = call_user_func( $original_function, $v );
2392
+						$value[$k] = call_user_func( $original_function, $v );
2393 2393
 					}
2394 2394
 				}
2395 2395
 			}
@@ -2440,7 +2440,7 @@  discard block
 block discarded – undo
2440 2440
 			if ( is_array( $value ) ) {
2441 2441
 				$return = array_merge( $return, self::array_flatten( $value, $keys ) );
2442 2442
 			} elseif ( $keys === 'keep' ) {
2443
-					$return[ $key ] = $value;
2443
+					$return[$key] = $value;
2444 2444
 			} else {
2445 2445
 				$return[] = $value;
2446 2446
 			}
@@ -2527,11 +2527,11 @@  discard block
 block discarded – undo
2527 2527
 		}
2528 2528
 
2529 2529
 		$ver = $default;
2530
-		if ( ! isset( $wp_scripts->registered[ $handle ] ) ) {
2530
+		if ( ! isset( $wp_scripts->registered[$handle] ) ) {
2531 2531
 			return $ver;
2532 2532
 		}
2533 2533
 
2534
-		$query = $wp_scripts->registered[ $handle ];
2534
+		$query = $wp_scripts->registered[$handle];
2535 2535
 		if ( is_object( $query ) && ! empty( $query->ver ) ) {
2536 2536
 			$ver = $query->ver;
2537 2537
 		}
@@ -2547,7 +2547,7 @@  discard block
 block discarded – undo
2547 2547
 	 * @return string|null
2548 2548
 	 */
2549 2549
 	public static function js_redirect( $url, $echo = false ) {
2550
-		$callback = function () use ( $url ) {
2550
+		$callback = function() use ( $url ) {
2551 2551
 			echo '<script type="text/javascript">window.location="' . esc_url_raw( $url ) . '"</script>';
2552 2552
 		};
2553 2553
 		return self::clip( $callback, $echo );
@@ -2647,7 +2647,7 @@  discard block
 block discarded – undo
2647 2647
 			$suffix = 2;
2648 2648
 			do {
2649 2649
 				$key_check = $key . $separator . $suffix;
2650
-				++$suffix;
2650
+				++ $suffix;
2651 2651
 			} while ( in_array( $key_check, $similar_keys, true ) );
2652 2652
 
2653 2653
 			$key = $key_check;
@@ -2757,7 +2757,7 @@  discard block
 block discarded – undo
2757 2757
 
2758 2758
 		foreach ( array( 'name', 'description' ) as $var ) {
2759 2759
 			$default_val    = $record->{$var} ?? '';
2760
-			$values[ $var ] = self::get_param( $var, $default_val, 'get', 'wp_kses_post' );
2760
+			$values[$var] = self::get_param( $var, $default_val, 'get', 'wp_kses_post' );
2761 2761
 			unset( $var, $default_val );
2762 2762
 		}
2763 2763
 
@@ -2829,9 +2829,9 @@  discard block
 block discarded – undo
2829 2829
 			$meta_value = FrmEntryMeta::get_meta_value( $record, $field->id );
2830 2830
 		}//end if
2831 2831
 
2832
-		$field_type = $post_values['field_options'][ 'type_' . $field->id ] ?? $field->type;
2833
-		if ( isset( $post_values['item_meta'][ $field->id ] ) ) {
2834
-			$new_value = $post_values['item_meta'][ $field->id ];
2832
+		$field_type = $post_values['field_options']['type_' . $field->id] ?? $field->type;
2833
+		if ( isset( $post_values['item_meta'][$field->id] ) ) {
2834
+			$new_value = $post_values['item_meta'][$field->id];
2835 2835
 			self::unserialize_or_decode( $new_value );
2836 2836
 		} else {
2837 2837
 			$new_value = $meta_value;
@@ -2852,7 +2852,7 @@  discard block
 block discarded – undo
2852 2852
 
2853 2853
 		$field_array = array_merge( (array) $field->field_options, $field_array );
2854 2854
 
2855
-		$values['fields'][ $field->id ] = $field_array;
2855
+		$values['fields'][$field->id] = $field_array;
2856 2856
 	}
2857 2857
 
2858 2858
 	/**
@@ -2902,11 +2902,11 @@  discard block
 block discarded – undo
2902 2902
 		}
2903 2903
 
2904 2904
 		foreach ( $form->options as $opt => $value ) {
2905
-			if ( isset( $post_values[ $opt ] ) ) {
2906
-				$values[ $opt ] = $post_values[ $opt ];
2907
-				self::unserialize_or_decode( $values[ $opt ] );
2905
+			if ( isset( $post_values[$opt] ) ) {
2906
+				$values[$opt] = $post_values[$opt];
2907
+				self::unserialize_or_decode( $values[$opt] );
2908 2908
 			} else {
2909
-				$values[ $opt ] = $value;
2909
+				$values[$opt] = $value;
2910 2910
 			}
2911 2911
 		}
2912 2912
 
@@ -2925,8 +2925,8 @@  discard block
 block discarded – undo
2925 2925
 		$form_defaults = FrmFormsHelper::get_default_opts();
2926 2926
 
2927 2927
 		foreach ( $form_defaults as $opt => $default ) {
2928
-			if ( ! isset( $values[ $opt ] ) || $values[ $opt ] == '' ) {
2929
-				$values[ $opt ] = $post_values && isset( $post_values['options'][ $opt ] ) ? $post_values['options'][ $opt ] : $default;
2928
+			if ( ! isset( $values[$opt] ) || $values[$opt] == '' ) {
2929
+				$values[$opt] = $post_values && isset( $post_values['options'][$opt] ) ? $post_values['options'][$opt] : $default;
2930 2930
 			}
2931 2931
 
2932 2932
 			unset( $opt, $default );
@@ -2937,8 +2937,8 @@  discard block
 block discarded – undo
2937 2937
 		}
2938 2938
 
2939 2939
 		foreach ( array( 'before', 'after', 'submit' ) as $h ) {
2940
-			if ( ! isset( $values[ $h . '_html' ] ) ) {
2941
-				$values[ $h . '_html' ] = ( $post_values['options'][ $h . '_html' ] ?? FrmFormsHelper::get_default_html( $h ) );
2940
+			if ( ! isset( $values[$h . '_html'] ) ) {
2941
+				$values[$h . '_html'] = ( $post_values['options'][$h . '_html'] ?? FrmFormsHelper::get_default_html( $h ) );
2942 2942
 			}
2943 2943
 			unset( $h );
2944 2944
 		}
@@ -3152,25 +3152,25 @@  discard block
 block discarded – undo
3152 3152
 		if ( ! is_numeric( $levels ) ) {
3153 3153
 			// Show time in specified unit.
3154 3154
 			$levels = self::get_unit( $levels );
3155
-			if ( isset( $time_strings[ $levels ] ) ) {
3155
+			if ( isset( $time_strings[$levels] ) ) {
3156 3156
 				$diff         = array(
3157 3157
 					$levels => self::time_format( $levels, $diff ),
3158 3158
 				);
3159 3159
 				$time_strings = array(
3160
-					$levels => $time_strings[ $levels ],
3160
+					$levels => $time_strings[$levels],
3161 3161
 				);
3162 3162
 			}
3163 3163
 			$levels = 1;
3164 3164
 		}
3165 3165
 
3166 3166
 		foreach ( $time_strings as $k => $v ) {
3167
-			if ( isset( $diff[ $k ] ) && $diff[ $k ] ) {
3168
-				$time_strings[ $k ] = $diff[ $k ] . ' ' . ( $diff[ $k ] > 1 ? $v[1] : $v[0] );
3169
-			} elseif ( isset( $diff[ $k ] ) && count( $time_strings ) === 1 ) {
3167
+			if ( isset( $diff[$k] ) && $diff[$k] ) {
3168
+				$time_strings[$k] = $diff[$k] . ' ' . ( $diff[$k] > 1 ? $v[1] : $v[0] );
3169
+			} elseif ( isset( $diff[$k] ) && count( $time_strings ) === 1 ) {
3170 3170
 				// Account for 0.
3171
-				$time_strings[ $k ] = $diff[ $k ] . ' ' . $v[1];
3171
+				$time_strings[$k] = $diff[$k] . ' ' . $v[1];
3172 3172
 			} else {
3173
-				unset( $time_strings[ $k ] );
3173
+				unset( $time_strings[$k] );
3174 3174
 			}
3175 3175
 		}
3176 3176
 
@@ -3194,8 +3194,8 @@  discard block
 block discarded – undo
3194 3194
 			'y' => 'y',
3195 3195
 			'd' => 'days',
3196 3196
 		);
3197
-		if ( isset( $return[ $unit ] ) ) {
3198
-			return $diff[ $return[ $unit ] ];
3197
+		if ( isset( $return[$unit] ) ) {
3198
+			return $diff[$return[$unit]];
3199 3199
 		}
3200 3200
 
3201 3201
 		$total = $diff['days'] * self::convert_time( 'd', $unit );
@@ -3203,11 +3203,11 @@  discard block
 block discarded – undo
3203 3203
 		$times = array( 'h', 'i', 's' );
3204 3204
 
3205 3205
 		foreach ( $times as $time ) {
3206
-			if ( ! isset( $diff[ $time ] ) ) {
3206
+			if ( ! isset( $diff[$time] ) ) {
3207 3207
 				continue;
3208 3208
 			}
3209 3209
 
3210
-			$total += $diff[ $time ] * self::convert_time( $time, $unit );
3210
+			$total += $diff[$time] * self::convert_time( $time, $unit );
3211 3211
 		}
3212 3212
 
3213 3213
 		return floor( $total );
@@ -3232,7 +3232,7 @@  discard block
 block discarded – undo
3232 3232
 			'y' => DAY_IN_SECONDS * 365.25,
3233 3233
 		);
3234 3234
 
3235
-		return $convert[ $from ] / $convert[ $to ];
3235
+		return $convert[$from] / $convert[$to];
3236 3236
 	}
3237 3237
 
3238 3238
 	/**
@@ -3244,7 +3244,7 @@  discard block
 block discarded – undo
3244 3244
 	 */
3245 3245
 	private static function get_unit( $unit ) {
3246 3246
 		$units = self::get_time_strings();
3247
-		if ( isset( $units[ $unit ] ) || is_numeric( $unit ) ) {
3247
+		if ( isset( $units[$unit] ) || is_numeric( $unit ) ) {
3248 3248
 			return $unit;
3249 3249
 		}
3250 3250
 
@@ -3362,17 +3362,17 @@  discard block
 block discarded – undo
3362 3362
 
3363 3363
 					case 1:
3364 3364
 						$l2 = $name;
3365
-						self::add_value_to_array( $name, $l2, $this_val, $vars[ $l1 ] );
3365
+						self::add_value_to_array( $name, $l2, $this_val, $vars[$l1] );
3366 3366
 						break;
3367 3367
 
3368 3368
 					case 2:
3369 3369
 						$l3 = $name;
3370
-						self::add_value_to_array( $name, $l3, $this_val, $vars[ $l1 ][ $l2 ] );
3370
+						self::add_value_to_array( $name, $l3, $this_val, $vars[$l1][$l2] );
3371 3371
 						break;
3372 3372
 
3373 3373
 					case 3:
3374 3374
 						$l4 = $name;
3375
-						self::add_value_to_array( $name, $l4, $this_val, $vars[ $l1 ][ $l2 ][ $l3 ] );
3375
+						self::add_value_to_array( $name, $l4, $this_val, $vars[$l1][$l2][$l3] );
3376 3376
 				}
3377 3377
 
3378 3378
 				unset( $this_val, $n );
@@ -3395,8 +3395,8 @@  discard block
 block discarded – undo
3395 3395
 	public static function add_value_to_array( $name, $l1, $val, &$vars ) {
3396 3396
 		if ( $name == '' ) {
3397 3397
 			$vars[] = $val;
3398
-		} elseif ( ! isset( $vars[ $l1 ] ) ) {
3399
-			$vars[ $l1 ] = $val;
3398
+		} elseif ( ! isset( $vars[$l1] ) ) {
3399
+			$vars[$l1] = $val;
3400 3400
 		}
3401 3401
 	}
3402 3402
 
@@ -3420,7 +3420,7 @@  discard block
 block discarded – undo
3420 3420
 			'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' ),
3421 3421
 		);
3422 3422
 
3423
-		if ( ! isset( $tooltips[ $name ] ) ) {
3423
+		if ( ! isset( $tooltips[$name] ) ) {
3424 3424
 			return;
3425 3425
 		}
3426 3426
 
@@ -3430,7 +3430,7 @@  discard block
 block discarded – undo
3430 3430
 			echo ' class="frm_help"';
3431 3431
 		}
3432 3432
 
3433
-		echo ' title="' . esc_attr( $tooltips[ $name ] );
3433
+		echo ' title="' . esc_attr( $tooltips[$name] );
3434 3434
 
3435 3435
 		if ( 'open' != $class ) {
3436 3436
 			echo '"';
@@ -3502,13 +3502,13 @@  discard block
 block discarded – undo
3502 3502
 	 * @return void
3503 3503
 	 */
3504 3504
 	private static function prepare_action_slashes( $val, $key, &$post_content ) {
3505
-		if ( ! isset( $post_content[ $key ] ) || is_numeric( $val ) ) {
3505
+		if ( ! isset( $post_content[$key] ) || is_numeric( $val ) ) {
3506 3506
 			return;
3507 3507
 		}
3508 3508
 
3509 3509
 		if ( is_array( $val ) ) {
3510 3510
 			foreach ( $val as $k1 => $v1 ) {
3511
-				self::prepare_action_slashes( $v1, $k1, $post_content[ $key ] );
3511
+				self::prepare_action_slashes( $v1, $k1, $post_content[$key] );
3512 3512
 				unset( $k1, $v1 );
3513 3513
 			}
3514 3514
 		} else {
@@ -3516,7 +3516,7 @@  discard block
 block discarded – undo
3516 3516
 			$val = stripslashes( $val );
3517 3517
 
3518 3518
 			// Add backslashes before double quotes and forward slashes only
3519
-			$post_content[ $key ] = addcslashes( $val, '"\\/' );
3519
+			$post_content[$key] = addcslashes( $val, '"\\/' );
3520 3520
 		}
3521 3521
 	}
3522 3522
 
@@ -3640,14 +3640,14 @@  discard block
 block discarded – undo
3640 3640
 				continue;
3641 3641
 			}
3642 3642
 			$key = $input['name'];
3643
-			if ( isset( $formatted[ $key ] ) ) {
3644
-				if ( is_array( $formatted[ $key ] ) ) {
3645
-					$formatted[ $key ][] = $input['value'];
3643
+			if ( isset( $formatted[$key] ) ) {
3644
+				if ( is_array( $formatted[$key] ) ) {
3645
+					$formatted[$key][] = $input['value'];
3646 3646
 				} else {
3647
-					$formatted[ $key ] = array( $formatted[ $key ], $input['value'] );
3647
+					$formatted[$key] = array( $formatted[$key], $input['value'] );
3648 3648
 				}
3649 3649
 			} else {
3650
-				$formatted[ $key ] = $input['value'];
3650
+				$formatted[$key] = $input['value'];
3651 3651
 			}
3652 3652
 		}
3653 3653
 
@@ -4354,8 +4354,8 @@  discard block
 block discarded – undo
4354 4354
 		}
4355 4355
 
4356 4356
 		foreach ( $keys as $key ) {
4357
-			if ( isset( $values[ $key ] ) ) {
4358
-				$values[ $key ] = self::kses( $values[ $key ], 'all' );
4357
+			if ( isset( $values[$key] ) ) {
4358
+				$values[$key] = self::kses( $values[$key], 'all' );
4359 4359
 			}
4360 4360
 		}
4361 4361
 
@@ -4420,7 +4420,7 @@  discard block
 block discarded – undo
4420 4420
 				'role',
4421 4421
 				'style',
4422 4422
 			);
4423
-			$safe      = in_array( $key, $safe_keys, true );
4423
+			$safe = in_array( $key, $safe_keys, true );
4424 4424
 		}//end if
4425 4425
 
4426 4426
 		/**
@@ -4559,7 +4559,7 @@  discard block
 block discarded – undo
4559 4559
 			return 0;
4560 4560
 		}
4561 4561
 
4562
-		return strlen( $parts[ count( $parts ) - 1 ] );
4562
+		return strlen( $parts[count( $parts ) - 1] );
4563 4563
 	}
4564 4564
 
4565 4565
 	/**
@@ -4579,7 +4579,7 @@  discard block
 block discarded – undo
4579 4579
 
4580 4580
 		add_filter(
4581 4581
 			'option_gmt_offset',
4582
-			function ( $offset ) {
4582
+			function( $offset ) {
4583 4583
 				if ( ! is_string( $offset ) || is_numeric( $offset ) ) {
4584 4584
 					// Leave a valid value alone.
4585 4585
 					return $offset;
@@ -4676,7 +4676,7 @@  discard block
 block discarded – undo
4676 4676
 			return;
4677 4677
 		}
4678 4678
 
4679
-		$ajax_callback = function () use ( $option ) {
4679
+		$ajax_callback = function() use ( $option ) {
4680 4680
 			self::dismiss_warning_message( $option );
4681 4681
 		};
4682 4682
 
@@ -4686,7 +4686,7 @@  discard block
 block discarded – undo
4686 4686
 
4687 4687
 		add_filter(
4688 4688
 			'frm_message_list',
4689
-			function ( $show_messages ) use ( $message, $option ) {
4689
+			function( $show_messages ) use ( $message, $option ) {
4690 4690
 				if ( get_option( $option, false ) ) {
4691 4691
 					return $show_messages;
4692 4692
 				}
Please login to merge, or discard this patch.
stripe/controllers/FrmStrpLiteSettingsController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
 			 * @param object $frm_settings
25 25
 			 * @return void
26 26
 			 */
27
-			function ( $frm_settings ) {
27
+			function( $frm_settings ) {
28 28
 				$stripe_settings = FrmStrpLiteAppHelper::get_settings()->settings;
29 29
 				require FrmStrpLiteAppHelper::plugin_path() . '/views/settings/messages.php';
30 30
 			}
Please login to merge, or discard this patch.