Completed
Pull Request — master (#1839)
by Stephanie
49s
created
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   +84 added lines, -84 removed lines patch added patch discarded remove patch
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
 			'fill'   => '#4d4d4d',
225 225
 			'orange' => '#f05a24',
226 226
 		);
227
-		$atts     = array_merge( $defaults, $atts );
227
+		$atts = array_merge( $defaults, $atts );
228 228
 
229 229
 		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'] ) . '">
230 230
 			<path fill="' . esc_attr( $atts['orange'] ) . '" d="M289.6 384h140v76h-140z"/>
@@ -468,7 +468,7 @@  discard block
 block discarded – undo
468 468
 	 * @return string
469 469
 	 */
470 470
 	public static function get_server_value( $value ) {
471
-		return isset( $_SERVER[ $value ] ) ? wp_strip_all_tags( wp_unslash( $_SERVER[ $value ] ) ) : '';
471
+		return isset( $_SERVER[$value] ) ? wp_strip_all_tags( wp_unslash( $_SERVER[$value] ) ) : '';
472 472
 	}
473 473
 
474 474
 	/**
@@ -502,7 +502,7 @@  discard block
 block discarded – undo
502 502
 		$ip         = '';
503 503
 
504 504
 		foreach ( $ip_options as $key ) {
505
-			if ( ! isset( $_SERVER[ $key ] ) ) {
505
+			if ( ! isset( $_SERVER[$key] ) ) {
506 506
 				continue;
507 507
 			}
508 508
 
@@ -571,10 +571,10 @@  discard block
 block discarded – undo
571 571
 		}
572 572
 
573 573
 		if ( $src === 'get' ) {
574
-			$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
575
-			if ( ! isset( $_POST[ $param ] ) && isset( $_GET[ $param ] ) && ! is_array( $value ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
574
+			$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
575
+			if ( ! isset( $_POST[$param] ) && isset( $_GET[$param] ) && ! is_array( $value ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
576 576
 				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
577
-				$value = htmlspecialchars_decode( wp_unslash( $_GET[ $param ] ) );
577
+				$value = htmlspecialchars_decode( wp_unslash( $_GET[$param] ) );
578 578
 			}
579 579
 			self::sanitize_value( $sanitize, $value );
580 580
 		} else {
@@ -595,7 +595,7 @@  discard block
 block discarded – undo
595 595
 				}
596 596
 
597 597
 				$p     = trim( $p, ']' );
598
-				$value = isset( $value[ $p ] ) ? $value[ $p ] : $default;
598
+				$value = isset( $value[$p] ) ? $value[$p] : $default;
599 599
 			}
600 600
 		}
601 601
 
@@ -660,26 +660,26 @@  discard block
 block discarded – undo
660 660
 			'sanitize'   => 'sanitize_text_field',
661 661
 			'serialized' => false,
662 662
 		);
663
-		$args     = wp_parse_args( $args, $defaults );
663
+		$args = wp_parse_args( $args, $defaults );
664 664
 
665 665
 		$value = $args['default'];
666 666
 		if ( $args['type'] === 'get' ) {
667
-			if ( $_GET && isset( $_GET[ $args['param'] ] ) ) {
667
+			if ( $_GET && isset( $_GET[$args['param']] ) ) {
668 668
 				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
669
-				$value = wp_unslash( $_GET[ $args['param'] ] );
669
+				$value = wp_unslash( $_GET[$args['param']] );
670 670
 			}
671 671
 		} elseif ( $args['type'] === 'post' ) {
672
-			if ( isset( $_POST[ $args['param'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
672
+			if ( isset( $_POST[$args['param']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
673 673
 				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
674
-				$value = wp_unslash( $_POST[ $args['param'] ] );
674
+				$value = wp_unslash( $_POST[$args['param']] );
675 675
 				if ( $args['serialized'] === true && is_serialized_string( $value ) && is_serialized( $value ) ) {
676 676
 					self::unserialize_or_decode( $value );
677 677
 				}
678 678
 			}
679
-		} elseif ( isset( $_REQUEST[ $args['param'] ] ) ) {
679
+		} elseif ( isset( $_REQUEST[$args['param']] ) ) {
680 680
 			// phpcs:ignore WordPress.Security.NonceVerification.Missing
681 681
 				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
682
-				$value = wp_unslash( $_REQUEST[ $args['param'] ] );
682
+				$value = wp_unslash( $_REQUEST[$args['param']] );
683 683
 		}
684 684
 
685 685
 		self::sanitize_value( $args['sanitize'], $value );
@@ -726,7 +726,7 @@  discard block
 block discarded – undo
726 726
 		if ( is_array( $value ) ) {
727 727
 			$temp_values = $value;
728 728
 			foreach ( $temp_values as $k => $v ) {
729
-				self::sanitize_value( $sanitize, $value[ $k ] );
729
+				self::sanitize_value( $sanitize, $value[$k] );
730 730
 			}
731 731
 			return;
732 732
 		}
@@ -737,8 +737,8 @@  discard block
 block discarded – undo
737 737
 	public static function sanitize_request( $sanitize_method, &$values ) {
738 738
 		$temp_values = $values;
739 739
 		foreach ( $temp_values as $k => $val ) {
740
-			if ( isset( $sanitize_method[ $k ] ) ) {
741
-				$values[ $k ] = call_user_func( $sanitize_method[ $k ], $val );
740
+			if ( isset( $sanitize_method[$k] ) ) {
741
+				$values[$k] = call_user_func( $sanitize_method[$k], $val );
742 742
 			}
743 743
 		}
744 744
 	}
@@ -798,7 +798,7 @@  discard block
 block discarded – undo
798 798
 		if ( is_array( $value ) ) {
799 799
 			$temp_values = $value;
800 800
 			foreach ( $temp_values as $k => $v ) {
801
-				self::decode_specialchars( $value[ $k ] );
801
+				self::decode_specialchars( $value[$k] );
802 802
 			}
803 803
 		} else {
804 804
 			self::decode_amp( $value );
@@ -920,7 +920,7 @@  discard block
 block discarded – undo
920 920
 	 * @return array
921 921
 	 */
922 922
 	public static function add_allowed_submit_button_tags( $allowed_html ) {
923
-		$allowed_html['input']                    = array(
923
+		$allowed_html['input'] = array(
924 924
 			'type'           => true,
925 925
 			'value'          => true,
926 926
 			'formnovalidate' => true,
@@ -943,7 +943,7 @@  discard block
 block discarded – undo
943 943
 			$allowed_html = $html;
944 944
 		} elseif ( ! empty( $allowed ) ) {
945 945
 			foreach ( (array) $allowed as $a ) {
946
-				$allowed_html[ $a ] = isset( $html[ $a ] ) ? $html[ $a ] : array();
946
+				$allowed_html[$a] = isset( $html[$a] ) ? $html[$a] : array();
947 947
 			}
948 948
 		}
949 949
 
@@ -1122,8 +1122,8 @@  discard block
 block discarded – undo
1122 1122
 		}
1123 1123
 
1124 1124
 		global $wp_query;
1125
-		if ( isset( $wp_query->query_vars[ $param ] ) ) {
1126
-			$value = $wp_query->query_vars[ $param ];
1125
+		if ( isset( $wp_query->query_vars[$param] ) ) {
1126
+			$value = $wp_query->query_vars[$param];
1127 1127
 		}
1128 1128
 
1129 1129
 		return $value;
@@ -1154,9 +1154,9 @@  discard block
 block discarded – undo
1154 1154
 			'frm_keyalt_icon'       => 'frm_key_icon',
1155 1155
 			'frm_keyalt_solid_icon' => 'frm_key_solid_icon',
1156 1156
 		);
1157
-		if ( isset( $deprecated[ $icon ] ) ) {
1158
-			$icon  = $deprecated[ $icon ];
1159
-			$class = str_replace( $icon, $deprecated[ $icon ], $class );
1157
+		if ( isset( $deprecated[$icon] ) ) {
1158
+			$icon  = $deprecated[$icon];
1159
+			$class = str_replace( $icon, $deprecated[$icon], $class );
1160 1160
 		}
1161 1161
 
1162 1162
 		if ( $icon === $class ) {
@@ -1278,7 +1278,7 @@  discard block
 block discarded – undo
1278 1278
 	 * @return string|void
1279 1279
 	 */
1280 1280
 	public static function array_to_html_params( $atts, $echo = false ) {
1281
-		$callback = function () use ( $atts ) {
1281
+		$callback = function() use ( $atts ) {
1282 1282
 			if ( $atts ) {
1283 1283
 				foreach ( $atts as $key => $value ) {
1284 1284
 					echo ' ' . esc_attr( $key ) . '="' . esc_attr( $value ) . '"';
@@ -1429,7 +1429,7 @@  discard block
 block discarded – undo
1429 1429
 			'input_id'    => '',
1430 1430
 			'value'       => false,
1431 1431
 		);
1432
-		$atts     = array_merge( $defaults, $atts );
1432
+		$atts = array_merge( $defaults, $atts );
1433 1433
 
1434 1434
 		if ( $atts['input_id'] === 'template' && empty( $atts['tosearch'] ) ) {
1435 1435
 			$atts['tosearch'] = 'frm-card';
@@ -1505,7 +1505,7 @@  discard block
 block discarded – undo
1505 1505
 				'new_file_path' => self::plugin_path() . '/js',
1506 1506
 			)
1507 1507
 		);
1508
-		$new_file  = new FrmCreateFile( $file_atts );
1508
+		$new_file = new FrmCreateFile( $file_atts );
1509 1509
 
1510 1510
 		$files = array(
1511 1511
 			self::plugin_path() . '/js/formidable.min.js',
@@ -2018,8 +2018,8 @@  discard block
 block discarded – undo
2018 2018
 			return $error;
2019 2019
 		}
2020 2020
 
2021
-		$nonce_value = $_REQUEST && isset( $_REQUEST[ $nonce_name ] ) ? sanitize_text_field( wp_unslash( $_REQUEST[ $nonce_name ] ) ) : '';
2022
-		if ( $_REQUEST && ( ! isset( $_REQUEST[ $nonce_name ] ) || ! wp_verify_nonce( $nonce_value, $nonce ) ) ) {
2021
+		$nonce_value = $_REQUEST && isset( $_REQUEST[$nonce_name] ) ? sanitize_text_field( wp_unslash( $_REQUEST[$nonce_name] ) ) : '';
2022
+		if ( $_REQUEST && ( ! isset( $_REQUEST[$nonce_name] ) || ! wp_verify_nonce( $nonce_value, $nonce ) ) ) {
2023 2023
 			$frm_settings = self::get_settings();
2024 2024
 			$error        = $frm_settings->admin_permission;
2025 2025
 		}
@@ -2055,7 +2055,7 @@  discard block
 block discarded – undo
2055 2055
 			} else {
2056 2056
 				foreach ( $value as $k => $v ) {
2057 2057
 					if ( ! is_array( $v ) ) {
2058
-						$value[ $k ] = call_user_func( $original_function, $v );
2058
+						$value[$k] = call_user_func( $original_function, $v );
2059 2059
 					}
2060 2060
 				}
2061 2061
 			}
@@ -2096,7 +2096,7 @@  discard block
 block discarded – undo
2096 2096
 			if ( is_array( $value ) ) {
2097 2097
 				$return = array_merge( $return, self::array_flatten( $value, $keys ) );
2098 2098
 			} elseif ( $keys === 'keep' ) {
2099
-					$return[ $key ] = $value;
2099
+					$return[$key] = $value;
2100 2100
 			} else {
2101 2101
 				$return[] = $value;
2102 2102
 			}
@@ -2157,11 +2157,11 @@  discard block
 block discarded – undo
2157 2157
 		}
2158 2158
 
2159 2159
 		$ver = $default;
2160
-		if ( ! isset( $wp_scripts->registered[ $handle ] ) ) {
2160
+		if ( ! isset( $wp_scripts->registered[$handle] ) ) {
2161 2161
 			return $ver;
2162 2162
 		}
2163 2163
 
2164
-		$query = $wp_scripts->registered[ $handle ];
2164
+		$query = $wp_scripts->registered[$handle];
2165 2165
 		if ( is_object( $query ) && ! empty( $query->ver ) ) {
2166 2166
 			$ver = $query->ver;
2167 2167
 		}
@@ -2177,7 +2177,7 @@  discard block
 block discarded – undo
2177 2177
 	 * @return string|null
2178 2178
 	 */
2179 2179
 	public static function js_redirect( $url, $echo = false ) {
2180
-		$callback = function () use ( $url ) {
2180
+		$callback = function() use ( $url ) {
2181 2181
 			echo '<script type="text/javascript">window.location="' . esc_url_raw( $url ) . '"</script>';
2182 2182
 		};
2183 2183
 		return self::clip( $callback, $echo );
@@ -2272,7 +2272,7 @@  discard block
 block discarded – undo
2272 2272
 			$suffix = 2;
2273 2273
 			do {
2274 2274
 				$key_check = $key . $separator . $suffix;
2275
-				++$suffix;
2275
+				++ $suffix;
2276 2276
 			} while ( in_array( $key_check, $similar_keys, true ) );
2277 2277
 
2278 2278
 			$key = $key_check;
@@ -2380,7 +2380,7 @@  discard block
 block discarded – undo
2380 2380
 
2381 2381
 		foreach ( array( 'name', 'description' ) as $var ) {
2382 2382
 			$default_val    = isset( $record->{$var} ) ? $record->{$var} : '';
2383
-			$values[ $var ] = self::get_param( $var, $default_val, 'get', 'wp_kses_post' );
2383
+			$values[$var] = self::get_param( $var, $default_val, 'get', 'wp_kses_post' );
2384 2384
 			unset( $var, $default_val );
2385 2385
 		}
2386 2386
 
@@ -2436,9 +2436,9 @@  discard block
 block discarded – undo
2436 2436
 			$meta_value = FrmEntryMeta::get_meta_value( $record, $field->id );
2437 2437
 		}//end if
2438 2438
 
2439
-		$field_type = isset( $post_values['field_options'][ 'type_' . $field->id ] ) ? $post_values['field_options'][ 'type_' . $field->id ] : $field->type;
2440
-		if ( isset( $post_values['item_meta'][ $field->id ] ) ) {
2441
-			$new_value = $post_values['item_meta'][ $field->id ];
2439
+		$field_type = isset( $post_values['field_options']['type_' . $field->id] ) ? $post_values['field_options']['type_' . $field->id] : $field->type;
2440
+		if ( isset( $post_values['item_meta'][$field->id] ) ) {
2441
+			$new_value = $post_values['item_meta'][$field->id];
2442 2442
 			self::unserialize_or_decode( $new_value );
2443 2443
 		} else {
2444 2444
 			$new_value = $meta_value;
@@ -2459,7 +2459,7 @@  discard block
 block discarded – undo
2459 2459
 
2460 2460
 		$field_array = array_merge( (array) $field->field_options, $field_array );
2461 2461
 
2462
-		$values['fields'][ $field->id ] = $field_array;
2462
+		$values['fields'][$field->id] = $field_array;
2463 2463
 	}
2464 2464
 
2465 2465
 	/**
@@ -2509,11 +2509,11 @@  discard block
 block discarded – undo
2509 2509
 		}
2510 2510
 
2511 2511
 		foreach ( $form->options as $opt => $value ) {
2512
-			if ( isset( $post_values[ $opt ] ) ) {
2513
-				$values[ $opt ] = $post_values[ $opt ];
2514
-				self::unserialize_or_decode( $values[ $opt ] );
2512
+			if ( isset( $post_values[$opt] ) ) {
2513
+				$values[$opt] = $post_values[$opt];
2514
+				self::unserialize_or_decode( $values[$opt] );
2515 2515
 			} else {
2516
-				$values[ $opt ] = $value;
2516
+				$values[$opt] = $value;
2517 2517
 			}
2518 2518
 		}
2519 2519
 
@@ -2527,8 +2527,8 @@  discard block
 block discarded – undo
2527 2527
 		$form_defaults = FrmFormsHelper::get_default_opts();
2528 2528
 
2529 2529
 		foreach ( $form_defaults as $opt => $default ) {
2530
-			if ( ! isset( $values[ $opt ] ) || $values[ $opt ] == '' ) {
2531
-				$values[ $opt ] = $post_values && isset( $post_values['options'][ $opt ] ) ? $post_values['options'][ $opt ] : $default;
2530
+			if ( ! isset( $values[$opt] ) || $values[$opt] == '' ) {
2531
+				$values[$opt] = $post_values && isset( $post_values['options'][$opt] ) ? $post_values['options'][$opt] : $default;
2532 2532
 			}
2533 2533
 
2534 2534
 			unset( $opt, $default );
@@ -2539,8 +2539,8 @@  discard block
 block discarded – undo
2539 2539
 		}
2540 2540
 
2541 2541
 		foreach ( array( 'before', 'after', 'submit' ) as $h ) {
2542
-			if ( ! isset( $values[ $h . '_html' ] ) ) {
2543
-				$values[ $h . '_html' ] = ( isset( $post_values['options'][ $h . '_html' ] ) ? $post_values['options'][ $h . '_html' ] : FrmFormsHelper::get_default_html( $h ) );
2542
+			if ( ! isset( $values[$h . '_html'] ) ) {
2543
+				$values[$h . '_html'] = ( isset( $post_values['options'][$h . '_html'] ) ? $post_values['options'][$h . '_html'] : FrmFormsHelper::get_default_html( $h ) );
2544 2544
 			}
2545 2545
 			unset( $h );
2546 2546
 		}
@@ -2730,25 +2730,25 @@  discard block
 block discarded – undo
2730 2730
 		if ( ! is_numeric( $levels ) ) {
2731 2731
 			// Show time in specified unit.
2732 2732
 			$levels = self::get_unit( $levels );
2733
-			if ( isset( $time_strings[ $levels ] ) ) {
2733
+			if ( isset( $time_strings[$levels] ) ) {
2734 2734
 				$diff         = array(
2735 2735
 					$levels => self::time_format( $levels, $diff ),
2736 2736
 				);
2737 2737
 				$time_strings = array(
2738
-					$levels => $time_strings[ $levels ],
2738
+					$levels => $time_strings[$levels],
2739 2739
 				);
2740 2740
 			}
2741 2741
 			$levels = 1;
2742 2742
 		}
2743 2743
 
2744 2744
 		foreach ( $time_strings as $k => $v ) {
2745
-			if ( isset( $diff[ $k ] ) && $diff[ $k ] ) {
2746
-				$time_strings[ $k ] = $diff[ $k ] . ' ' . ( $diff[ $k ] > 1 ? $v[1] : $v[0] );
2747
-			} elseif ( isset( $diff[ $k ] ) && count( $time_strings ) === 1 ) {
2745
+			if ( isset( $diff[$k] ) && $diff[$k] ) {
2746
+				$time_strings[$k] = $diff[$k] . ' ' . ( $diff[$k] > 1 ? $v[1] : $v[0] );
2747
+			} elseif ( isset( $diff[$k] ) && count( $time_strings ) === 1 ) {
2748 2748
 				// Account for 0.
2749
-				$time_strings[ $k ] = $diff[ $k ] . ' ' . $v[1];
2749
+				$time_strings[$k] = $diff[$k] . ' ' . $v[1];
2750 2750
 			} else {
2751
-				unset( $time_strings[ $k ] );
2751
+				unset( $time_strings[$k] );
2752 2752
 			}
2753 2753
 		}
2754 2754
 
@@ -2767,8 +2767,8 @@  discard block
 block discarded – undo
2767 2767
 			'y' => 'y',
2768 2768
 			'd' => 'days',
2769 2769
 		);
2770
-		if ( isset( $return[ $unit ] ) ) {
2771
-			return $diff[ $return[ $unit ] ];
2770
+		if ( isset( $return[$unit] ) ) {
2771
+			return $diff[$return[$unit]];
2772 2772
 		}
2773 2773
 
2774 2774
 		$total = $diff['days'] * self::convert_time( 'd', $unit );
@@ -2776,11 +2776,11 @@  discard block
 block discarded – undo
2776 2776
 		$times = array( 'h', 'i', 's' );
2777 2777
 
2778 2778
 		foreach ( $times as $time ) {
2779
-			if ( ! isset( $diff[ $time ] ) ) {
2779
+			if ( ! isset( $diff[$time] ) ) {
2780 2780
 				continue;
2781 2781
 			}
2782 2782
 
2783
-			$total += $diff[ $time ] * self::convert_time( $time, $unit );
2783
+			$total += $diff[$time] * self::convert_time( $time, $unit );
2784 2784
 		}
2785 2785
 
2786 2786
 		return floor( $total );
@@ -2800,7 +2800,7 @@  discard block
 block discarded – undo
2800 2800
 			'y' => DAY_IN_SECONDS * 365.25,
2801 2801
 		);
2802 2802
 
2803
-		return $convert[ $from ] / $convert[ $to ];
2803
+		return $convert[$from] / $convert[$to];
2804 2804
 	}
2805 2805
 
2806 2806
 	/**
@@ -2808,7 +2808,7 @@  discard block
 block discarded – undo
2808 2808
 	 */
2809 2809
 	private static function get_unit( $unit ) {
2810 2810
 		$units = self::get_time_strings();
2811
-		if ( isset( $units[ $unit ] ) || is_numeric( $unit ) ) {
2811
+		if ( isset( $units[$unit] ) || is_numeric( $unit ) ) {
2812 2812
 			return $unit;
2813 2813
 		}
2814 2814
 
@@ -2924,17 +2924,17 @@  discard block
 block discarded – undo
2924 2924
 
2925 2925
 					case 1:
2926 2926
 						$l2 = $name;
2927
-						self::add_value_to_array( $name, $l2, $this_val, $vars[ $l1 ] );
2927
+						self::add_value_to_array( $name, $l2, $this_val, $vars[$l1] );
2928 2928
 						break;
2929 2929
 
2930 2930
 					case 2:
2931 2931
 						$l3 = $name;
2932
-						self::add_value_to_array( $name, $l3, $this_val, $vars[ $l1 ][ $l2 ] );
2932
+						self::add_value_to_array( $name, $l3, $this_val, $vars[$l1][$l2] );
2933 2933
 						break;
2934 2934
 
2935 2935
 					case 3:
2936 2936
 						$l4 = $name;
2937
-						self::add_value_to_array( $name, $l4, $this_val, $vars[ $l1 ][ $l2 ][ $l3 ] );
2937
+						self::add_value_to_array( $name, $l4, $this_val, $vars[$l1][$l2][$l3] );
2938 2938
 				}
2939 2939
 
2940 2940
 				unset( $this_val, $n );
@@ -2953,8 +2953,8 @@  discard block
 block discarded – undo
2953 2953
 	public static function add_value_to_array( $name, $l1, $val, &$vars ) {
2954 2954
 		if ( $name == '' ) {
2955 2955
 			$vars[] = $val;
2956
-		} elseif ( ! isset( $vars[ $l1 ] ) ) {
2957
-			$vars[ $l1 ] = $val;
2956
+		} elseif ( ! isset( $vars[$l1] ) ) {
2957
+			$vars[$l1] = $val;
2958 2958
 		}
2959 2959
 	}
2960 2960
 
@@ -2971,7 +2971,7 @@  discard block
 block discarded – undo
2971 2971
 			'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' ),
2972 2972
 		);
2973 2973
 
2974
-		if ( ! isset( $tooltips[ $name ] ) ) {
2974
+		if ( ! isset( $tooltips[$name] ) ) {
2975 2975
 			return;
2976 2976
 		}
2977 2977
 
@@ -2981,7 +2981,7 @@  discard block
 block discarded – undo
2981 2981
 			echo ' class="frm_help"';
2982 2982
 		}
2983 2983
 
2984
-		echo ' title="' . esc_attr( $tooltips[ $name ] );
2984
+		echo ' title="' . esc_attr( $tooltips[$name] );
2985 2985
 
2986 2986
 		if ( 'open' != $class ) {
2987 2987
 			echo '"';
@@ -3040,13 +3040,13 @@  discard block
 block discarded – undo
3040 3040
 	}
3041 3041
 
3042 3042
 	private static function prepare_action_slashes( $val, $key, &$post_content ) {
3043
-		if ( ! isset( $post_content[ $key ] ) || is_numeric( $val ) ) {
3043
+		if ( ! isset( $post_content[$key] ) || is_numeric( $val ) ) {
3044 3044
 			return;
3045 3045
 		}
3046 3046
 
3047 3047
 		if ( is_array( $val ) ) {
3048 3048
 			foreach ( $val as $k1 => $v1 ) {
3049
-				self::prepare_action_slashes( $v1, $k1, $post_content[ $key ] );
3049
+				self::prepare_action_slashes( $v1, $k1, $post_content[$key] );
3050 3050
 				unset( $k1, $v1 );
3051 3051
 			}
3052 3052
 		} else {
@@ -3054,7 +3054,7 @@  discard block
 block discarded – undo
3054 3054
 			$val = stripslashes( $val );
3055 3055
 
3056 3056
 			// Add backslashes before double quotes and forward slashes only
3057
-			$post_content[ $key ] = addcslashes( $val, '"\\/' );
3057
+			$post_content[$key] = addcslashes( $val, '"\\/' );
3058 3058
 		}
3059 3059
 	}
3060 3060
 
@@ -3175,14 +3175,14 @@  discard block
 block discarded – undo
3175 3175
 				continue;
3176 3176
 			}
3177 3177
 			$key = $input['name'];
3178
-			if ( isset( $formatted[ $key ] ) ) {
3179
-				if ( is_array( $formatted[ $key ] ) ) {
3180
-					$formatted[ $key ][] = $input['value'];
3178
+			if ( isset( $formatted[$key] ) ) {
3179
+				if ( is_array( $formatted[$key] ) ) {
3180
+					$formatted[$key][] = $input['value'];
3181 3181
 				} else {
3182
-					$formatted[ $key ] = array( $formatted[ $key ], $input['value'] );
3182
+					$formatted[$key] = array( $formatted[$key], $input['value'] );
3183 3183
 				}
3184 3184
 			} else {
3185
-				$formatted[ $key ] = $input['value'];
3185
+				$formatted[$key] = $input['value'];
3186 3186
 			}
3187 3187
 		}
3188 3188
 
@@ -3908,8 +3908,8 @@  discard block
 block discarded – undo
3908 3908
 		}
3909 3909
 
3910 3910
 		foreach ( $keys as $key ) {
3911
-			if ( isset( $values[ $key ] ) ) {
3912
-				$values[ $key ] = self::kses( $values[ $key ], 'all' );
3911
+			if ( isset( $values[$key] ) ) {
3912
+				$values[$key] = self::kses( $values[$key], 'all' );
3913 3913
 			}
3914 3914
 		}
3915 3915
 
@@ -3974,7 +3974,7 @@  discard block
 block discarded – undo
3974 3974
 				'role',
3975 3975
 				'style',
3976 3976
 			);
3977
-			$safe      = in_array( $key, $safe_keys, true );
3977
+			$safe = in_array( $key, $safe_keys, true );
3978 3978
 		}//end if
3979 3979
 
3980 3980
 		/**
@@ -4113,7 +4113,7 @@  discard block
 block discarded – undo
4113 4113
 			return 0;
4114 4114
 		}
4115 4115
 
4116
-		return strlen( $parts[ count( $parts ) - 1 ] );
4116
+		return strlen( $parts[count( $parts ) - 1] );
4117 4117
 	}
4118 4118
 
4119 4119
 	/**
@@ -4133,7 +4133,7 @@  discard block
 block discarded – undo
4133 4133
 
4134 4134
 		add_filter(
4135 4135
 			'option_gmt_offset',
4136
-			function ( $offset ) {
4136
+			function( $offset ) {
4137 4137
 				if ( ! is_string( $offset ) || is_numeric( $offset ) ) {
4138 4138
 					// Leave a valid value alone.
4139 4139
 					return $offset;
@@ -4230,7 +4230,7 @@  discard block
 block discarded – undo
4230 4230
 			return;
4231 4231
 		}
4232 4232
 
4233
-		$ajax_callback = function () use ( $option ) {
4233
+		$ajax_callback = function() use ( $option ) {
4234 4234
 			self::dismiss_warning_message( $option );
4235 4235
 		};
4236 4236
 
@@ -4240,7 +4240,7 @@  discard block
 block discarded – undo
4240 4240
 
4241 4241
 		add_filter(
4242 4242
 			'frm_message_list',
4243
-			function ( $show_messages ) use ( $message, $option ) {
4243
+			function( $show_messages ) use ( $message, $option ) {
4244 4244
 				if ( get_option( $option, false ) ) {
4245 4245
 					return $show_messages;
4246 4246
 				}
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.
stripe/controllers/FrmStrpLiteAppController.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -148,13 +148,13 @@  discard block
 block discarded – undo
148 148
 
149 149
 		$is_setup_intent = 0 === strpos( $intent->id, 'seti_' );
150 150
 		if ( $is_setup_intent ) {
151
-			$errors[ 'field' . $cc_field_id ] = is_object( $intent->last_setup_error ) ? $intent->last_setup_error->message : '';
151
+			$errors['field' . $cc_field_id] = is_object( $intent->last_setup_error ) ? $intent->last_setup_error->message : '';
152 152
 		} else {
153
-			$errors[ 'field' . $cc_field_id ] = is_object( $intent->last_payment_error ) ? $intent->last_payment_error->message : '';
153
+			$errors['field' . $cc_field_id] = is_object( $intent->last_payment_error ) ? $intent->last_payment_error->message : '';
154 154
 		}
155 155
 
156
-		if ( ! $errors[ 'field' . $cc_field_id ] ) {
157
-			$errors[ 'field' . $cc_field_id ] = 'Payment was not successfully processed.';
156
+		if ( ! $errors['field' . $cc_field_id] ) {
157
+			$errors['field' . $cc_field_id] = 'Payment was not successfully processed.';
158 158
 		}
159 159
 
160 160
 		global $frm_vars;
@@ -182,10 +182,10 @@  discard block
 block discarded – undo
182 182
 		$save_draft = ! empty( $form->options['save_draft'] );
183 183
 
184 184
 		global $frm_vars;
185
-		$frm_vars['created_entries'][ $form_id ]['errors'] = $errors;
185
+		$frm_vars['created_entries'][$form_id]['errors'] = $errors;
186 186
 
187 187
 		// Set to true to get FrmProFieldsHelper::get_page_with_error() run.
188
-		$_POST[ 'frm_page_order_' . $form_id ] = true;
188
+		$_POST['frm_page_order_' . $form_id] = true;
189 189
 
190 190
 		if ( ! $save_draft ) {
191 191
 			// If draft saving is not on, delete the entry.
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
 		}
195 195
 
196 196
 		// If draft saving is on, load the draft entry.
197
-		$frm_vars['created_entries'][ $form_id ]['entry_id'] = $entry_id;
197
+		$frm_vars['created_entries'][$form_id]['entry_id'] = $entry_id;
198 198
 		add_action(
199 199
 			'frm_filter_final_form',
200 200
 			/**
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
 			 * @param int    $entry_id
205 205
 			 * @return string
206 206
 			 */
207
-			function ( $html ) use ( $entry_id ) {
207
+			function( $html ) use ( $entry_id ) {
208 208
 				global $wpdb;
209 209
 				$wpdb->update( $wpdb->prefix . 'frm_items', array( 'is_draft' => 1 ), array( 'id' => $entry_id ) );
210 210
 				return $html;
Please login to merge, or discard this patch.
stripe/controllers/FrmTransLiteActionsController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -393,8 +393,8 @@  discard block
 block discarded – undo
393 393
 			return $values;
394 394
 		}
395 395
 
396
-		if ( is_array( $previous_entry->metas ) && isset( $previous_entry->metas[ $field->id ] ) ) {
397
-			$values['value'] = $previous_entry->metas[ $field->id ];
396
+		if ( is_array( $previous_entry->metas ) && isset( $previous_entry->metas[$field->id] ) ) {
397
+			$values['value'] = $previous_entry->metas[$field->id];
398 398
 		}
399 399
 
400 400
 		$frm_vars['trans_filled'] = true;
@@ -429,7 +429,7 @@  discard block
 block discarded – undo
429 429
 			 * @param Closure    $destroy_callback
430 430
 			 * @return void
431 431
 			 */
432
-			function () use ( $entry_id, &$destroy_callback ) {
432
+			function() use ( $entry_id, &$destroy_callback ) {
433 433
 				FrmEntry::destroy( $entry_id );
434 434
 				// Only call this once.
435 435
 				remove_action( 'frm_entry_form', $destroy_callback );
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.