Completed
Push — master ( 4265bb...2b31c5 )
by
unknown
18s
created
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
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
 			'fill'   => '#4d4d4d',
249 249
 			'orange' => '#f05a24',
250 250
 		);
251
-		$atts     = array_merge( $defaults, $atts );
251
+		$atts = array_merge( $defaults, $atts );
252 252
 
253 253
 		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'] ) . '">
254 254
 			<path fill="' . esc_attr( $atts['orange'] ) . '" d="M289.6 384h140v76h-140z"/>
@@ -536,7 +536,7 @@  discard block
 block discarded – undo
536 536
 	 * @return string
537 537
 	 */
538 538
 	public static function get_server_value( $value ) {
539
-		return isset( $_SERVER[ $value ] ) ? wp_strip_all_tags( wp_unslash( $_SERVER[ $value ] ) ) : '';
539
+		return isset( $_SERVER[$value] ) ? wp_strip_all_tags( wp_unslash( $_SERVER[$value] ) ) : '';
540 540
 	}
541 541
 
542 542
 	/**
@@ -570,7 +570,7 @@  discard block
 block discarded – undo
570 570
 		$ip         = '';
571 571
 
572 572
 		foreach ( $ip_options as $key ) {
573
-			if ( ! isset( $_SERVER[ $key ] ) ) {
573
+			if ( ! isset( $_SERVER[$key] ) ) {
574 574
 				continue;
575 575
 			}
576 576
 
@@ -639,10 +639,10 @@  discard block
 block discarded – undo
639 639
 		}
640 640
 
641 641
 		if ( $src === 'get' ) {
642
-			$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
643
-			if ( ! isset( $_POST[ $param ] ) && isset( $_GET[ $param ] ) && ! is_array( $value ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
642
+			$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
643
+			if ( ! isset( $_POST[$param] ) && isset( $_GET[$param] ) && ! is_array( $value ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
644 644
 				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
645
-				$value = htmlspecialchars_decode( wp_unslash( $_GET[ $param ] ) );
645
+				$value = htmlspecialchars_decode( wp_unslash( $_GET[$param] ) );
646 646
 			}
647 647
 			self::sanitize_value( $sanitize, $value );
648 648
 		} else {
@@ -663,7 +663,7 @@  discard block
 block discarded – undo
663 663
 				}
664 664
 
665 665
 				$p     = trim( $p, ']' );
666
-				$value = $value[ $p ] ?? $default;
666
+				$value = $value[$p] ?? $default;
667 667
 			}
668 668
 		}
669 669
 
@@ -728,26 +728,26 @@  discard block
 block discarded – undo
728 728
 			'sanitize'   => 'sanitize_text_field',
729 729
 			'serialized' => false,
730 730
 		);
731
-		$args     = wp_parse_args( $args, $defaults );
731
+		$args = wp_parse_args( $args, $defaults );
732 732
 
733 733
 		$value = $args['default'];
734 734
 		if ( $args['type'] === 'get' ) {
735
-			if ( $_GET && isset( $_GET[ $args['param'] ] ) ) {
735
+			if ( $_GET && isset( $_GET[$args['param']] ) ) {
736 736
 				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
737
-				$value = wp_unslash( $_GET[ $args['param'] ] );
737
+				$value = wp_unslash( $_GET[$args['param']] );
738 738
 			}
739 739
 		} elseif ( $args['type'] === 'post' ) {
740
-			if ( isset( $_POST[ $args['param'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
740
+			if ( isset( $_POST[$args['param']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
741 741
 				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
742
-				$value = wp_unslash( $_POST[ $args['param'] ] );
742
+				$value = wp_unslash( $_POST[$args['param']] );
743 743
 				if ( $args['serialized'] === true && is_serialized_string( $value ) && is_serialized( $value ) ) {
744 744
 					self::unserialize_or_decode( $value );
745 745
 				}
746 746
 			}
747
-		} elseif ( isset( $_REQUEST[ $args['param'] ] ) ) {
747
+		} elseif ( isset( $_REQUEST[$args['param']] ) ) {
748 748
 			// phpcs:ignore WordPress.Security.NonceVerification.Missing
749 749
 				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
750
-				$value = wp_unslash( $_REQUEST[ $args['param'] ] );
750
+				$value = wp_unslash( $_REQUEST[$args['param']] );
751 751
 		}
752 752
 
753 753
 		self::sanitize_value( $args['sanitize'], $value );
@@ -794,7 +794,7 @@  discard block
 block discarded – undo
794 794
 		if ( is_array( $value ) ) {
795 795
 			$temp_values = $value;
796 796
 			foreach ( $temp_values as $k => $v ) {
797
-				self::sanitize_value( $sanitize, $value[ $k ] );
797
+				self::sanitize_value( $sanitize, $value[$k] );
798 798
 			}
799 799
 			return;
800 800
 		}
@@ -805,8 +805,8 @@  discard block
 block discarded – undo
805 805
 	public static function sanitize_request( $sanitize_method, &$values ) {
806 806
 		$temp_values = $values;
807 807
 		foreach ( $temp_values as $k => $val ) {
808
-			if ( isset( $sanitize_method[ $k ] ) ) {
809
-				$values[ $k ] = call_user_func( $sanitize_method[ $k ], $val );
808
+			if ( isset( $sanitize_method[$k] ) ) {
809
+				$values[$k] = call_user_func( $sanitize_method[$k], $val );
810 810
 			}
811 811
 		}
812 812
 	}
@@ -866,7 +866,7 @@  discard block
 block discarded – undo
866 866
 		if ( is_array( $value ) ) {
867 867
 			$temp_values = $value;
868 868
 			foreach ( $temp_values as $k => $v ) {
869
-				self::decode_specialchars( $value[ $k ] );
869
+				self::decode_specialchars( $value[$k] );
870 870
 			}
871 871
 		} else {
872 872
 			self::decode_amp( $value );
@@ -1001,7 +1001,7 @@  discard block
 block discarded – undo
1001 1001
 	 * @return array
1002 1002
 	 */
1003 1003
 	public static function add_allowed_submit_button_tags( $allowed_html ) {
1004
-		$allowed_html['input']                    = array(
1004
+		$allowed_html['input'] = array(
1005 1005
 			'type'           => true,
1006 1006
 			'value'          => true,
1007 1007
 			'formnovalidate' => true,
@@ -1024,7 +1024,7 @@  discard block
 block discarded – undo
1024 1024
 			$allowed_html = $html;
1025 1025
 		} elseif ( ! empty( $allowed ) ) {
1026 1026
 			foreach ( (array) $allowed as $a ) {
1027
-				$allowed_html[ $a ] = $html[ $a ] ?? array();
1027
+				$allowed_html[$a] = $html[$a] ?? array();
1028 1028
 			}
1029 1029
 		}
1030 1030
 
@@ -1208,8 +1208,8 @@  discard block
 block discarded – undo
1208 1208
 		}
1209 1209
 
1210 1210
 		global $wp_query;
1211
-		if ( isset( $wp_query->query_vars[ $param ] ) ) {
1212
-			$value = $wp_query->query_vars[ $param ];
1211
+		if ( isset( $wp_query->query_vars[$param] ) ) {
1212
+			$value = $wp_query->query_vars[$param];
1213 1213
 		}
1214 1214
 
1215 1215
 		return $value;
@@ -1240,9 +1240,9 @@  discard block
 block discarded – undo
1240 1240
 			'frm_keyalt_icon'       => 'frm_key_icon',
1241 1241
 			'frm_keyalt_solid_icon' => 'frm_key_solid_icon',
1242 1242
 		);
1243
-		if ( isset( $deprecated[ $icon ] ) ) {
1244
-			$icon  = $deprecated[ $icon ];
1245
-			$class = str_replace( $icon, $deprecated[ $icon ], $class );
1243
+		if ( isset( $deprecated[$icon] ) ) {
1244
+			$icon  = $deprecated[$icon];
1245
+			$class = str_replace( $icon, $deprecated[$icon], $class );
1246 1246
 		}
1247 1247
 
1248 1248
 		if ( $icon === $class ) {
@@ -1365,7 +1365,7 @@  discard block
 block discarded – undo
1365 1365
 	 * @return string|void
1366 1366
 	 */
1367 1367
 	public static function array_to_html_params( $atts, $echo = false ) {
1368
-		$callback = function () use ( $atts ) {
1368
+		$callback = function() use ( $atts ) {
1369 1369
 			if ( $atts ) {
1370 1370
 				foreach ( $atts as $key => $value ) {
1371 1371
 					echo ' ' . esc_attr( $key ) . '="' . esc_attr( $value ) . '"';
@@ -1543,7 +1543,7 @@  discard block
 block discarded – undo
1543 1543
 			'value'       => false,
1544 1544
 			'class'       => '',
1545 1545
 		);
1546
-		$atts     = array_merge( $defaults, $atts );
1546
+		$atts = array_merge( $defaults, $atts );
1547 1547
 
1548 1548
 		if ( $atts['input_id'] === 'template' && empty( $atts['tosearch'] ) ) {
1549 1549
 			$atts['tosearch'] = 'frm-card';
@@ -1619,7 +1619,7 @@  discard block
 block discarded – undo
1619 1619
 				'new_file_path' => self::plugin_path() . '/js',
1620 1620
 			)
1621 1621
 		);
1622
-		$new_file  = new FrmCreateFile( $file_atts );
1622
+		$new_file = new FrmCreateFile( $file_atts );
1623 1623
 
1624 1624
 		$files = array(
1625 1625
 			self::plugin_path() . '/js/formidable.min.js',
@@ -1833,8 +1833,8 @@  discard block
 block discarded – undo
1833 1833
 	 */
1834 1834
 	private static function get_dropdown_value_and_label_from_option( $option, $key, $args ) {
1835 1835
 		if ( is_array( $option ) ) {
1836
-			$value = $option[ $args['value_key'] ] ?? '';
1837
-			$label = $option[ $args['label_key'] ] ?? '';
1836
+			$value = $option[$args['value_key']] ?? '';
1837
+			$label = $option[$args['label_key']] ?? '';
1838 1838
 		} else {
1839 1839
 			$value = $key;
1840 1840
 			$label = $option;
@@ -2217,8 +2217,8 @@  discard block
 block discarded – undo
2217 2217
 			return $error;
2218 2218
 		}
2219 2219
 
2220
-		$nonce_value = $_REQUEST && isset( $_REQUEST[ $nonce_name ] ) ? sanitize_text_field( wp_unslash( $_REQUEST[ $nonce_name ] ) ) : '';
2221
-		if ( $_REQUEST && ( ! isset( $_REQUEST[ $nonce_name ] ) || ! wp_verify_nonce( $nonce_value, $nonce ) ) ) {
2220
+		$nonce_value = $_REQUEST && isset( $_REQUEST[$nonce_name] ) ? sanitize_text_field( wp_unslash( $_REQUEST[$nonce_name] ) ) : '';
2221
+		if ( $_REQUEST && ( ! isset( $_REQUEST[$nonce_name] ) || ! wp_verify_nonce( $nonce_value, $nonce ) ) ) {
2222 2222
 			$frm_settings = self::get_settings();
2223 2223
 			$error        = $frm_settings->admin_permission;
2224 2224
 		}
@@ -2254,7 +2254,7 @@  discard block
 block discarded – undo
2254 2254
 			} else {
2255 2255
 				foreach ( $value as $k => $v ) {
2256 2256
 					if ( ! is_array( $v ) ) {
2257
-						$value[ $k ] = call_user_func( $original_function, $v );
2257
+						$value[$k] = call_user_func( $original_function, $v );
2258 2258
 					}
2259 2259
 				}
2260 2260
 			}
@@ -2295,7 +2295,7 @@  discard block
 block discarded – undo
2295 2295
 			if ( is_array( $value ) ) {
2296 2296
 				$return = array_merge( $return, self::array_flatten( $value, $keys ) );
2297 2297
 			} elseif ( $keys === 'keep' ) {
2298
-					$return[ $key ] = $value;
2298
+					$return[$key] = $value;
2299 2299
 			} else {
2300 2300
 				$return[] = $value;
2301 2301
 			}
@@ -2370,11 +2370,11 @@  discard block
 block discarded – undo
2370 2370
 		}
2371 2371
 
2372 2372
 		$ver = $default;
2373
-		if ( ! isset( $wp_scripts->registered[ $handle ] ) ) {
2373
+		if ( ! isset( $wp_scripts->registered[$handle] ) ) {
2374 2374
 			return $ver;
2375 2375
 		}
2376 2376
 
2377
-		$query = $wp_scripts->registered[ $handle ];
2377
+		$query = $wp_scripts->registered[$handle];
2378 2378
 		if ( is_object( $query ) && ! empty( $query->ver ) ) {
2379 2379
 			$ver = $query->ver;
2380 2380
 		}
@@ -2390,7 +2390,7 @@  discard block
 block discarded – undo
2390 2390
 	 * @return string|null
2391 2391
 	 */
2392 2392
 	public static function js_redirect( $url, $echo = false ) {
2393
-		$callback = function () use ( $url ) {
2393
+		$callback = function() use ( $url ) {
2394 2394
 			echo '<script type="text/javascript">window.location="' . esc_url_raw( $url ) . '"</script>';
2395 2395
 		};
2396 2396
 		return self::clip( $callback, $echo );
@@ -2485,7 +2485,7 @@  discard block
 block discarded – undo
2485 2485
 			$suffix = 2;
2486 2486
 			do {
2487 2487
 				$key_check = $key . $separator . $suffix;
2488
-				++$suffix;
2488
+				++ $suffix;
2489 2489
 			} while ( in_array( $key_check, $similar_keys, true ) );
2490 2490
 
2491 2491
 			$key = $key_check;
@@ -2595,7 +2595,7 @@  discard block
 block discarded – undo
2595 2595
 
2596 2596
 		foreach ( array( 'name', 'description' ) as $var ) {
2597 2597
 			$default_val    = $record->{$var} ?? '';
2598
-			$values[ $var ] = self::get_param( $var, $default_val, 'get', 'wp_kses_post' );
2598
+			$values[$var] = self::get_param( $var, $default_val, 'get', 'wp_kses_post' );
2599 2599
 			unset( $var, $default_val );
2600 2600
 		}
2601 2601
 
@@ -2651,9 +2651,9 @@  discard block
 block discarded – undo
2651 2651
 			$meta_value = FrmEntryMeta::get_meta_value( $record, $field->id );
2652 2652
 		}//end if
2653 2653
 
2654
-		$field_type = $post_values['field_options'][ 'type_' . $field->id ] ?? $field->type;
2655
-		if ( isset( $post_values['item_meta'][ $field->id ] ) ) {
2656
-			$new_value = $post_values['item_meta'][ $field->id ];
2654
+		$field_type = $post_values['field_options']['type_' . $field->id] ?? $field->type;
2655
+		if ( isset( $post_values['item_meta'][$field->id] ) ) {
2656
+			$new_value = $post_values['item_meta'][$field->id];
2657 2657
 			self::unserialize_or_decode( $new_value );
2658 2658
 		} else {
2659 2659
 			$new_value = $meta_value;
@@ -2674,7 +2674,7 @@  discard block
 block discarded – undo
2674 2674
 
2675 2675
 		$field_array = array_merge( (array) $field->field_options, $field_array );
2676 2676
 
2677
-		$values['fields'][ $field->id ] = $field_array;
2677
+		$values['fields'][$field->id] = $field_array;
2678 2678
 	}
2679 2679
 
2680 2680
 	/**
@@ -2724,11 +2724,11 @@  discard block
 block discarded – undo
2724 2724
 		}
2725 2725
 
2726 2726
 		foreach ( $form->options as $opt => $value ) {
2727
-			if ( isset( $post_values[ $opt ] ) ) {
2728
-				$values[ $opt ] = $post_values[ $opt ];
2729
-				self::unserialize_or_decode( $values[ $opt ] );
2727
+			if ( isset( $post_values[$opt] ) ) {
2728
+				$values[$opt] = $post_values[$opt];
2729
+				self::unserialize_or_decode( $values[$opt] );
2730 2730
 			} else {
2731
-				$values[ $opt ] = $value;
2731
+				$values[$opt] = $value;
2732 2732
 			}
2733 2733
 		}
2734 2734
 
@@ -2742,8 +2742,8 @@  discard block
 block discarded – undo
2742 2742
 		$form_defaults = FrmFormsHelper::get_default_opts();
2743 2743
 
2744 2744
 		foreach ( $form_defaults as $opt => $default ) {
2745
-			if ( ! isset( $values[ $opt ] ) || $values[ $opt ] == '' ) {
2746
-				$values[ $opt ] = $post_values && isset( $post_values['options'][ $opt ] ) ? $post_values['options'][ $opt ] : $default;
2745
+			if ( ! isset( $values[$opt] ) || $values[$opt] == '' ) {
2746
+				$values[$opt] = $post_values && isset( $post_values['options'][$opt] ) ? $post_values['options'][$opt] : $default;
2747 2747
 			}
2748 2748
 
2749 2749
 			unset( $opt, $default );
@@ -2754,8 +2754,8 @@  discard block
 block discarded – undo
2754 2754
 		}
2755 2755
 
2756 2756
 		foreach ( array( 'before', 'after', 'submit' ) as $h ) {
2757
-			if ( ! isset( $values[ $h . '_html' ] ) ) {
2758
-				$values[ $h . '_html' ] = ( $post_values['options'][ $h . '_html' ] ?? FrmFormsHelper::get_default_html( $h ) );
2757
+			if ( ! isset( $values[$h . '_html'] ) ) {
2758
+				$values[$h . '_html'] = ( $post_values['options'][$h . '_html'] ?? FrmFormsHelper::get_default_html( $h ) );
2759 2759
 			}
2760 2760
 			unset( $h );
2761 2761
 		}
@@ -2950,25 +2950,25 @@  discard block
 block discarded – undo
2950 2950
 		if ( ! is_numeric( $levels ) ) {
2951 2951
 			// Show time in specified unit.
2952 2952
 			$levels = self::get_unit( $levels );
2953
-			if ( isset( $time_strings[ $levels ] ) ) {
2953
+			if ( isset( $time_strings[$levels] ) ) {
2954 2954
 				$diff         = array(
2955 2955
 					$levels => self::time_format( $levels, $diff ),
2956 2956
 				);
2957 2957
 				$time_strings = array(
2958
-					$levels => $time_strings[ $levels ],
2958
+					$levels => $time_strings[$levels],
2959 2959
 				);
2960 2960
 			}
2961 2961
 			$levels = 1;
2962 2962
 		}
2963 2963
 
2964 2964
 		foreach ( $time_strings as $k => $v ) {
2965
-			if ( isset( $diff[ $k ] ) && $diff[ $k ] ) {
2966
-				$time_strings[ $k ] = $diff[ $k ] . ' ' . ( $diff[ $k ] > 1 ? $v[1] : $v[0] );
2967
-			} elseif ( isset( $diff[ $k ] ) && count( $time_strings ) === 1 ) {
2965
+			if ( isset( $diff[$k] ) && $diff[$k] ) {
2966
+				$time_strings[$k] = $diff[$k] . ' ' . ( $diff[$k] > 1 ? $v[1] : $v[0] );
2967
+			} elseif ( isset( $diff[$k] ) && count( $time_strings ) === 1 ) {
2968 2968
 				// Account for 0.
2969
-				$time_strings[ $k ] = $diff[ $k ] . ' ' . $v[1];
2969
+				$time_strings[$k] = $diff[$k] . ' ' . $v[1];
2970 2970
 			} else {
2971
-				unset( $time_strings[ $k ] );
2971
+				unset( $time_strings[$k] );
2972 2972
 			}
2973 2973
 		}
2974 2974
 
@@ -2987,8 +2987,8 @@  discard block
 block discarded – undo
2987 2987
 			'y' => 'y',
2988 2988
 			'd' => 'days',
2989 2989
 		);
2990
-		if ( isset( $return[ $unit ] ) ) {
2991
-			return $diff[ $return[ $unit ] ];
2990
+		if ( isset( $return[$unit] ) ) {
2991
+			return $diff[$return[$unit]];
2992 2992
 		}
2993 2993
 
2994 2994
 		$total = $diff['days'] * self::convert_time( 'd', $unit );
@@ -2996,11 +2996,11 @@  discard block
 block discarded – undo
2996 2996
 		$times = array( 'h', 'i', 's' );
2997 2997
 
2998 2998
 		foreach ( $times as $time ) {
2999
-			if ( ! isset( $diff[ $time ] ) ) {
2999
+			if ( ! isset( $diff[$time] ) ) {
3000 3000
 				continue;
3001 3001
 			}
3002 3002
 
3003
-			$total += $diff[ $time ] * self::convert_time( $time, $unit );
3003
+			$total += $diff[$time] * self::convert_time( $time, $unit );
3004 3004
 		}
3005 3005
 
3006 3006
 		return floor( $total );
@@ -3020,7 +3020,7 @@  discard block
 block discarded – undo
3020 3020
 			'y' => DAY_IN_SECONDS * 365.25,
3021 3021
 		);
3022 3022
 
3023
-		return $convert[ $from ] / $convert[ $to ];
3023
+		return $convert[$from] / $convert[$to];
3024 3024
 	}
3025 3025
 
3026 3026
 	/**
@@ -3028,7 +3028,7 @@  discard block
 block discarded – undo
3028 3028
 	 */
3029 3029
 	private static function get_unit( $unit ) {
3030 3030
 		$units = self::get_time_strings();
3031
-		if ( isset( $units[ $unit ] ) || is_numeric( $unit ) ) {
3031
+		if ( isset( $units[$unit] ) || is_numeric( $unit ) ) {
3032 3032
 			return $unit;
3033 3033
 		}
3034 3034
 
@@ -3144,17 +3144,17 @@  discard block
 block discarded – undo
3144 3144
 
3145 3145
 					case 1:
3146 3146
 						$l2 = $name;
3147
-						self::add_value_to_array( $name, $l2, $this_val, $vars[ $l1 ] );
3147
+						self::add_value_to_array( $name, $l2, $this_val, $vars[$l1] );
3148 3148
 						break;
3149 3149
 
3150 3150
 					case 2:
3151 3151
 						$l3 = $name;
3152
-						self::add_value_to_array( $name, $l3, $this_val, $vars[ $l1 ][ $l2 ] );
3152
+						self::add_value_to_array( $name, $l3, $this_val, $vars[$l1][$l2] );
3153 3153
 						break;
3154 3154
 
3155 3155
 					case 3:
3156 3156
 						$l4 = $name;
3157
-						self::add_value_to_array( $name, $l4, $this_val, $vars[ $l1 ][ $l2 ][ $l3 ] );
3157
+						self::add_value_to_array( $name, $l4, $this_val, $vars[$l1][$l2][$l3] );
3158 3158
 				}
3159 3159
 
3160 3160
 				unset( $this_val, $n );
@@ -3173,8 +3173,8 @@  discard block
 block discarded – undo
3173 3173
 	public static function add_value_to_array( $name, $l1, $val, &$vars ) {
3174 3174
 		if ( $name == '' ) {
3175 3175
 			$vars[] = $val;
3176
-		} elseif ( ! isset( $vars[ $l1 ] ) ) {
3177
-			$vars[ $l1 ] = $val;
3176
+		} elseif ( ! isset( $vars[$l1] ) ) {
3177
+			$vars[$l1] = $val;
3178 3178
 		}
3179 3179
 	}
3180 3180
 
@@ -3191,7 +3191,7 @@  discard block
 block discarded – undo
3191 3191
 			'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' ),
3192 3192
 		);
3193 3193
 
3194
-		if ( ! isset( $tooltips[ $name ] ) ) {
3194
+		if ( ! isset( $tooltips[$name] ) ) {
3195 3195
 			return;
3196 3196
 		}
3197 3197
 
@@ -3201,7 +3201,7 @@  discard block
 block discarded – undo
3201 3201
 			echo ' class="frm_help"';
3202 3202
 		}
3203 3203
 
3204
-		echo ' title="' . esc_attr( $tooltips[ $name ] );
3204
+		echo ' title="' . esc_attr( $tooltips[$name] );
3205 3205
 
3206 3206
 		if ( 'open' != $class ) {
3207 3207
 			echo '"';
@@ -3260,13 +3260,13 @@  discard block
 block discarded – undo
3260 3260
 	}
3261 3261
 
3262 3262
 	private static function prepare_action_slashes( $val, $key, &$post_content ) {
3263
-		if ( ! isset( $post_content[ $key ] ) || is_numeric( $val ) ) {
3263
+		if ( ! isset( $post_content[$key] ) || is_numeric( $val ) ) {
3264 3264
 			return;
3265 3265
 		}
3266 3266
 
3267 3267
 		if ( is_array( $val ) ) {
3268 3268
 			foreach ( $val as $k1 => $v1 ) {
3269
-				self::prepare_action_slashes( $v1, $k1, $post_content[ $key ] );
3269
+				self::prepare_action_slashes( $v1, $k1, $post_content[$key] );
3270 3270
 				unset( $k1, $v1 );
3271 3271
 			}
3272 3272
 		} else {
@@ -3274,7 +3274,7 @@  discard block
 block discarded – undo
3274 3274
 			$val = stripslashes( $val );
3275 3275
 
3276 3276
 			// Add backslashes before double quotes and forward slashes only
3277
-			$post_content[ $key ] = addcslashes( $val, '"\\/' );
3277
+			$post_content[$key] = addcslashes( $val, '"\\/' );
3278 3278
 		}
3279 3279
 	}
3280 3280
 
@@ -3395,14 +3395,14 @@  discard block
 block discarded – undo
3395 3395
 				continue;
3396 3396
 			}
3397 3397
 			$key = $input['name'];
3398
-			if ( isset( $formatted[ $key ] ) ) {
3399
-				if ( is_array( $formatted[ $key ] ) ) {
3400
-					$formatted[ $key ][] = $input['value'];
3398
+			if ( isset( $formatted[$key] ) ) {
3399
+				if ( is_array( $formatted[$key] ) ) {
3400
+					$formatted[$key][] = $input['value'];
3401 3401
 				} else {
3402
-					$formatted[ $key ] = array( $formatted[ $key ], $input['value'] );
3402
+					$formatted[$key] = array( $formatted[$key], $input['value'] );
3403 3403
 				}
3404 3404
 			} else {
3405
-				$formatted[ $key ] = $input['value'];
3405
+				$formatted[$key] = $input['value'];
3406 3406
 			}
3407 3407
 		}
3408 3408
 
@@ -4104,8 +4104,8 @@  discard block
 block discarded – undo
4104 4104
 		}
4105 4105
 
4106 4106
 		foreach ( $keys as $key ) {
4107
-			if ( isset( $values[ $key ] ) ) {
4108
-				$values[ $key ] = self::kses( $values[ $key ], 'all' );
4107
+			if ( isset( $values[$key] ) ) {
4108
+				$values[$key] = self::kses( $values[$key], 'all' );
4109 4109
 			}
4110 4110
 		}
4111 4111
 
@@ -4170,7 +4170,7 @@  discard block
 block discarded – undo
4170 4170
 				'role',
4171 4171
 				'style',
4172 4172
 			);
4173
-			$safe      = in_array( $key, $safe_keys, true );
4173
+			$safe = in_array( $key, $safe_keys, true );
4174 4174
 		}//end if
4175 4175
 
4176 4176
 		/**
@@ -4316,7 +4316,7 @@  discard block
 block discarded – undo
4316 4316
 			return 0;
4317 4317
 		}
4318 4318
 
4319
-		return strlen( $parts[ count( $parts ) - 1 ] );
4319
+		return strlen( $parts[count( $parts ) - 1] );
4320 4320
 	}
4321 4321
 
4322 4322
 	/**
@@ -4336,7 +4336,7 @@  discard block
 block discarded – undo
4336 4336
 
4337 4337
 		add_filter(
4338 4338
 			'option_gmt_offset',
4339
-			function ( $offset ) {
4339
+			function( $offset ) {
4340 4340
 				if ( ! is_string( $offset ) || is_numeric( $offset ) ) {
4341 4341
 					// Leave a valid value alone.
4342 4342
 					return $offset;
@@ -4433,7 +4433,7 @@  discard block
 block discarded – undo
4433 4433
 			return;
4434 4434
 		}
4435 4435
 
4436
-		$ajax_callback = function () use ( $option ) {
4436
+		$ajax_callback = function() use ( $option ) {
4437 4437
 			self::dismiss_warning_message( $option );
4438 4438
 		};
4439 4439
 
@@ -4443,7 +4443,7 @@  discard block
 block discarded – undo
4443 4443
 
4444 4444
 		add_filter(
4445 4445
 			'frm_message_list',
4446
-			function ( $show_messages ) use ( $message, $option ) {
4446
+			function( $show_messages ) use ( $message, $option ) {
4447 4447
 				if ( get_option( $option, false ) ) {
4448 4448
 					return $show_messages;
4449 4449
 				}
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.
formidable.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -148,7 +148,7 @@
 block discarded – undo
148 148
 
149 149
 register_deactivation_hook(
150 150
 	__FILE__,
151
-	function () {
151
+	function() {
152 152
 		if ( ! class_exists( 'FrmCronController', false ) ) {
153 153
 			require_once __DIR__ . '/classes/controllers/FrmCronController.php';
154 154
 		}
Please login to merge, or discard this patch.
stripe/controllers/FrmStrpLiteLinkController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -149,7 +149,7 @@
 block discarded – undo
149 149
 			'form'  => $entry->form_id,
150 150
 			'value' => $action->post_content['description'],
151 151
 		);
152
-		$new_values     = array( 'description' => FrmTransLiteAppHelper::process_shortcodes( $shortcode_atts ) );
152
+		$new_values = array( 'description' => FrmTransLiteAppHelper::process_shortcodes( $shortcode_atts ) );
153 153
 		FrmStrpLiteAppHelper::call_stripe_helper_class( 'update_intent', $intent->id, $new_values );
154 154
 	}
155 155
 
Please login to merge, or discard this patch.
classes/views/frm-forms/form.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@
 block discarded – undo
52 52
 			$grid_helper     = new FrmFieldGridHelper();
53 53
 			$values['count'] = 0;
54 54
 			foreach ( $values['fields'] as $field ) {
55
-				++$values['count'];
55
+				++ $values['count'];
56 56
 				$grid_helper->set_field( $field );
57 57
 				$grid_helper->maybe_begin_field_wrapper();
58 58
 				FrmFieldsController::load_single_field( $field, $values );
Please login to merge, or discard this patch.
classes/helpers/FrmFieldGridHelper.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -217,7 +217,7 @@
 block discarded – undo
217 217
 		}
218 218
 
219 219
 		if ( false !== $this->parent_li ) {
220
-			++$this->current_field_count;
220
+			++ $this->current_field_count;
221 221
 			$this->current_list_size += $this->active_field_size;
222 222
 			if ( 12 === $this->current_list_size ) {
223 223
 				$this->close_field_wrapper();
Please login to merge, or discard this patch.
classes/helpers/FrmOnboardingWizardHelper.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -100,7 +100,7 @@
 block discarded – undo
100 100
 			'secondary-button-role'      => 'button',
101 101
 			'secondary-button-skip-step' => true,
102 102
 		);
103
-		$args     = wp_parse_args( $args, $defaults );
103
+		$args = wp_parse_args( $args, $defaults );
104 104
 
105 105
 		// Set the primary button attributes.
106 106
 		$primary_button_attributes          = array(
Please login to merge, or discard this patch.