Completed
Pull Request — master (#1580)
by Stephanie
44s
created
classes/models/FrmApplicationTemplate.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 		 *
38 38
 		 * @param array $keys
39 39
 		 */
40
-		self::$keys             = apply_filters(
40
+		self::$keys = apply_filters(
41 41
 			'frm_application_data_keys',
42 42
 			array( 'key', 'name', 'description', 'link', 'categories', 'views', 'forms' )
43 43
 		);
@@ -115,20 +115,20 @@  discard block
 block discarded – undo
115 115
 	public function as_js_object() {
116 116
 		$application = array();
117 117
 		foreach ( self::$keys as $key ) {
118
-			if ( ! isset( $this->api_data[ $key ] ) ) {
118
+			if ( ! isset( $this->api_data[$key] ) ) {
119 119
 				continue;
120 120
 			}
121 121
 
122
-			$value = $this->api_data[ $key ];
122
+			$value = $this->api_data[$key];
123 123
 
124 124
 			if ( 'icon' === $key ) {
125 125
 				// Icon is an array. The first array item is the image URL.
126
-				$application[ $key ] = reset( $value );
126
+				$application[$key] = reset( $value );
127 127
 			} elseif ( 'categories' === $key ) {
128
-				$application[ $key ] = array_values(
128
+				$application[$key] = array_values(
129 129
 					array_filter(
130 130
 						$value,
131
-						function ( $category ) {
131
+						function( $category ) {
132 132
 							return false === strpos( $category, '+Views' );
133 133
 						}
134 134
 					)
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
 					// Strip off the " Template" text at the end of the name as it takes up space.
145 145
 					$value = substr( $value, 0, -9 );
146 146
 				}
147
-				$application[ $key ] = $value;
147
+				$application[$key] = $value;
148 148
 			}//end if
149 149
 		}//end foreach
150 150
 
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/FrmHtmlHelper.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
 		wp_enqueue_script( 'formidable_settings' );
29 29
 		return FrmAppHelper::clip(
30 30
 			// @phpstan-ignore-next-line
31
-			function () use ( $id, $name, $args ) {
31
+			function() use ( $id, $name, $args ) {
32 32
 				require FrmAppHelper::plugin_path() . '/classes/views/shared/toggle.php';
33 33
 			},
34 34
 			isset( $args['echo'] ) ? $args['echo'] : false
Please login to merge, or discard this patch.
classes/helpers/FrmDashboardHelper.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -89,8 +89,8 @@  discard block
 block discarded – undo
89 89
 	public function __construct( $data ) {
90 90
 		$sections = array( 'counters', 'license', 'payments', 'entries', 'inbox', 'video', 'payments' );
91 91
 		foreach ( $sections as $section ) {
92
-			if ( isset( $data[ $section ] ) ) {
93
-				$this->view[ $section ] = $data[ $section ];
92
+			if ( isset( $data[$section] ) ) {
93
+				$this->view[$section] = $data[$section];
94 94
 			}
95 95
 		}
96 96
 	}
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
 	private static function load_entries_list_template( $template ) {
338 338
 		add_filter(
339 339
 			'formidable_page_formidable_entries_per_page',
340
-			function () {
340
+			function() {
341 341
 				return 7;
342 342
 			}
343 343
 		);
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   +83 added lines, -83 removed lines patch added patch discarded remove patch
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
 			'fill'   => '#4d4d4d',
203 203
 			'orange' => '#f05a24',
204 204
 		);
205
-		$atts     = array_merge( $defaults, $atts );
205
+		$atts = array_merge( $defaults, $atts );
206 206
 
207 207
 		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'] ) . '">
208 208
 			<path fill="' . esc_attr( $atts['orange'] ) . '" d="M289.6 384h140v76h-140z"/>
@@ -420,7 +420,7 @@  discard block
 block discarded – undo
420 420
 	 * @return string
421 421
 	 */
422 422
 	public static function get_server_value( $value ) {
423
-		return isset( $_SERVER[ $value ] ) ? wp_strip_all_tags( wp_unslash( $_SERVER[ $value ] ) ) : '';
423
+		return isset( $_SERVER[$value] ) ? wp_strip_all_tags( wp_unslash( $_SERVER[$value] ) ) : '';
424 424
 	}
425 425
 
426 426
 	/**
@@ -454,7 +454,7 @@  discard block
 block discarded – undo
454 454
 		$ip         = '';
455 455
 
456 456
 		foreach ( $ip_options as $key ) {
457
-			if ( ! isset( $_SERVER[ $key ] ) ) {
457
+			if ( ! isset( $_SERVER[$key] ) ) {
458 458
 				continue;
459 459
 			}
460 460
 
@@ -523,10 +523,10 @@  discard block
 block discarded – undo
523 523
 		}
524 524
 
525 525
 		if ( $src === 'get' ) {
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
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
528 528
 				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
529
-				$value = htmlspecialchars_decode( wp_unslash( $_GET[ $param ] ) );
529
+				$value = htmlspecialchars_decode( wp_unslash( $_GET[$param] ) );
530 530
 			}
531 531
 			self::sanitize_value( $sanitize, $value );
532 532
 		} else {
@@ -547,7 +547,7 @@  discard block
 block discarded – undo
547 547
 				}
548 548
 
549 549
 				$p     = trim( $p, ']' );
550
-				$value = isset( $value[ $p ] ) ? $value[ $p ] : $default;
550
+				$value = isset( $value[$p] ) ? $value[$p] : $default;
551 551
 			}
552 552
 		}
553 553
 
@@ -603,26 +603,26 @@  discard block
 block discarded – undo
603 603
 			'sanitize'   => 'sanitize_text_field',
604 604
 			'serialized' => false,
605 605
 		);
606
-		$args     = wp_parse_args( $args, $defaults );
606
+		$args = wp_parse_args( $args, $defaults );
607 607
 
608 608
 		$value = $args['default'];
609 609
 		if ( $args['type'] === 'get' ) {
610
-			if ( $_GET && isset( $_GET[ $args['param'] ] ) ) {
610
+			if ( $_GET && isset( $_GET[$args['param']] ) ) {
611 611
 				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
612
-				$value = wp_unslash( $_GET[ $args['param'] ] );
612
+				$value = wp_unslash( $_GET[$args['param']] );
613 613
 			}
614 614
 		} elseif ( $args['type'] === 'post' ) {
615
-			if ( isset( $_POST[ $args['param'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
615
+			if ( isset( $_POST[$args['param']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
616 616
 				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
617
-				$value = wp_unslash( $_POST[ $args['param'] ] );
617
+				$value = wp_unslash( $_POST[$args['param']] );
618 618
 				if ( $args['serialized'] === true && is_serialized_string( $value ) && is_serialized( $value ) ) {
619 619
 					self::unserialize_or_decode( $value );
620 620
 				}
621 621
 			}
622
-		} elseif ( isset( $_REQUEST[ $args['param'] ] ) ) {
622
+		} elseif ( isset( $_REQUEST[$args['param']] ) ) {
623 623
 			// phpcs:ignore WordPress.Security.NonceVerification.Missing
624 624
 				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
625
-				$value = wp_unslash( $_REQUEST[ $args['param'] ] );
625
+				$value = wp_unslash( $_REQUEST[$args['param']] );
626 626
 		}
627 627
 
628 628
 		self::sanitize_value( $args['sanitize'], $value );
@@ -669,7 +669,7 @@  discard block
 block discarded – undo
669 669
 		if ( is_array( $value ) ) {
670 670
 			$temp_values = $value;
671 671
 			foreach ( $temp_values as $k => $v ) {
672
-				self::sanitize_value( $sanitize, $value[ $k ] );
672
+				self::sanitize_value( $sanitize, $value[$k] );
673 673
 			}
674 674
 			return;
675 675
 		}
@@ -680,8 +680,8 @@  discard block
 block discarded – undo
680 680
 	public static function sanitize_request( $sanitize_method, &$values ) {
681 681
 		$temp_values = $values;
682 682
 		foreach ( $temp_values as $k => $val ) {
683
-			if ( isset( $sanitize_method[ $k ] ) ) {
684
-				$values[ $k ] = call_user_func( $sanitize_method[ $k ], $val );
683
+			if ( isset( $sanitize_method[$k] ) ) {
684
+				$values[$k] = call_user_func( $sanitize_method[$k], $val );
685 685
 			}
686 686
 		}
687 687
 	}
@@ -741,7 +741,7 @@  discard block
 block discarded – undo
741 741
 		if ( is_array( $value ) ) {
742 742
 			$temp_values = $value;
743 743
 			foreach ( $temp_values as $k => $v ) {
744
-				self::decode_specialchars( $value[ $k ] );
744
+				self::decode_specialchars( $value[$k] );
745 745
 			}
746 746
 		} else {
747 747
 			self::decode_amp( $value );
@@ -863,7 +863,7 @@  discard block
 block discarded – undo
863 863
 	 * @return array
864 864
 	 */
865 865
 	public static function add_allowed_submit_button_tags( $allowed_html ) {
866
-		$allowed_html['input']                    = array(
866
+		$allowed_html['input'] = array(
867 867
 			'type'           => true,
868 868
 			'value'          => true,
869 869
 			'formnovalidate' => true,
@@ -886,7 +886,7 @@  discard block
 block discarded – undo
886 886
 			$allowed_html = $html;
887 887
 		} elseif ( ! empty( $allowed ) ) {
888 888
 			foreach ( (array) $allowed as $a ) {
889
-				$allowed_html[ $a ] = isset( $html[ $a ] ) ? $html[ $a ] : array();
889
+				$allowed_html[$a] = isset( $html[$a] ) ? $html[$a] : array();
890 890
 			}
891 891
 		}
892 892
 
@@ -1065,8 +1065,8 @@  discard block
 block discarded – undo
1065 1065
 		}
1066 1066
 
1067 1067
 		global $wp_query;
1068
-		if ( isset( $wp_query->query_vars[ $param ] ) ) {
1069
-			$value = $wp_query->query_vars[ $param ];
1068
+		if ( isset( $wp_query->query_vars[$param] ) ) {
1069
+			$value = $wp_query->query_vars[$param];
1070 1070
 		}
1071 1071
 
1072 1072
 		return $value;
@@ -1097,9 +1097,9 @@  discard block
 block discarded – undo
1097 1097
 			'frm_keyalt_icon'       => 'frm_key_icon',
1098 1098
 			'frm_keyalt_solid_icon' => 'frm_key_solid_icon',
1099 1099
 		);
1100
-		if ( isset( $deprecated[ $icon ] ) ) {
1101
-			$icon  = $deprecated[ $icon ];
1102
-			$class = str_replace( $icon, $deprecated[ $icon ], $class );
1100
+		if ( isset( $deprecated[$icon] ) ) {
1101
+			$icon  = $deprecated[$icon];
1102
+			$class = str_replace( $icon, $deprecated[$icon], $class );
1103 1103
 		}
1104 1104
 
1105 1105
 		if ( $icon === $class ) {
@@ -1223,7 +1223,7 @@  discard block
 block discarded – undo
1223 1223
 	 * @return string|void
1224 1224
 	 */
1225 1225
 	public static function array_to_html_params( $atts, $echo = false ) {
1226
-		$callback = function () use ( $atts ) {
1226
+		$callback = function() use ( $atts ) {
1227 1227
 			if ( $atts ) {
1228 1228
 				foreach ( $atts as $key => $value ) {
1229 1229
 					echo ' ' . esc_attr( $key ) . '="' . esc_attr( $value ) . '"';
@@ -1374,7 +1374,7 @@  discard block
 block discarded – undo
1374 1374
 			'input_id'    => '',
1375 1375
 			'value'       => false,
1376 1376
 		);
1377
-		$atts     = array_merge( $defaults, $atts );
1377
+		$atts = array_merge( $defaults, $atts );
1378 1378
 
1379 1379
 		if ( $atts['input_id'] === 'template' && empty( $atts['tosearch'] ) ) {
1380 1380
 			$atts['tosearch'] = 'frm-card';
@@ -1450,7 +1450,7 @@  discard block
 block discarded – undo
1450 1450
 				'new_file_path' => self::plugin_path() . '/js',
1451 1451
 			)
1452 1452
 		);
1453
-		$new_file  = new FrmCreateFile( $file_atts );
1453
+		$new_file = new FrmCreateFile( $file_atts );
1454 1454
 
1455 1455
 		$files = array(
1456 1456
 			self::plugin_path() . '/js/formidable.min.js',
@@ -1963,8 +1963,8 @@  discard block
 block discarded – undo
1963 1963
 			return $error;
1964 1964
 		}
1965 1965
 
1966
-		$nonce_value = $_REQUEST && isset( $_REQUEST[ $nonce_name ] ) ? sanitize_text_field( wp_unslash( $_REQUEST[ $nonce_name ] ) ) : '';
1967
-		if ( $_REQUEST && ( ! isset( $_REQUEST[ $nonce_name ] ) || ! wp_verify_nonce( $nonce_value, $nonce ) ) ) {
1966
+		$nonce_value = $_REQUEST && isset( $_REQUEST[$nonce_name] ) ? sanitize_text_field( wp_unslash( $_REQUEST[$nonce_name] ) ) : '';
1967
+		if ( $_REQUEST && ( ! isset( $_REQUEST[$nonce_name] ) || ! wp_verify_nonce( $nonce_value, $nonce ) ) ) {
1968 1968
 			$frm_settings = self::get_settings();
1969 1969
 			$error        = $frm_settings->admin_permission;
1970 1970
 		}
@@ -1999,7 +1999,7 @@  discard block
 block discarded – undo
1999 1999
 			} else {
2000 2000
 				foreach ( $value as $k => $v ) {
2001 2001
 					if ( ! is_array( $v ) ) {
2002
-						$value[ $k ] = call_user_func( $original_function, $v );
2002
+						$value[$k] = call_user_func( $original_function, $v );
2003 2003
 					}
2004 2004
 				}
2005 2005
 			}
@@ -2040,7 +2040,7 @@  discard block
 block discarded – undo
2040 2040
 			if ( is_array( $value ) ) {
2041 2041
 				$return = array_merge( $return, self::array_flatten( $value, $keys ) );
2042 2042
 			} elseif ( $keys === 'keep' ) {
2043
-					$return[ $key ] = $value;
2043
+					$return[$key] = $value;
2044 2044
 			} else {
2045 2045
 				$return[] = $value;
2046 2046
 			}
@@ -2101,11 +2101,11 @@  discard block
 block discarded – undo
2101 2101
 		}
2102 2102
 
2103 2103
 		$ver = $default;
2104
-		if ( ! isset( $wp_scripts->registered[ $handle ] ) ) {
2104
+		if ( ! isset( $wp_scripts->registered[$handle] ) ) {
2105 2105
 			return $ver;
2106 2106
 		}
2107 2107
 
2108
-		$query = $wp_scripts->registered[ $handle ];
2108
+		$query = $wp_scripts->registered[$handle];
2109 2109
 		if ( is_object( $query ) && ! empty( $query->ver ) ) {
2110 2110
 			$ver = $query->ver;
2111 2111
 		}
@@ -2121,7 +2121,7 @@  discard block
 block discarded – undo
2121 2121
 	 * @return string|null
2122 2122
 	 */
2123 2123
 	public static function js_redirect( $url, $echo = false ) {
2124
-		$callback = function () use ( $url ) {
2124
+		$callback = function() use ( $url ) {
2125 2125
 			echo '<script type="text/javascript">window.location="' . esc_url_raw( $url ) . '"</script>';
2126 2126
 		};
2127 2127
 		return self::clip( $callback, $echo );
@@ -2216,7 +2216,7 @@  discard block
 block discarded – undo
2216 2216
 			$suffix = 2;
2217 2217
 			do {
2218 2218
 				$key_check = $key . $separator . $suffix;
2219
-				++$suffix;
2219
+				++ $suffix;
2220 2220
 			} while ( in_array( $key_check, $similar_keys, true ) );
2221 2221
 
2222 2222
 			$key = $key_check;
@@ -2324,7 +2324,7 @@  discard block
 block discarded – undo
2324 2324
 
2325 2325
 		foreach ( array( 'name', 'description' ) as $var ) {
2326 2326
 			$default_val    = isset( $record->{$var} ) ? $record->{$var} : '';
2327
-			$values[ $var ] = self::get_param( $var, $default_val, 'get', 'wp_kses_post' );
2327
+			$values[$var] = self::get_param( $var, $default_val, 'get', 'wp_kses_post' );
2328 2328
 			unset( $var, $default_val );
2329 2329
 		}
2330 2330
 
@@ -2380,9 +2380,9 @@  discard block
 block discarded – undo
2380 2380
 			$meta_value = FrmEntryMeta::get_meta_value( $record, $field->id );
2381 2381
 		}//end if
2382 2382
 
2383
-		$field_type = isset( $post_values['field_options'][ 'type_' . $field->id ] ) ? $post_values['field_options'][ 'type_' . $field->id ] : $field->type;
2384
-		if ( isset( $post_values['item_meta'][ $field->id ] ) ) {
2385
-			$new_value = $post_values['item_meta'][ $field->id ];
2383
+		$field_type = isset( $post_values['field_options']['type_' . $field->id] ) ? $post_values['field_options']['type_' . $field->id] : $field->type;
2384
+		if ( isset( $post_values['item_meta'][$field->id] ) ) {
2385
+			$new_value = $post_values['item_meta'][$field->id];
2386 2386
 			self::unserialize_or_decode( $new_value );
2387 2387
 		} else {
2388 2388
 			$new_value = $meta_value;
@@ -2403,7 +2403,7 @@  discard block
 block discarded – undo
2403 2403
 
2404 2404
 		$field_array = array_merge( (array) $field->field_options, $field_array );
2405 2405
 
2406
-		$values['fields'][ $field->id ] = $field_array;
2406
+		$values['fields'][$field->id] = $field_array;
2407 2407
 	}
2408 2408
 
2409 2409
 	/**
@@ -2453,11 +2453,11 @@  discard block
 block discarded – undo
2453 2453
 		}
2454 2454
 
2455 2455
 		foreach ( $form->options as $opt => $value ) {
2456
-			if ( isset( $post_values[ $opt ] ) ) {
2457
-				$values[ $opt ] = $post_values[ $opt ];
2458
-				self::unserialize_or_decode( $values[ $opt ] );
2456
+			if ( isset( $post_values[$opt] ) ) {
2457
+				$values[$opt] = $post_values[$opt];
2458
+				self::unserialize_or_decode( $values[$opt] );
2459 2459
 			} else {
2460
-				$values[ $opt ] = $value;
2460
+				$values[$opt] = $value;
2461 2461
 			}
2462 2462
 		}
2463 2463
 
@@ -2471,8 +2471,8 @@  discard block
 block discarded – undo
2471 2471
 		$form_defaults = FrmFormsHelper::get_default_opts();
2472 2472
 
2473 2473
 		foreach ( $form_defaults as $opt => $default ) {
2474
-			if ( ! isset( $values[ $opt ] ) || $values[ $opt ] == '' ) {
2475
-				$values[ $opt ] = $post_values && isset( $post_values['options'][ $opt ] ) ? $post_values['options'][ $opt ] : $default;
2474
+			if ( ! isset( $values[$opt] ) || $values[$opt] == '' ) {
2475
+				$values[$opt] = $post_values && isset( $post_values['options'][$opt] ) ? $post_values['options'][$opt] : $default;
2476 2476
 			}
2477 2477
 
2478 2478
 			unset( $opt, $default );
@@ -2483,8 +2483,8 @@  discard block
 block discarded – undo
2483 2483
 		}
2484 2484
 
2485 2485
 		foreach ( array( 'before', 'after', 'submit' ) as $h ) {
2486
-			if ( ! isset( $values[ $h . '_html' ] ) ) {
2487
-				$values[ $h . '_html' ] = ( isset( $post_values['options'][ $h . '_html' ] ) ? $post_values['options'][ $h . '_html' ] : FrmFormsHelper::get_default_html( $h ) );
2486
+			if ( ! isset( $values[$h . '_html'] ) ) {
2487
+				$values[$h . '_html'] = ( isset( $post_values['options'][$h . '_html'] ) ? $post_values['options'][$h . '_html'] : FrmFormsHelper::get_default_html( $h ) );
2488 2488
 			}
2489 2489
 			unset( $h );
2490 2490
 		}
@@ -2663,25 +2663,25 @@  discard block
 block discarded – undo
2663 2663
 		if ( ! is_numeric( $levels ) ) {
2664 2664
 			// Show time in specified unit.
2665 2665
 			$levels = self::get_unit( $levels );
2666
-			if ( isset( $time_strings[ $levels ] ) ) {
2666
+			if ( isset( $time_strings[$levels] ) ) {
2667 2667
 				$diff         = array(
2668 2668
 					$levels => self::time_format( $levels, $diff ),
2669 2669
 				);
2670 2670
 				$time_strings = array(
2671
-					$levels => $time_strings[ $levels ],
2671
+					$levels => $time_strings[$levels],
2672 2672
 				);
2673 2673
 			}
2674 2674
 			$levels = 1;
2675 2675
 		}
2676 2676
 
2677 2677
 		foreach ( $time_strings as $k => $v ) {
2678
-			if ( isset( $diff[ $k ] ) && $diff[ $k ] ) {
2679
-				$time_strings[ $k ] = $diff[ $k ] . ' ' . ( $diff[ $k ] > 1 ? $v[1] : $v[0] );
2680
-			} elseif ( isset( $diff[ $k ] ) && count( $time_strings ) === 1 ) {
2678
+			if ( isset( $diff[$k] ) && $diff[$k] ) {
2679
+				$time_strings[$k] = $diff[$k] . ' ' . ( $diff[$k] > 1 ? $v[1] : $v[0] );
2680
+			} elseif ( isset( $diff[$k] ) && count( $time_strings ) === 1 ) {
2681 2681
 				// Account for 0.
2682
-				$time_strings[ $k ] = $diff[ $k ] . ' ' . $v[1];
2682
+				$time_strings[$k] = $diff[$k] . ' ' . $v[1];
2683 2683
 			} else {
2684
-				unset( $time_strings[ $k ] );
2684
+				unset( $time_strings[$k] );
2685 2685
 			}
2686 2686
 		}
2687 2687
 
@@ -2700,8 +2700,8 @@  discard block
 block discarded – undo
2700 2700
 			'y' => 'y',
2701 2701
 			'd' => 'days',
2702 2702
 		);
2703
-		if ( isset( $return[ $unit ] ) ) {
2704
-			return $diff[ $return[ $unit ] ];
2703
+		if ( isset( $return[$unit] ) ) {
2704
+			return $diff[$return[$unit]];
2705 2705
 		}
2706 2706
 
2707 2707
 		$total = $diff['days'] * self::convert_time( 'd', $unit );
@@ -2709,11 +2709,11 @@  discard block
 block discarded – undo
2709 2709
 		$times = array( 'h', 'i', 's' );
2710 2710
 
2711 2711
 		foreach ( $times as $time ) {
2712
-			if ( ! isset( $diff[ $time ] ) ) {
2712
+			if ( ! isset( $diff[$time] ) ) {
2713 2713
 				continue;
2714 2714
 			}
2715 2715
 
2716
-			$total += $diff[ $time ] * self::convert_time( $time, $unit );
2716
+			$total += $diff[$time] * self::convert_time( $time, $unit );
2717 2717
 		}
2718 2718
 
2719 2719
 		return floor( $total );
@@ -2733,7 +2733,7 @@  discard block
 block discarded – undo
2733 2733
 			'y' => DAY_IN_SECONDS * 365.25,
2734 2734
 		);
2735 2735
 
2736
-		return $convert[ $from ] / $convert[ $to ];
2736
+		return $convert[$from] / $convert[$to];
2737 2737
 	}
2738 2738
 
2739 2739
 	/**
@@ -2741,7 +2741,7 @@  discard block
 block discarded – undo
2741 2741
 	 */
2742 2742
 	private static function get_unit( $unit ) {
2743 2743
 		$units = self::get_time_strings();
2744
-		if ( isset( $units[ $unit ] ) || is_numeric( $unit ) ) {
2744
+		if ( isset( $units[$unit] ) || is_numeric( $unit ) ) {
2745 2745
 			return $unit;
2746 2746
 		}
2747 2747
 
@@ -2857,17 +2857,17 @@  discard block
 block discarded – undo
2857 2857
 
2858 2858
 					case 1:
2859 2859
 						$l2 = $name;
2860
-						self::add_value_to_array( $name, $l2, $this_val, $vars[ $l1 ] );
2860
+						self::add_value_to_array( $name, $l2, $this_val, $vars[$l1] );
2861 2861
 						break;
2862 2862
 
2863 2863
 					case 2:
2864 2864
 						$l3 = $name;
2865
-						self::add_value_to_array( $name, $l3, $this_val, $vars[ $l1 ][ $l2 ] );
2865
+						self::add_value_to_array( $name, $l3, $this_val, $vars[$l1][$l2] );
2866 2866
 						break;
2867 2867
 
2868 2868
 					case 3:
2869 2869
 						$l4 = $name;
2870
-						self::add_value_to_array( $name, $l4, $this_val, $vars[ $l1 ][ $l2 ][ $l3 ] );
2870
+						self::add_value_to_array( $name, $l4, $this_val, $vars[$l1][$l2][$l3] );
2871 2871
 				}
2872 2872
 
2873 2873
 				unset( $this_val, $n );
@@ -2886,8 +2886,8 @@  discard block
 block discarded – undo
2886 2886
 	public static function add_value_to_array( $name, $l1, $val, &$vars ) {
2887 2887
 		if ( $name == '' ) {
2888 2888
 			$vars[] = $val;
2889
-		} elseif ( ! isset( $vars[ $l1 ] ) ) {
2890
-			$vars[ $l1 ] = $val;
2889
+		} elseif ( ! isset( $vars[$l1] ) ) {
2890
+			$vars[$l1] = $val;
2891 2891
 		}
2892 2892
 	}
2893 2893
 
@@ -2904,7 +2904,7 @@  discard block
 block discarded – undo
2904 2904
 			'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' ),
2905 2905
 		);
2906 2906
 
2907
-		if ( ! isset( $tooltips[ $name ] ) ) {
2907
+		if ( ! isset( $tooltips[$name] ) ) {
2908 2908
 			return;
2909 2909
 		}
2910 2910
 
@@ -2914,7 +2914,7 @@  discard block
 block discarded – undo
2914 2914
 			echo ' class="frm_help"';
2915 2915
 		}
2916 2916
 
2917
-		echo ' title="' . esc_attr( $tooltips[ $name ] );
2917
+		echo ' title="' . esc_attr( $tooltips[$name] );
2918 2918
 
2919 2919
 		if ( 'open' != $class ) {
2920 2920
 			echo '"';
@@ -2973,13 +2973,13 @@  discard block
 block discarded – undo
2973 2973
 	}
2974 2974
 
2975 2975
 	private static function prepare_action_slashes( $val, $key, &$post_content ) {
2976
-		if ( ! isset( $post_content[ $key ] ) || is_numeric( $val ) ) {
2976
+		if ( ! isset( $post_content[$key] ) || is_numeric( $val ) ) {
2977 2977
 			return;
2978 2978
 		}
2979 2979
 
2980 2980
 		if ( is_array( $val ) ) {
2981 2981
 			foreach ( $val as $k1 => $v1 ) {
2982
-				self::prepare_action_slashes( $v1, $k1, $post_content[ $key ] );
2982
+				self::prepare_action_slashes( $v1, $k1, $post_content[$key] );
2983 2983
 				unset( $k1, $v1 );
2984 2984
 			}
2985 2985
 		} else {
@@ -2987,7 +2987,7 @@  discard block
 block discarded – undo
2987 2987
 			$val = stripslashes( $val );
2988 2988
 
2989 2989
 			// Add backslashes before double quotes and forward slashes only
2990
-			$post_content[ $key ] = addcslashes( $val, '"\\/' );
2990
+			$post_content[$key] = addcslashes( $val, '"\\/' );
2991 2991
 		}
2992 2992
 	}
2993 2993
 
@@ -3108,14 +3108,14 @@  discard block
 block discarded – undo
3108 3108
 				continue;
3109 3109
 			}
3110 3110
 			$key = $input['name'];
3111
-			if ( isset( $formatted[ $key ] ) ) {
3112
-				if ( is_array( $formatted[ $key ] ) ) {
3113
-					$formatted[ $key ][] = $input['value'];
3111
+			if ( isset( $formatted[$key] ) ) {
3112
+				if ( is_array( $formatted[$key] ) ) {
3113
+					$formatted[$key][] = $input['value'];
3114 3114
 				} else {
3115
-					$formatted[ $key ] = array( $formatted[ $key ], $input['value'] );
3115
+					$formatted[$key] = array( $formatted[$key], $input['value'] );
3116 3116
 				}
3117 3117
 			} else {
3118
-				$formatted[ $key ] = $input['value'];
3118
+				$formatted[$key] = $input['value'];
3119 3119
 			}
3120 3120
 		}
3121 3121
 
@@ -3822,8 +3822,8 @@  discard block
 block discarded – undo
3822 3822
 		}
3823 3823
 
3824 3824
 		foreach ( $keys as $key ) {
3825
-			if ( isset( $values[ $key ] ) ) {
3826
-				$values[ $key ] = self::kses( $values[ $key ], 'all' );
3825
+			if ( isset( $values[$key] ) ) {
3826
+				$values[$key] = self::kses( $values[$key], 'all' );
3827 3827
 			}
3828 3828
 		}
3829 3829
 
@@ -3982,7 +3982,7 @@  discard block
 block discarded – undo
3982 3982
 			return 0;
3983 3983
 		}
3984 3984
 
3985
-		return strlen( $parts[ count( $parts ) - 1 ] );
3985
+		return strlen( $parts[count( $parts ) - 1] );
3986 3986
 	}
3987 3987
 
3988 3988
 	/**
@@ -4002,7 +4002,7 @@  discard block
 block discarded – undo
4002 4002
 
4003 4003
 		add_filter(
4004 4004
 			'option_gmt_offset',
4005
-			function ( $offset ) {
4005
+			function( $offset ) {
4006 4006
 				if ( ! is_string( $offset ) || is_numeric( $offset ) ) {
4007 4007
 					// Leave a valid value alone.
4008 4008
 					return $offset;
@@ -4156,7 +4156,7 @@  discard block
 block discarded – undo
4156 4156
 			return;
4157 4157
 		}
4158 4158
 
4159
-		$ajax_callback = function () use ( $option ) {
4159
+		$ajax_callback = function() use ( $option ) {
4160 4160
 			self::dismiss_warning_message( $option );
4161 4161
 		};
4162 4162
 
@@ -4166,7 +4166,7 @@  discard block
 block discarded – undo
4166 4166
 
4167 4167
 		add_filter(
4168 4168
 			'frm_message_list',
4169
-			function ( $show_messages ) use ( $message, $option ) {
4169
+			function( $show_messages ) use ( $message, $option ) {
4170 4170
 				if ( get_option( $option, false ) ) {
4171 4171
 					return $show_messages;
4172 4172
 				}
Please login to merge, or discard this patch.
stripe/controllers/FrmStrpLiteHooksController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 		// This filter flags the Pro credit card field that Stripe is enabled.
28 28
 		add_filter(
29 29
 			'frm_pro_show_card_callback',
30
-			function () {
30
+			function() {
31 31
 				return 'FrmStrpLiteActionsController::show_card';
32 32
 			}
33 33
 		);
@@ -35,10 +35,10 @@  discard block
 block discarded – undo
35 35
 		// This filter hides gateway fields from the entries list.
36 36
 		add_filter(
37 37
 			'frm_fields_in_entries_list_table',
38
-			function ( $form_cols ) {
38
+			function( $form_cols ) {
39 39
 				return array_filter(
40 40
 					$form_cols,
41
-					function ( $form_col ) {
41
+					function( $form_col ) {
42 42
 						return 'gateway' !== $form_col->type;
43 43
 					}
44 44
 				);
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.