Completed
Pull Request — master (#2676)
by
unknown
46s
created
stripe/helpers/FrmStrpLiteConnectHelper.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
 			'user_id'               => get_current_user_id(),
109 109
 			'frm_strp_connect_mode' => $mode,
110 110
 		);
111
-		$data            = self::post_to_connect_server( 'initialize', $additional_body );
111
+		$data = self::post_to_connect_server( 'initialize', $additional_body );
112 112
 
113 113
 		if ( is_string( $data ) ) {
114 114
 			return $data;
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
 	 * @return object|string
144 144
 	 */
145 145
 	private static function post_to_connect_server( $action, $additional_body = array() ) {
146
-		$body    = array(
146
+		$body = array(
147 147
 			'frm_strp_connect_action' => $action,
148 148
 			'frm_strp_connect_mode'   => FrmStrpLiteAppHelper::active_mode(),
149 149
 		);
Please login to merge, or discard this patch.
classes/views/frm-fields/back-end/settings.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -197,7 +197,7 @@
 block discarded – undo
197 197
 						);
198 198
 
199 199
 						foreach ( $default_value_type['data'] as $data_key => $data_value ) {
200
-							$toggle_args['input_html'][ 'data-' . $data_key ] = $data_value . ( substr( $data_value, -1 ) === '-' ? $field['id'] : '' );
200
+							$toggle_args['input_html']['data-' . $data_key] = $data_value . ( substr( $data_value, -1 ) === '-' ? $field['id'] : '' );
201 201
 						}
202 202
 
203 203
 						?>
Please login to merge, or discard this patch.
classes/controllers/FrmXMLController.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
 			return;
178 178
 		}
179 179
 
180
-		$selected_xml = isset( $form['xml'] ) && isset( $form['xml'][ $selected_form ] ) ? $form['xml'][ $selected_form ] : '';
180
+		$selected_xml = isset( $form['xml'] ) && isset( $form['xml'][$selected_form] ) ? $form['xml'][$selected_form] : '';
181 181
 
182 182
 		if ( empty( $selected_xml ) || strpos( $selected_xml, 'http' ) !== 0 ) {
183 183
 			return;
@@ -195,8 +195,8 @@  discard block
 block discarded – undo
195 195
 	 * @return string
196 196
 	 */
197 197
 	private static function get_selected_in_form( $form, $value = 'form' ) {
198
-		if ( ! empty( $form ) && ! empty( $form[ $value ] ) ) {
199
-			return $form[ $value ];
198
+		if ( ! empty( $form ) && ! empty( $form[$value] ) ) {
199
+			return $form[$value];
200 200
 		}
201 201
 
202 202
 		return '';
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
 			}
227 227
 
228 228
 			if ( $for === 'view' ) {
229
-				$item_key  = is_array( $view_keys ) ? $view_keys[ $form_key ] : $view_keys;
229
+				$item_key  = is_array( $view_keys ) ? $view_keys[$form_key] : $view_keys;
230 230
 				$shortcode = '[display-frm-data id=%1$s filter=limited]';
231 231
 			} elseif ( $for === 'form' ) {
232 232
 				$item_key  = $form_key;
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
 				continue;
242 242
 			}
243 243
 
244
-			$page_ids[ $for ] = wp_insert_post(
244
+			$page_ids[$for] = wp_insert_post(
245 245
 				array(
246 246
 					'post_title'   => $name,
247 247
 					'post_type'    => 'page',
@@ -400,7 +400,7 @@  discard block
 block discarded – undo
400 400
 		$file_type = sanitize_option( 'upload_path', $_FILES['frm_import_file']['name'] );
401 401
 		$file_type = strtolower( pathinfo( $file_type, PATHINFO_EXTENSION ) );
402 402
 
403
-		if ( 'xml' !== $file_type && isset( $export_format[ $file_type ] ) ) {
403
+		if ( 'xml' !== $file_type && isset( $export_format[$file_type] ) ) {
404 404
 			// allow other file types to be imported
405 405
 			do_action( 'frm_before_import_' . $file_type );
406 406
 
@@ -495,7 +495,7 @@  discard block
 block discarded – undo
495 495
 		foreach ( $type as $tb_type ) {
496 496
 			$where = array();
497 497
 			$join  = '';
498
-			$table = $tables[ $tb_type ];
498
+			$table = $tables[$tb_type];
499 499
 
500 500
 			$select     = $table . '.id';
501 501
 			$query_vars = array();
@@ -510,7 +510,7 @@  discard block
 block discarded – undo
510 510
 							$table . '.parent_form_id' => $args['ids'],
511 511
 						);
512 512
 					} else {
513
-						$where[ $table . '.status !' ] = 'draft';
513
+						$where[$table . '.status !'] = 'draft';
514 514
 					}
515 515
 					break;
516 516
 				case 'actions':
@@ -524,7 +524,7 @@  discard block
 block discarded – undo
524 524
 				case 'items':
525 525
 					// $join = "INNER JOIN {$wpdb->prefix}frm_item_metas im ON ($table.id = im.item_id)";
526 526
 					if ( $args['ids'] ) {
527
-						$where[ $table . '.form_id' ] = $args['ids'];
527
+						$where[$table . '.form_id'] = $args['ids'];
528 528
 					}
529 529
 					break;
530 530
 				case 'styles':
@@ -568,7 +568,7 @@  discard block
 block discarded – undo
568 568
 					}
569 569
 			}//end switch
570 570
 
571
-			$records[ $tb_type ] = FrmDb::get_col( $table . $join, $where, $select );
571
+			$records[$tb_type] = FrmDb::get_col( $table . $join, $where, $select );
572 572
 			unset( $tb_type );
573 573
 		}//end foreach
574 574
 
@@ -781,7 +781,7 @@  discard block
 block discarded – undo
781 781
 
782 782
 		foreach ( $csv_fields as $k => $f ) {
783 783
 			if ( in_array( $f->type, $no_export_fields, true ) ) {
784
-				unset( $csv_fields[ $k ] );
784
+				unset( $csv_fields[$k] );
785 785
 			}
786 786
 		}
787 787
 
Please login to merge, or discard this patch.
classes/helpers/FrmAppHelper.php 1 patch
Spacing   +86 added lines, -86 removed lines patch added patch discarded remove patch
@@ -338,7 +338,7 @@  discard block
 block discarded – undo
338 338
 			'fill'   => '#4d4d4d',
339 339
 			'orange' => '#f05a24',
340 340
 		);
341
-		$atts     = array_merge( $defaults, $atts );
341
+		$atts = array_merge( $defaults, $atts );
342 342
 
343 343
 		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'] ) . '">
344 344
 			<path fill="' . esc_attr( $atts['orange'] ) . '" d="M289.6 384h140v76h-140z"/>
@@ -637,7 +637,7 @@  discard block
 block discarded – undo
637 637
 	 * @return string
638 638
 	 */
639 639
 	public static function get_server_value( $value ) {
640
-		return isset( $_SERVER[ $value ] ) ? wp_strip_all_tags( wp_unslash( $_SERVER[ $value ] ) ) : '';
640
+		return isset( $_SERVER[$value] ) ? wp_strip_all_tags( wp_unslash( $_SERVER[$value] ) ) : '';
641 641
 	}
642 642
 
643 643
 	/**
@@ -671,7 +671,7 @@  discard block
 block discarded – undo
671 671
 		$ip         = '';
672 672
 
673 673
 		foreach ( $ip_options as $key ) {
674
-			if ( ! isset( $_SERVER[ $key ] ) ) {
674
+			if ( ! isset( $_SERVER[$key] ) ) {
675 675
 				continue;
676 676
 			}
677 677
 
@@ -749,11 +749,11 @@  discard block
 block discarded – undo
749 749
 		}
750 750
 
751 751
 		if ( $src === 'get' ) {
752
-			$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
752
+			$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
753 753
 
754
-			if ( ! isset( $_POST[ $param ] ) && isset( $_GET[ $param ] ) && ! is_array( $value ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
754
+			if ( ! isset( $_POST[$param] ) && isset( $_GET[$param] ) && ! is_array( $value ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
755 755
 				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
756
-				$value = htmlspecialchars_decode( wp_unslash( $_GET[ $param ] ) );
756
+				$value = htmlspecialchars_decode( wp_unslash( $_GET[$param] ) );
757 757
 			}
758 758
 			self::sanitize_value( $sanitize, $value );
759 759
 		} else {
@@ -774,7 +774,7 @@  discard block
 block discarded – undo
774 774
 				}
775 775
 
776 776
 				$p     = trim( $p, ']' );
777
-				$value = $value[ $p ] ?? $default;
777
+				$value = $value[$p] ?? $default;
778 778
 			}
779 779
 		}
780 780
 
@@ -840,28 +840,28 @@  discard block
 block discarded – undo
840 840
 			'sanitize'   => 'sanitize_text_field',
841 841
 			'serialized' => false,
842 842
 		);
843
-		$args     = wp_parse_args( $args, $defaults );
843
+		$args = wp_parse_args( $args, $defaults );
844 844
 
845 845
 		$value = $args['default'];
846 846
 
847 847
 		if ( $args['type'] === 'get' ) {
848
-			if ( $_GET && isset( $_GET[ $args['param'] ] ) ) {
848
+			if ( $_GET && isset( $_GET[$args['param']] ) ) {
849 849
 				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
850
-				$value = wp_unslash( $_GET[ $args['param'] ] );
850
+				$value = wp_unslash( $_GET[$args['param']] );
851 851
 			}
852 852
 		} elseif ( $args['type'] === 'post' ) {
853
-			if ( isset( $_POST[ $args['param'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
853
+			if ( isset( $_POST[$args['param']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
854 854
 				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
855
-				$value = wp_unslash( $_POST[ $args['param'] ] );
855
+				$value = wp_unslash( $_POST[$args['param']] );
856 856
 
857 857
 				if ( $args['serialized'] === true && is_serialized_string( $value ) && is_serialized( $value ) ) {
858 858
 					self::unserialize_or_decode( $value );
859 859
 				}
860 860
 			}
861
-		} elseif ( isset( $_REQUEST[ $args['param'] ] ) ) {
861
+		} elseif ( isset( $_REQUEST[$args['param']] ) ) {
862 862
 			// phpcs:ignore WordPress.Security.NonceVerification.Missing
863 863
 				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
864
-				$value = wp_unslash( $_REQUEST[ $args['param'] ] );
864
+				$value = wp_unslash( $_REQUEST[$args['param']] );
865 865
 		}
866 866
 
867 867
 		self::sanitize_value( $args['sanitize'], $value );
@@ -910,7 +910,7 @@  discard block
 block discarded – undo
910 910
 			$temp_values = $value;
911 911
 
912 912
 			foreach ( $temp_values as $k => $v ) {
913
-				self::sanitize_value( $sanitize, $value[ $k ] );
913
+				self::sanitize_value( $sanitize, $value[$k] );
914 914
 			}
915 915
 			return;
916 916
 		}
@@ -928,8 +928,8 @@  discard block
 block discarded – undo
928 928
 		$temp_values = $values;
929 929
 
930 930
 		foreach ( $temp_values as $k => $val ) {
931
-			if ( isset( $sanitize_method[ $k ] ) ) {
932
-				$values[ $k ] = call_user_func( $sanitize_method[ $k ], $val );
931
+			if ( isset( $sanitize_method[$k] ) ) {
932
+				$values[$k] = call_user_func( $sanitize_method[$k], $val );
933 933
 			}
934 934
 		}
935 935
 	}
@@ -993,7 +993,7 @@  discard block
 block discarded – undo
993 993
 			$temp_values = $value;
994 994
 
995 995
 			foreach ( $temp_values as $k => $v ) {
996
-				self::decode_specialchars( $value[ $k ] );
996
+				self::decode_specialchars( $value[$k] );
997 997
 			}
998 998
 		} else {
999 999
 			self::decode_amp( $value );
@@ -1135,7 +1135,7 @@  discard block
 block discarded – undo
1135 1135
 	 * @return array
1136 1136
 	 */
1137 1137
 	public static function add_allowed_submit_button_tags( $allowed_html ) {
1138
-		$allowed_html['input']                    = array(
1138
+		$allowed_html['input'] = array(
1139 1139
 			'type'           => true,
1140 1140
 			'value'          => true,
1141 1141
 			'formnovalidate' => true,
@@ -1163,7 +1163,7 @@  discard block
 block discarded – undo
1163 1163
 			$allowed_html = $html;
1164 1164
 		} elseif ( ! empty( $allowed ) ) {
1165 1165
 			foreach ( (array) $allowed as $a ) {
1166
-				$allowed_html[ $a ] = $html[ $a ] ?? array();
1166
+				$allowed_html[$a] = $html[$a] ?? array();
1167 1167
 			}
1168 1168
 		}
1169 1169
 
@@ -1354,8 +1354,8 @@  discard block
 block discarded – undo
1354 1354
 
1355 1355
 		global $wp_query;
1356 1356
 
1357
-		if ( isset( $wp_query->query_vars[ $param ] ) ) {
1358
-			$value = $wp_query->query_vars[ $param ];
1357
+		if ( isset( $wp_query->query_vars[$param] ) ) {
1358
+			$value = $wp_query->query_vars[$param];
1359 1359
 		}
1360 1360
 
1361 1361
 		return $value;
@@ -1389,9 +1389,9 @@  discard block
 block discarded – undo
1389 1389
 			'frm_keyalt_solid_icon' => 'frm_key_solid_icon',
1390 1390
 		);
1391 1391
 
1392
-		if ( isset( $deprecated[ $icon ] ) ) {
1393
-			$icon  = $deprecated[ $icon ];
1394
-			$class = str_replace( $icon, $deprecated[ $icon ], $class );
1392
+		if ( isset( $deprecated[$icon] ) ) {
1393
+			$icon  = $deprecated[$icon];
1394
+			$class = str_replace( $icon, $deprecated[$icon], $class );
1395 1395
 		}
1396 1396
 
1397 1397
 		if ( $icon === $class ) {
@@ -1523,7 +1523,7 @@  discard block
 block discarded – undo
1523 1523
 	 * @return string|void
1524 1524
 	 */
1525 1525
 	public static function array_to_html_params( $atts, $echo = false ) {
1526
-		$callback = function () use ( $atts ) {
1526
+		$callback = function() use ( $atts ) {
1527 1527
 			if ( $atts ) {
1528 1528
 				foreach ( $atts as $key => $value ) {
1529 1529
 					echo ' ' . esc_attr( $key ) . '="' . esc_attr( $value ) . '"';
@@ -1714,7 +1714,7 @@  discard block
 block discarded – undo
1714 1714
 			'value'       => false,
1715 1715
 			'class'       => '',
1716 1716
 		);
1717
-		$atts     = array_merge( $defaults, $atts );
1717
+		$atts = array_merge( $defaults, $atts );
1718 1718
 
1719 1719
 		if ( $atts['input_id'] === 'template' && empty( $atts['tosearch'] ) ) {
1720 1720
 			$atts['tosearch'] = 'frm-card';
@@ -1794,7 +1794,7 @@  discard block
 block discarded – undo
1794 1794
 				'new_file_path' => self::plugin_path() . '/js',
1795 1795
 			)
1796 1796
 		);
1797
-		$new_file  = new FrmCreateFile( $file_atts );
1797
+		$new_file = new FrmCreateFile( $file_atts );
1798 1798
 
1799 1799
 		$files = array(
1800 1800
 			self::plugin_path() . '/js/formidable.min.js',
@@ -2014,8 +2014,8 @@  discard block
 block discarded – undo
2014 2014
 	 */
2015 2015
 	private static function get_dropdown_value_and_label_from_option( $option, $key, $args ) {
2016 2016
 		if ( is_array( $option ) ) {
2017
-			$value = $option[ $args['value_key'] ] ?? '';
2018
-			$label = $option[ $args['label_key'] ] ?? '';
2017
+			$value = $option[$args['value_key']] ?? '';
2018
+			$label = $option[$args['label_key']] ?? '';
2019 2019
 		} else {
2020 2020
 			$value = $key;
2021 2021
 			$label = $option;
@@ -2423,9 +2423,9 @@  discard block
 block discarded – undo
2423 2423
 			return $error;
2424 2424
 		}
2425 2425
 
2426
-		$nonce_value = $_REQUEST && isset( $_REQUEST[ $nonce_name ] ) ? sanitize_text_field( wp_unslash( $_REQUEST[ $nonce_name ] ) ) : '';
2426
+		$nonce_value = $_REQUEST && isset( $_REQUEST[$nonce_name] ) ? sanitize_text_field( wp_unslash( $_REQUEST[$nonce_name] ) ) : '';
2427 2427
 
2428
-		if ( $_REQUEST && ( ! isset( $_REQUEST[ $nonce_name ] ) || ! wp_verify_nonce( $nonce_value, $nonce ) ) ) {
2428
+		if ( $_REQUEST && ( ! isset( $_REQUEST[$nonce_name] ) || ! wp_verify_nonce( $nonce_value, $nonce ) ) ) {
2429 2429
 			$frm_settings = self::get_settings();
2430 2430
 			$error        = $frm_settings->admin_permission;
2431 2431
 		}
@@ -2481,7 +2481,7 @@  discard block
 block discarded – undo
2481 2481
 			} else {
2482 2482
 				foreach ( $value as $k => $v ) {
2483 2483
 					if ( ! is_array( $v ) ) {
2484
-						$value[ $k ] = call_user_func( $original_function, $v );
2484
+						$value[$k] = call_user_func( $original_function, $v );
2485 2485
 					}
2486 2486
 				}
2487 2487
 			}
@@ -2535,7 +2535,7 @@  discard block
 block discarded – undo
2535 2535
 			if ( is_array( $value ) ) {
2536 2536
 				$return = array_merge( $return, self::array_flatten( $value, $keys ) );
2537 2537
 			} elseif ( $keys === 'keep' ) {
2538
-					$return[ $key ] = $value;
2538
+					$return[$key] = $value;
2539 2539
 			} else {
2540 2540
 				$return[] = $value;
2541 2541
 			}
@@ -2630,11 +2630,11 @@  discard block
 block discarded – undo
2630 2630
 
2631 2631
 		$ver = $default;
2632 2632
 
2633
-		if ( ! isset( $wp_scripts->registered[ $handle ] ) ) {
2633
+		if ( ! isset( $wp_scripts->registered[$handle] ) ) {
2634 2634
 			return $ver;
2635 2635
 		}
2636 2636
 
2637
-		$query = $wp_scripts->registered[ $handle ];
2637
+		$query = $wp_scripts->registered[$handle];
2638 2638
 
2639 2639
 		if ( is_object( $query ) && ! empty( $query->ver ) ) {
2640 2640
 			$ver = $query->ver;
@@ -2652,7 +2652,7 @@  discard block
 block discarded – undo
2652 2652
 	 * @return string|null
2653 2653
 	 */
2654 2654
 	public static function js_redirect( $url, $echo = false ) {
2655
-		$callback = function () use ( $url ) {
2655
+		$callback = function() use ( $url ) {
2656 2656
 			echo '<script type="text/javascript">window.location="' . esc_url_raw( $url ) . '"</script>';
2657 2657
 		};
2658 2658
 		return self::clip( $callback, $echo );
@@ -2755,7 +2755,7 @@  discard block
 block discarded – undo
2755 2755
 			$suffix = 2;
2756 2756
 			do {
2757 2757
 				$key_check = $key . $separator . $suffix;
2758
-				++$suffix;
2758
+				++ $suffix;
2759 2759
 			} while ( in_array( $key_check, $similar_keys, true ) );
2760 2760
 
2761 2761
 			$key = $key_check;
@@ -2872,7 +2872,7 @@  discard block
 block discarded – undo
2872 2872
 
2873 2873
 		foreach ( array( 'name', 'description' ) as $var ) {
2874 2874
 			$default_val    = $record->{$var} ?? '';
2875
-			$values[ $var ] = self::get_param( $var, $default_val, 'get', 'wp_kses_post' );
2875
+			$values[$var] = self::get_param( $var, $default_val, 'get', 'wp_kses_post' );
2876 2876
 			unset( $var, $default_val );
2877 2877
 		}
2878 2878
 
@@ -2945,10 +2945,10 @@  discard block
 block discarded – undo
2945 2945
 			$meta_value = FrmEntryMeta::get_meta_value( $record, $field->id );
2946 2946
 		}//end if
2947 2947
 
2948
-		$field_type = $post_values['field_options'][ 'type_' . $field->id ] ?? $field->type;
2948
+		$field_type = $post_values['field_options']['type_' . $field->id] ?? $field->type;
2949 2949
 
2950
-		if ( isset( $post_values['item_meta'][ $field->id ] ) ) {
2951
-			$new_value = $post_values['item_meta'][ $field->id ];
2950
+		if ( isset( $post_values['item_meta'][$field->id] ) ) {
2951
+			$new_value = $post_values['item_meta'][$field->id];
2952 2952
 			self::unserialize_or_decode( $new_value );
2953 2953
 		} else {
2954 2954
 			$new_value = $meta_value;
@@ -2969,7 +2969,7 @@  discard block
 block discarded – undo
2969 2969
 
2970 2970
 		$field_array = array_merge( (array) $field->field_options, $field_array );
2971 2971
 
2972
-		$values['fields'][ $field->id ] = $field_array;
2972
+		$values['fields'][$field->id] = $field_array;
2973 2973
 	}
2974 2974
 
2975 2975
 	/**
@@ -3019,11 +3019,11 @@  discard block
 block discarded – undo
3019 3019
 		}
3020 3020
 
3021 3021
 		foreach ( $form->options as $opt => $value ) {
3022
-			if ( isset( $post_values[ $opt ] ) ) {
3023
-				$values[ $opt ] = $post_values[ $opt ];
3024
-				self::unserialize_or_decode( $values[ $opt ] );
3022
+			if ( isset( $post_values[$opt] ) ) {
3023
+				$values[$opt] = $post_values[$opt];
3024
+				self::unserialize_or_decode( $values[$opt] );
3025 3025
 			} else {
3026
-				$values[ $opt ] = $value;
3026
+				$values[$opt] = $value;
3027 3027
 			}
3028 3028
 		}
3029 3029
 
@@ -3042,8 +3042,8 @@  discard block
 block discarded – undo
3042 3042
 		$form_defaults = FrmFormsHelper::get_default_opts();
3043 3043
 
3044 3044
 		foreach ( $form_defaults as $opt => $default ) {
3045
-			if ( ! isset( $values[ $opt ] ) || $values[ $opt ] == '' ) {
3046
-				$values[ $opt ] = $post_values && isset( $post_values['options'][ $opt ] ) ? $post_values['options'][ $opt ] : $default;
3045
+			if ( ! isset( $values[$opt] ) || $values[$opt] == '' ) {
3046
+				$values[$opt] = $post_values && isset( $post_values['options'][$opt] ) ? $post_values['options'][$opt] : $default;
3047 3047
 			}
3048 3048
 
3049 3049
 			unset( $opt, $default );
@@ -3054,8 +3054,8 @@  discard block
 block discarded – undo
3054 3054
 		}
3055 3055
 
3056 3056
 		foreach ( array( 'before', 'after', 'submit' ) as $h ) {
3057
-			if ( ! isset( $values[ $h . '_html' ] ) ) {
3058
-				$values[ $h . '_html' ] = ( $post_values['options'][ $h . '_html' ] ?? FrmFormsHelper::get_default_html( $h ) );
3057
+			if ( ! isset( $values[$h . '_html'] ) ) {
3058
+				$values[$h . '_html'] = ( $post_values['options'][$h . '_html'] ?? FrmFormsHelper::get_default_html( $h ) );
3059 3059
 			}
3060 3060
 			unset( $h );
3061 3061
 		}
@@ -3279,12 +3279,12 @@  discard block
 block discarded – undo
3279 3279
 			// Show time in specified unit.
3280 3280
 			$levels = self::get_unit( $levels );
3281 3281
 
3282
-			if ( isset( $time_strings[ $levels ] ) ) {
3282
+			if ( isset( $time_strings[$levels] ) ) {
3283 3283
 				$diff         = array(
3284 3284
 					$levels => self::time_format( $levels, $diff ),
3285 3285
 				);
3286 3286
 				$time_strings = array(
3287
-					$levels => $time_strings[ $levels ],
3287
+					$levels => $time_strings[$levels],
3288 3288
 				);
3289 3289
 			}
3290 3290
 
@@ -3292,13 +3292,13 @@  discard block
 block discarded – undo
3292 3292
 		}
3293 3293
 
3294 3294
 		foreach ( $time_strings as $k => $v ) {
3295
-			if ( isset( $diff[ $k ] ) && $diff[ $k ] ) {
3296
-				$time_strings[ $k ] = $diff[ $k ] . ' ' . ( $diff[ $k ] > 1 ? $v[1] : $v[0] );
3297
-			} elseif ( isset( $diff[ $k ] ) && count( $time_strings ) === 1 ) {
3295
+			if ( isset( $diff[$k] ) && $diff[$k] ) {
3296
+				$time_strings[$k] = $diff[$k] . ' ' . ( $diff[$k] > 1 ? $v[1] : $v[0] );
3297
+			} elseif ( isset( $diff[$k] ) && count( $time_strings ) === 1 ) {
3298 3298
 				// Account for 0.
3299
-				$time_strings[ $k ] = $diff[ $k ] . ' ' . $v[1];
3299
+				$time_strings[$k] = $diff[$k] . ' ' . $v[1];
3300 3300
 			} else {
3301
-				unset( $time_strings[ $k ] );
3301
+				unset( $time_strings[$k] );
3302 3302
 			}
3303 3303
 		}
3304 3304
 
@@ -3323,8 +3323,8 @@  discard block
 block discarded – undo
3323 3323
 			'd' => 'days',
3324 3324
 		);
3325 3325
 
3326
-		if ( isset( $return[ $unit ] ) ) {
3327
-			return $diff[ $return[ $unit ] ];
3326
+		if ( isset( $return[$unit] ) ) {
3327
+			return $diff[$return[$unit]];
3328 3328
 		}
3329 3329
 
3330 3330
 		$total = $diff['days'] * self::convert_time( 'd', $unit );
@@ -3332,11 +3332,11 @@  discard block
 block discarded – undo
3332 3332
 		$times = array( 'h', 'i', 's' );
3333 3333
 
3334 3334
 		foreach ( $times as $time ) {
3335
-			if ( ! isset( $diff[ $time ] ) ) {
3335
+			if ( ! isset( $diff[$time] ) ) {
3336 3336
 				continue;
3337 3337
 			}
3338 3338
 
3339
-			$total += $diff[ $time ] * self::convert_time( $time, $unit );
3339
+			$total += $diff[$time] * self::convert_time( $time, $unit );
3340 3340
 		}
3341 3341
 
3342 3342
 		return floor( $total );
@@ -3361,7 +3361,7 @@  discard block
 block discarded – undo
3361 3361
 			'y' => DAY_IN_SECONDS * 365.25,
3362 3362
 		);
3363 3363
 
3364
-		return $convert[ $from ] / $convert[ $to ];
3364
+		return $convert[$from] / $convert[$to];
3365 3365
 	}
3366 3366
 
3367 3367
 	/**
@@ -3374,7 +3374,7 @@  discard block
 block discarded – undo
3374 3374
 	private static function get_unit( $unit ) {
3375 3375
 		$units = self::get_time_strings();
3376 3376
 
3377
-		if ( isset( $units[ $unit ] ) || is_numeric( $unit ) ) {
3377
+		if ( isset( $units[$unit] ) || is_numeric( $unit ) ) {
3378 3378
 			return $unit;
3379 3379
 		}
3380 3380
 
@@ -3498,17 +3498,17 @@  discard block
 block discarded – undo
3498 3498
 
3499 3499
 					case 1:
3500 3500
 						$l2 = $name;
3501
-						self::add_value_to_array( $name, $l2, $this_val, $vars[ $l1 ] );
3501
+						self::add_value_to_array( $name, $l2, $this_val, $vars[$l1] );
3502 3502
 						break;
3503 3503
 
3504 3504
 					case 2:
3505 3505
 						$l3 = $name;
3506
-						self::add_value_to_array( $name, $l3, $this_val, $vars[ $l1 ][ $l2 ] );
3506
+						self::add_value_to_array( $name, $l3, $this_val, $vars[$l1][$l2] );
3507 3507
 						break;
3508 3508
 
3509 3509
 					case 3:
3510 3510
 						$l4 = $name;
3511
-						self::add_value_to_array( $name, $l4, $this_val, $vars[ $l1 ][ $l2 ][ $l3 ] );
3511
+						self::add_value_to_array( $name, $l4, $this_val, $vars[$l1][$l2][$l3] );
3512 3512
 				}
3513 3513
 
3514 3514
 				unset( $this_val, $n );
@@ -3531,8 +3531,8 @@  discard block
 block discarded – undo
3531 3531
 	public static function add_value_to_array( $name, $l1, $val, &$vars ) {
3532 3532
 		if ( $name == '' ) {
3533 3533
 			$vars[] = $val;
3534
-		} elseif ( ! isset( $vars[ $l1 ] ) ) {
3535
-			$vars[ $l1 ] = $val;
3534
+		} elseif ( ! isset( $vars[$l1] ) ) {
3535
+			$vars[$l1] = $val;
3536 3536
 		}
3537 3537
 	}
3538 3538
 
@@ -3556,7 +3556,7 @@  discard block
 block discarded – undo
3556 3556
 			'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' ),
3557 3557
 		);
3558 3558
 
3559
-		if ( ! isset( $tooltips[ $name ] ) ) {
3559
+		if ( ! isset( $tooltips[$name] ) ) {
3560 3560
 			return;
3561 3561
 		}
3562 3562
 
@@ -3566,7 +3566,7 @@  discard block
 block discarded – undo
3566 3566
 			echo ' class="frm_help"';
3567 3567
 		}
3568 3568
 
3569
-		echo ' title="' . esc_attr( $tooltips[ $name ] );
3569
+		echo ' title="' . esc_attr( $tooltips[$name] );
3570 3570
 
3571 3571
 		if ( 'open' != $class ) {
3572 3572
 			echo '"';
@@ -3639,13 +3639,13 @@  discard block
 block discarded – undo
3639 3639
 	 * @return void
3640 3640
 	 */
3641 3641
 	private static function prepare_action_slashes( $val, $key, &$post_content ) {
3642
-		if ( ! isset( $post_content[ $key ] ) || is_numeric( $val ) ) {
3642
+		if ( ! isset( $post_content[$key] ) || is_numeric( $val ) ) {
3643 3643
 			return;
3644 3644
 		}
3645 3645
 
3646 3646
 		if ( is_array( $val ) ) {
3647 3647
 			foreach ( $val as $k1 => $v1 ) {
3648
-				self::prepare_action_slashes( $v1, $k1, $post_content[ $key ] );
3648
+				self::prepare_action_slashes( $v1, $k1, $post_content[$key] );
3649 3649
 				unset( $k1, $v1 );
3650 3650
 			}
3651 3651
 		} else {
@@ -3653,7 +3653,7 @@  discard block
 block discarded – undo
3653 3653
 			$val = stripslashes( $val );
3654 3654
 
3655 3655
 			// Add backslashes before double quotes and forward slashes only
3656
-			$post_content[ $key ] = addcslashes( $val, '"\\/' );
3656
+			$post_content[$key] = addcslashes( $val, '"\\/' );
3657 3657
 		}
3658 3658
 	}
3659 3659
 
@@ -3789,14 +3789,14 @@  discard block
 block discarded – undo
3789 3789
 
3790 3790
 			$key = $input['name'];
3791 3791
 
3792
-			if ( isset( $formatted[ $key ] ) ) {
3793
-				if ( is_array( $formatted[ $key ] ) ) {
3794
-					$formatted[ $key ][] = $input['value'];
3792
+			if ( isset( $formatted[$key] ) ) {
3793
+				if ( is_array( $formatted[$key] ) ) {
3794
+					$formatted[$key][] = $input['value'];
3795 3795
 				} else {
3796
-					$formatted[ $key ] = array( $formatted[ $key ], $input['value'] );
3796
+					$formatted[$key] = array( $formatted[$key], $input['value'] );
3797 3797
 				}
3798 3798
 			} else {
3799
-				$formatted[ $key ] = $input['value'];
3799
+				$formatted[$key] = $input['value'];
3800 3800
 			}
3801 3801
 		}
3802 3802
 
@@ -4527,8 +4527,8 @@  discard block
 block discarded – undo
4527 4527
 		}
4528 4528
 
4529 4529
 		foreach ( $keys as $key ) {
4530
-			if ( isset( $values[ $key ] ) ) {
4531
-				$values[ $key ] = self::kses( $values[ $key ], 'all' );
4530
+			if ( isset( $values[$key] ) ) {
4531
+				$values[$key] = self::kses( $values[$key], 'all' );
4532 4532
 			}
4533 4533
 		}
4534 4534
 
@@ -4595,7 +4595,7 @@  discard block
 block discarded – undo
4595 4595
 				'role',
4596 4596
 				'style',
4597 4597
 			);
4598
-			$safe      = in_array( $key, $safe_keys, true );
4598
+			$safe = in_array( $key, $safe_keys, true );
4599 4599
 		}//end if
4600 4600
 
4601 4601
 		/**
@@ -4743,7 +4743,7 @@  discard block
 block discarded – undo
4743 4743
 			return 0;
4744 4744
 		}
4745 4745
 
4746
-		return strlen( $parts[ count( $parts ) - 1 ] );
4746
+		return strlen( $parts[count( $parts ) - 1] );
4747 4747
 	}
4748 4748
 
4749 4749
 	/**
@@ -4763,7 +4763,7 @@  discard block
 block discarded – undo
4763 4763
 
4764 4764
 		add_filter(
4765 4765
 			'option_gmt_offset',
4766
-			function ( $offset ) {
4766
+			function( $offset ) {
4767 4767
 				if ( ! is_string( $offset ) || is_numeric( $offset ) ) {
4768 4768
 					// Leave a valid value alone.
4769 4769
 					return $offset;
@@ -4865,7 +4865,7 @@  discard block
 block discarded – undo
4865 4865
 			return;
4866 4866
 		}
4867 4867
 
4868
-		$ajax_callback = function () use ( $option ) {
4868
+		$ajax_callback = function() use ( $option ) {
4869 4869
 			self::dismiss_warning_message( $option );
4870 4870
 		};
4871 4871
 
@@ -4875,7 +4875,7 @@  discard block
 block discarded – undo
4875 4875
 
4876 4876
 		add_filter(
4877 4877
 			'frm_message_list',
4878
-			function ( $show_messages ) use ( $message, $option ) {
4878
+			function( $show_messages ) use ( $message, $option ) {
4879 4879
 				if ( get_option( $option, false ) ) {
4880 4880
 					return $show_messages;
4881 4881
 				}
Please login to merge, or discard this patch.
square/controllers/FrmSquareLiteActionsController.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 			$is_square = $gateway === 'square' || ( is_array( $gateway ) && in_array( 'square', $gateway, true ) );
84 84
 
85 85
 			if ( ! $is_square || empty( $payment_action->post_content['amount'] ) ) {
86
-				unset( $payment_actions[ $k ] );
86
+				unset( $payment_actions[$k] );
87 87
 			}
88 88
 		}
89 89
 		return $payment_actions;
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
 			'run_triggers' => false,
106 106
 			'show_errors'  => true,
107 107
 		);
108
-		$atts     = compact( 'action', 'entry', 'form' );
108
+		$atts = compact( 'action', 'entry', 'form' );
109 109
 
110 110
 		$amount = self::prepare_amount( $action->post_content['amount'], $atts );
111 111
 
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
 				'value' => $atts['action']->post_content['description'],
160 160
 			)
161 161
 		);
162
-		$result             = FrmSquareLiteConnectHelper::create_payment( $atts['amount'], $currency, $square_token, $verification_token, $description );
162
+		$result = FrmSquareLiteConnectHelper::create_payment( $atts['amount'], $currency, $square_token, $verification_token, $description );
163 163
 
164 164
 		if ( false === $result ) {
165 165
 			return FrmSquareLiteConnectHelper::get_latest_error_from_square_api();
@@ -685,7 +685,7 @@  discard block
 block discarded – undo
685 685
 
686 686
 		foreach ( $settings as $k => $s ) {
687 687
 			if ( is_string( $s ) ) {
688
-				$settings[ $k ] = str_replace( $disallowed, '', $s );
688
+				$settings[$k] = str_replace( $disallowed, '', $s );
689 689
 			}
690 690
 		}
691 691
 
@@ -713,12 +713,12 @@  discard block
 block discarded – undo
713 713
 
714 714
 		$field_id = $field->temp_id ?? $field->id;
715 715
 
716
-		if ( isset( $errors[ 'field' . $field_id . '-cc' ] ) ) {
717
-			unset( $errors[ 'field' . $field_id . '-cc' ] );
716
+		if ( isset( $errors['field' . $field_id . '-cc'] ) ) {
717
+			unset( $errors['field' . $field_id . '-cc'] );
718 718
 		}
719 719
 
720
-		if ( isset( $errors[ 'field' . $field_id ] ) ) {
721
-			unset( $errors[ 'field' . $field_id ] );
720
+		if ( isset( $errors['field' . $field_id] ) ) {
721
+			unset( $errors['field' . $field_id] );
722 722
 		}
723 723
 
724 724
 		return $errors;
Please login to merge, or discard this patch.
classes/models/FrmFormMigrator.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
 
320 320
 			// This may occasionally skip one level/order e.g. after adding a
321 321
 			// list field, as field_order would already be prepared to be used.
322
-			++$field_order;
322
+			++ $field_order;
323 323
 
324 324
 			if ( ! empty( $new_field['fields'] ) && is_array( $new_field['fields'] ) ) {
325 325
 				// we have (inner) fields to merge
@@ -371,7 +371,7 @@  discard block
 block discarded – undo
371 371
 		$order = 0;
372 372
 
373 373
 		foreach ( $fields as $field ) {
374
-			++$order;
374
+			++ $order;
375 375
 			$type     = $this->get_field_type( $field );
376 376
 			$new_type = $this->convert_field_type( $type, $field );
377 377
 
@@ -407,7 +407,7 @@  discard block
 block discarded – undo
407 407
 		$sub['name'] = __( 'Section Buttons', 'formidable' );
408 408
 		$subs        = array( $sub );
409 409
 		$this->insert_fields_in_array( $subs, $order, 0, $fields );
410
-		++$order;
410
+		++ $order;
411 411
 	}
412 412
 
413 413
 	/**
@@ -521,7 +521,7 @@  discard block
 block discarded – undo
521 521
 	protected function create_fields( $form_id, &$form ) {
522 522
 		foreach ( $form['fields'] as $key => $new_field ) {
523 523
 			$new_field['form_id']         = $form_id;
524
-			$form['fields'][ $key ]['id'] = FrmField::create( $new_field );
524
+			$form['fields'][$key]['id'] = FrmField::create( $new_field );
525 525
 		}
526 526
 	}
527 527
 
@@ -564,9 +564,9 @@  discard block
 block discarded – undo
564 564
 			} elseif ( $key === 'the_post_title' ) {
565 565
 				$new_action->post_content['post_title'] = $value;
566 566
 			} elseif ( is_string( $value ) ) {
567
-				$new_action->post_content[ $key ] = $this->replace_smart_tags( $value, $form['fields'] );
567
+				$new_action->post_content[$key] = $this->replace_smart_tags( $value, $form['fields'] );
568 568
 			} else {
569
-				$new_action->post_content[ $key ] = $value;
569
+				$new_action->post_content[$key] = $value;
570 570
 			}
571 571
 		}
572 572
 
@@ -587,7 +587,7 @@  discard block
 block discarded – undo
587 587
 
588 588
 		$imported = $this->get_tracked_import();
589 589
 
590
-		$imported[ $this->slug ][ $new_form_id ] = $source_id;
590
+		$imported[$this->slug][$new_form_id] = $source_id;
591 591
 
592 592
 		update_option( $this->tracking, $imported, false );
593 593
 	}
@@ -608,11 +608,11 @@  discard block
 block discarded – undo
608 608
 		$imported    = $this->get_tracked_import();
609 609
 		$new_form_id = 0;
610 610
 
611
-		if ( ! isset( $imported[ $this->slug ] ) || ! in_array( $source_id, $imported[ $this->slug ] ) ) {
611
+		if ( ! isset( $imported[$this->slug] ) || ! in_array( $source_id, $imported[$this->slug] ) ) {
612 612
 			return $new_form_id;
613 613
 		}
614 614
 
615
-		$new_form_id = array_search( $source_id, array_reverse( $imported[ $this->slug ], true ) );
615
+		$new_form_id = array_search( $source_id, array_reverse( $imported[$this->slug], true ) );
616 616
 
617 617
 		if ( ! empty( $new_form_id ) && empty( FrmForm::get_key_by_id( $new_form_id ) ) ) {
618 618
 			// Allow reimport if the form was deleted.
Please login to merge, or discard this patch.
classes/models/FrmField.php 1 patch
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -352,11 +352,11 @@  discard block
 block discarded – undo
352 352
 			'ranking' => '2024-03-12',
353 353
 		);
354 354
 
355
-		if ( ! isset( $release_dates[ $type ] ) ) {
355
+		if ( ! isset( $release_dates[$type] ) ) {
356 356
 			return false;
357 357
 		}
358 358
 
359
-		$release_date = $release_dates[ $type ];
359
+		$release_date = $release_dates[$type];
360 360
 
361 361
 		$three_months_after_release = gmdate( 'Y-m-d', strtotime( $release_date . ' + 90 days' ) );
362 362
 		return gmdate( 'Y-m-d' ) < $three_months_after_release;
@@ -390,8 +390,8 @@  discard block
 block discarded – undo
390 390
 		$values = FrmAppHelper::maybe_filter_array( $values, array( 'name', 'description' ) );
391 391
 
392 392
 		foreach ( array( 'name', 'description', 'type', 'default_value' ) as $col ) {
393
-			if ( isset( $values[ $col ] ) ) {
394
-				$new_values[ $col ] = $values[ $col ];
393
+			if ( isset( $values[$col] ) ) {
394
+				$new_values[$col] = $values[$col];
395 395
 			}
396 396
 		}
397 397
 
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
 		$new_values['created_at']    = current_time( 'mysql', 1 );
404 404
 
405 405
 		if ( isset( $values['id'] ) ) {
406
-			$frm_duplicate_ids[ $values['field_key'] ] = $new_values['field_key'];
406
+			$frm_duplicate_ids[$values['field_key']] = $new_values['field_key'];
407 407
 			$new_values                                = apply_filters( 'frm_duplicated_field', $new_values );
408 408
 		}
409 409
 
@@ -411,7 +411,7 @@  discard block
 block discarded – undo
411 411
 
412 412
 		foreach ( $new_values as $k => $v ) {
413 413
 			if ( is_array( $v ) ) {
414
-				$new_values[ $k ] = $k === 'default_value' ? FrmAppHelper::maybe_json_encode( $v ) : serialize( $v );
414
+				$new_values[$k] = $k === 'default_value' ? FrmAppHelper::maybe_json_encode( $v ) : serialize( $v );
415 415
 			}
416 416
 			unset( $k, $v );
417 417
 		}
@@ -430,7 +430,7 @@  discard block
 block discarded – undo
430 430
 		}
431 431
 
432 432
 		if ( isset( $values['id'] ) ) {
433
-			$frm_duplicate_ids[ $values['id'] ] = $new_id;
433
+			$frm_duplicate_ids[$values['id']] = $new_id;
434 434
 		}
435 435
 
436 436
 		return $new_id;
@@ -484,7 +484,7 @@  discard block
 block discarded – undo
484 484
 			 *
485 485
 			 * @return string
486 486
 			 */
487
-			function ( $match ) {
487
+			function( $match ) {
488 488
 				$attr = shortcode_parse_atts( $match[3] );
489 489
 
490 490
 				if ( ! is_array( $attr ) ) {
@@ -512,7 +512,7 @@  discard block
 block discarded – undo
512 512
 					}
513 513
 
514 514
 					if ( FrmAppHelper::input_key_is_safe( $key, 'update' ) ) {
515
-						$safe_atts[ $key ] = $value;
515
+						$safe_atts[$key] = $value;
516 516
 					}
517 517
 				}//end foreach
518 518
 
@@ -584,7 +584,7 @@  discard block
 block discarded – undo
584 584
 	public static function duplicate( $old_form_id, $form_id, $copy_keys = false, $blog_id = false ) {
585 585
 		global $frm_duplicate_ids;
586 586
 
587
-		$where  = array(
587
+		$where = array(
588 588
 			array(
589 589
 				'or'                => 1,
590 590
 				'fi.form_id'        => $old_form_id,
@@ -631,8 +631,8 @@  discard block
 block discarded – undo
631 631
 
632 632
 			$values                                 = apply_filters( 'frm_duplicated_field', $values );
633 633
 			$new_id                                 = self::create( $values );
634
-			$frm_duplicate_ids[ $field->id ]        = $new_id;
635
-			$frm_duplicate_ids[ $field->field_key ] = $new_id;
634
+			$frm_duplicate_ids[$field->id]        = $new_id;
635
+			$frm_duplicate_ids[$field->field_key] = $new_id;
636 636
 			unset( $field );
637 637
 		}//end foreach
638 638
 	}
@@ -682,11 +682,11 @@  discard block
 block discarded – undo
682 682
 
683 683
 		// serialize array values
684 684
 		foreach ( array( 'field_options', 'options' ) as $opt ) {
685
-			if ( isset( $values[ $opt ] ) && is_array( $values[ $opt ] ) ) {
685
+			if ( isset( $values[$opt] ) && is_array( $values[$opt] ) ) {
686 686
 				if ( 'field_options' === $opt ) {
687
-					$values[ $opt ] = self::maybe_filter_options( $values[ $opt ] );
687
+					$values[$opt] = self::maybe_filter_options( $values[$opt] );
688 688
 				}
689
-				$values[ $opt ] = serialize( $values[ $opt ] );
689
+				$values[$opt] = serialize( $values[$opt] );
690 690
 			}
691 691
 		}
692 692
 
@@ -899,8 +899,8 @@  discard block
 block discarded – undo
899 899
 					continue;
900 900
 				}
901 901
 
902
-				$fields[ $result->id ] = $result;
903
-				++$count;
902
+				$fields[$result->id] = $result;
903
+				++ $count;
904 904
 
905 905
 				if ( $limit == 1 ) {
906 906
 					$fields = $result;
@@ -955,8 +955,8 @@  discard block
 block discarded – undo
955 955
 			$count  = 0;
956 956
 
957 957
 			foreach ( $results as $result ) {
958
-				++$count;
959
-				$fields[ $result->id ] = $result;
958
+				++ $count;
959
+				$fields[$result->id] = $result;
960 960
 
961 961
 				if ( ! empty( $limit ) && $count >= $limit ) {
962 962
 					break;
@@ -1089,7 +1089,7 @@  discard block
 block discarded – undo
1089 1089
 		$query_type = $limit === ' LIMIT 1' || $limit == 1 ? 'row' : 'results';
1090 1090
 
1091 1091
 		if ( is_array( $where ) ) {
1092
-			$args    = array(
1092
+			$args = array(
1093 1093
 				'order_by' => $order_by,
1094 1094
 				'limit'    => $limit,
1095 1095
 			);
@@ -1126,9 +1126,9 @@  discard block
 block discarded – undo
1126 1126
 				FrmDb::set_cache( $result->field_key, $result, 'frm_field' );
1127 1127
 
1128 1128
 				self::prepare_options( $result );
1129
-				$results[ $r_key ]->field_options = $result->field_options;
1130
-				$results[ $r_key ]->options       = $result->options;
1131
-				$results[ $r_key ]->default_value = $result->default_value;
1129
+				$results[$r_key]->field_options = $result->field_options;
1130
+				$results[$r_key]->options       = $result->options;
1131
+				$results[$r_key]->default_value = $result->default_value;
1132 1132
 
1133 1133
 				unset( $r_key, $result );
1134 1134
 			}
@@ -1224,7 +1224,7 @@  discard block
 block discarded – undo
1224 1224
 
1225 1225
 			if ( count( $next_fields ) >= self::$transient_size ) {
1226 1226
 				// if this transient is full, check for another
1227
-				++$next;
1227
+				++ $next;
1228 1228
 				self::get_next_transient( $fields, $base_name, $next );
1229 1229
 			}
1230 1230
 		}
@@ -1260,7 +1260,7 @@  discard block
 block discarded – undo
1260 1260
 				return;
1261 1261
 			}
1262 1262
 
1263
-			++$next;
1263
+			++ $next;
1264 1264
 		}
1265 1265
 	}
1266 1266
 
@@ -1418,7 +1418,7 @@  discard block
 block discarded – undo
1418 1418
 	 * @return bool
1419 1419
 	 */
1420 1420
 	public static function is_option_true_in_array( $field, $option ) {
1421
-		return ! empty( $field[ $option ] );
1421
+		return ! empty( $field[$option] );
1422 1422
 	}
1423 1423
 
1424 1424
 	/**
@@ -1428,7 +1428,7 @@  discard block
 block discarded – undo
1428 1428
 	 * @return bool
1429 1429
 	 */
1430 1430
 	public static function is_option_true_in_object( $field, $option ) {
1431
-		return isset( $field->field_options[ $option ] ) && $field->field_options[ $option ];
1431
+		return isset( $field->field_options[$option] ) && $field->field_options[$option];
1432 1432
 	}
1433 1433
 
1434 1434
 	/**
@@ -1438,7 +1438,7 @@  discard block
 block discarded – undo
1438 1438
 	 * @return bool
1439 1439
 	 */
1440 1440
 	public static function is_option_empty_in_array( $field, $option ) {
1441
-		return empty( $field[ $option ] );
1441
+		return empty( $field[$option] );
1442 1442
 	}
1443 1443
 
1444 1444
 	/**
@@ -1448,7 +1448,7 @@  discard block
 block discarded – undo
1448 1448
 	 * @return bool
1449 1449
 	 */
1450 1450
 	public static function is_option_empty_in_object( $field, $option ) {
1451
-		return empty( $field->field_options[ $option ] );
1451
+		return empty( $field->field_options[$option] );
1452 1452
 	}
1453 1453
 
1454 1454
 	/**
@@ -1458,7 +1458,7 @@  discard block
 block discarded – undo
1458 1458
 	 * @return bool
1459 1459
 	 */
1460 1460
 	public static function is_option_value_in_object( $field, $option ) {
1461
-		return isset( $field->field_options[ $option ] ) && $field->field_options[ $option ] != '';
1461
+		return isset( $field->field_options[$option] ) && $field->field_options[$option] != '';
1462 1462
 	}
1463 1463
 
1464 1464
 	/**
@@ -1480,10 +1480,10 @@  discard block
 block discarded – undo
1480 1480
 	 * @return mixed
1481 1481
 	 */
1482 1482
 	public static function get_option_in_array( $field, $option ) {
1483
-		if ( isset( $field[ $option ] ) ) {
1484
-			$this_option = $field[ $option ];
1485
-		} elseif ( isset( $field['field_options'] ) && is_array( $field['field_options'] ) && isset( $field['field_options'][ $option ] ) ) {
1486
-			$this_option = $field['field_options'][ $option ];
1483
+		if ( isset( $field[$option] ) ) {
1484
+			$this_option = $field[$option];
1485
+		} elseif ( isset( $field['field_options'] ) && is_array( $field['field_options'] ) && isset( $field['field_options'][$option] ) ) {
1486
+			$this_option = $field['field_options'][$option];
1487 1487
 		} else {
1488 1488
 			$this_option = '';
1489 1489
 		}
@@ -1498,7 +1498,7 @@  discard block
 block discarded – undo
1498 1498
 	 * @return mixed
1499 1499
 	 */
1500 1500
 	public static function get_option_in_object( $field, $option ) {
1501
-		return $field->field_options[ $option ] ?? '';
1501
+		return $field->field_options[$option] ?? '';
1502 1502
 	}
1503 1503
 
1504 1504
 	/**
Please login to merge, or discard this patch.
classes/models/fields/FrmFieldType.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -170,8 +170,8 @@  discard block
 block discarded – undo
170 170
 
171 171
 		if ( is_object( $this->field ) ) {
172 172
 			$field_val = $this->field->{$column};
173
-		} elseif ( is_array( $this->field ) && isset( $this->field[ $column ] ) ) {
174
-			$field_val = $this->field[ $column ];
173
+		} elseif ( is_array( $this->field ) && isset( $this->field[$column] ) ) {
174
+			$field_val = $this->field[$column];
175 175
 		}
176 176
 
177 177
 		return $field_val;
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 		if ( is_object( $this->field ) ) {
188 188
 			$this->field->{$column} = $value;
189 189
 		} elseif ( is_array( $this->field ) ) {
190
-			$this->field[ $column ] = $value;
190
+			$this->field[$column] = $value;
191 191
 		}
192 192
 	}
193 193
 
@@ -730,7 +730,7 @@  discard block
 block discarded – undo
730 730
 			printf(
731 731
 				/* translators: %s: Field type */
732 732
 				esc_html__( '%s Options', 'formidable' ),
733
-				esc_html( $all_field_types[ $args['display']['type'] ]['name'] )
733
+				esc_html( $all_field_types[$args['display']['type']]['name'] )
734 734
 			);
735 735
 			FrmAppHelper::icon_by_class( 'frmfont frm_arrowdown8_icon', array( 'aria-hidden' => 'true' ) );
736 736
 			?>
@@ -872,8 +872,8 @@  discard block
 block discarded – undo
872 872
 
873 873
 		$fields = array_merge( $fields, $pro_fields );
874 874
 
875
-		if ( isset( $fields[ $this->type ] ) ) {
876
-			$name = is_array( $fields[ $this->type ] ) ? $fields[ $this->type ]['name'] : $fields[ $this->type ];
875
+		if ( isset( $fields[$this->type] ) ) {
876
+			$name = is_array( $fields[$this->type] ) ? $fields[$this->type]['name'] : $fields[$this->type];
877 877
 		}
878 878
 
879 879
 		return $name;
@@ -890,7 +890,7 @@  discard block
 block discarded – undo
890 890
 	 * @return array
891 891
 	 */
892 892
 	public function get_default_field_options() {
893
-		$opts        = array(
893
+		$opts = array(
894 894
 			'size'               => '',
895 895
 			'max'                => '',
896 896
 			'label'              => '',
@@ -1149,7 +1149,7 @@  discard block
 block discarded – undo
1149 1149
 	 * @return void
1150 1150
 	 */
1151 1151
 	public function set_aria_invalid_error( &$shortcode_atts, $args ) {
1152
-		$shortcode_atts['aria-invalid'] = isset( $args['errors'][ 'field' . $this->field_id ] ) ? 'true' : 'false';
1152
+		$shortcode_atts['aria-invalid'] = isset( $args['errors']['field' . $this->field_id] ) ? 'true' : 'false';
1153 1153
 	}
1154 1154
 
1155 1155
 	/**
@@ -1342,11 +1342,11 @@  discard block
 block discarded – undo
1342 1342
 
1343 1343
 		$options = array_values( $this->field['options'] );
1344 1344
 
1345
-		if ( ! isset( $options[ $opt ] ) ) {
1345
+		if ( ! isset( $options[$opt] ) ) {
1346 1346
 			return $hidden;
1347 1347
 		}
1348 1348
 
1349
-		$option = $options[ $opt ];
1349
+		$option = $options[$opt];
1350 1350
 
1351 1351
 		if ( is_array( $option ) ) {
1352 1352
 			$option = $option['value'];
@@ -1432,8 +1432,8 @@  discard block
 block discarded – undo
1432 1432
 		$selected = $values['field_value'];
1433 1433
 
1434 1434
 		if ( isset( $values['combo_name'] ) ) {
1435
-			$options  = $options[ $values['combo_name'] ];
1436
-			$selected = is_array( $selected ) && isset( $selected[ $values['combo_name'] ] ) ? $selected[ $values['combo_name'] ] : '';
1435
+			$options  = $options[$values['combo_name']];
1436
+			$selected = is_array( $selected ) && isset( $selected[$values['combo_name']] ) ? $selected[$values['combo_name']] : '';
1437 1437
 		}
1438 1438
 
1439 1439
 		$input = $this->select_tag( $values );
@@ -1504,7 +1504,7 @@  discard block
 block discarded – undo
1504 1504
 	 * @return array
1505 1505
 	 */
1506 1506
 	protected function fill_display_field_values( $args = array() ) {
1507
-		$defaults        = array(
1507
+		$defaults = array(
1508 1508
 			'field_name'    => 'item_meta[' . $this->get_field_column( 'id' ) . ']',
1509 1509
 			'field_id'      => $this->get_field_column( 'id' ),
1510 1510
 			'field_plus_id' => '',
@@ -1565,7 +1565,7 @@  discard block
 block discarded – undo
1565 1565
 			}
1566 1566
 		}
1567 1567
 
1568
-		if ( isset( $args['errors'][ 'field' . $args['field_id'] ] ) && ! $custom_error_fields ) {
1568
+		if ( isset( $args['errors']['field' . $args['field_id']] ) && ! $custom_error_fields ) {
1569 1569
 			if ( $error_comes_first ) {
1570 1570
 				array_unshift( $describedby, 'frm_error_' . $args['html_id'] );
1571 1571
 			} else {
@@ -1651,10 +1651,10 @@  discard block
 block discarded – undo
1651 1651
 		$field_id = $this->get_field_column( 'id' );
1652 1652
 
1653 1653
 		if ( ! array_key_exists( $field_id, $frm_validated_unique_values ) ) {
1654
-			$frm_validated_unique_values[ $field_id ] = array();
1654
+			$frm_validated_unique_values[$field_id] = array();
1655 1655
 			return false;
1656 1656
 		}
1657
-		return in_array( $value, $frm_validated_unique_values[ $field_id ], true );
1657
+		return in_array( $value, $frm_validated_unique_values[$field_id], true );
1658 1658
 	}
1659 1659
 
1660 1660
 	/**
@@ -1682,7 +1682,7 @@  discard block
 block discarded – undo
1682 1682
 	private function value_validated_as_unique( $value ) {
1683 1683
 		global $frm_validated_unique_values;
1684 1684
 		$field_id                                   = $this->get_field_column( 'id' );
1685
-		$frm_validated_unique_values[ $field_id ][] = $value;
1685
+		$frm_validated_unique_values[$field_id][] = $value;
1686 1686
 	}
1687 1687
 
1688 1688
 	/**
@@ -1728,8 +1728,8 @@  discard block
 block discarded – undo
1728 1728
 		$value = $this->prepare_display_value( $value, $atts );
1729 1729
 
1730 1730
 		if ( is_array( $value ) ) {
1731
-			if ( ! empty( $atts['show'] ) && isset( $value[ $atts['show'] ] ) ) {
1732
-				$value = $value[ $atts['show'] ];
1731
+			if ( ! empty( $atts['show'] ) && isset( $value[$atts['show']] ) ) {
1732
+				$value = $value[$atts['show']];
1733 1733
 			} elseif ( empty( $atts['return_array'] ) ) {
1734 1734
 				$sep   = $atts['sep'] ?? ', ';
1735 1735
 				$value = FrmAppHelper::safe_implode( $sep, $value );
@@ -1861,8 +1861,8 @@  discard block
 block discarded – undo
1861 1861
 		$new_value     = array();
1862 1862
 
1863 1863
 		foreach ( (array) $value as $old_child_id ) {
1864
-			if ( isset( $saved_entries[ $old_child_id ] ) ) {
1865
-				$new_value[] = $saved_entries[ $old_child_id ];
1864
+			if ( isset( $saved_entries[$old_child_id] ) ) {
1865
+				$new_value[] = $saved_entries[$old_child_id];
1866 1866
 			}
1867 1867
 		}
1868 1868
 
Please login to merge, or discard this patch.
classes/models/FrmFormAction.php 1 patch
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -227,9 +227,9 @@  discard block
 block discarded – undo
227 227
 		$groups = FrmFormActionsController::form_action_groups();
228 228
 		$group  = 'misc';
229 229
 
230
-		if ( isset( $action_options['group'] ) && isset( $groups[ $action_options['group'] ] ) ) {
230
+		if ( isset( $action_options['group'] ) && isset( $groups[$action_options['group']] ) ) {
231 231
 			$group = $action_options['group'];
232
-		} elseif ( isset( $groups[ $this->id_base ] ) ) {
232
+		} elseif ( isset( $groups[$this->id_base] ) ) {
233 233
 			$group = $this->id_base;
234 234
 		} else {
235 235
 			foreach ( $groups as $name => $check_group ) {
@@ -240,8 +240,8 @@  discard block
 block discarded – undo
240 240
 			}
241 241
 		}
242 242
 
243
-		$groups[ $group ]['id'] = $group;
244
-		return $groups[ $group ];
243
+		$groups[$group]['id'] = $group;
244
+		return $groups[$group];
245 245
 	}
246 246
 
247 247
 	/**
@@ -366,7 +366,7 @@  discard block
 block discarded – undo
366 366
 	 * @return int $post_id
367 367
 	 */
368 368
 	public function maybe_create_action( $action, $forms ) {
369
-		if ( isset( $action['ID'] ) && is_numeric( $action['ID'] ) && isset( $forms[ $action['menu_order'] ] ) && $forms[ $action['menu_order'] ] === 'updated' ) {
369
+		if ( isset( $action['ID'] ) && is_numeric( $action['ID'] ) && isset( $forms[$action['menu_order']] ) && $forms[$action['menu_order']] === 'updated' ) {
370 370
 			// Update action only
371 371
 			$action['post_content'] = FrmAppHelper::maybe_json_decode( $action['post_content'] );
372 372
 			return $this->save_settings( $action );
@@ -389,18 +389,18 @@  discard block
 block discarded – undo
389 389
 		$switch             = $this->get_global_switch_fields();
390 390
 
391 391
 		foreach ( (array) $action->post_content as $key => $val ) {
392
-			if ( is_numeric( $val ) && isset( $frm_duplicate_ids[ $val ] ) ) {
393
-				$action->post_content[ $key ] = $frm_duplicate_ids[ $val ];
392
+			if ( is_numeric( $val ) && isset( $frm_duplicate_ids[$val] ) ) {
393
+				$action->post_content[$key] = $frm_duplicate_ids[$val];
394 394
 			} elseif ( ! is_array( $val ) ) {
395
-				$action->post_content[ $key ] = FrmFieldsHelper::switch_field_ids( $val );
396
-			} elseif ( isset( $switch[ $key ] ) && is_array( $switch[ $key ] ) ) {
395
+				$action->post_content[$key] = FrmFieldsHelper::switch_field_ids( $val );
396
+			} elseif ( isset( $switch[$key] ) && is_array( $switch[$key] ) ) {
397 397
 				// loop through each value if empty
398
-				if ( empty( $switch[ $key ] ) ) {
399
-					$switch[ $key ] = array_keys( $val );
398
+				if ( empty( $switch[$key] ) ) {
399
+					$switch[$key] = array_keys( $val );
400 400
 				}
401 401
 
402
-				foreach ( $switch[ $key ] as $subkey ) {
403
-					$action->post_content[ $key ] = $this->duplicate_array_walk( $action->post_content[ $key ], $subkey, $val );
402
+				foreach ( $switch[$key] as $subkey ) {
403
+					$action->post_content[$key] = $this->duplicate_array_walk( $action->post_content[$key], $subkey, $val );
404 404
 				}
405 405
 			}
406 406
 
@@ -425,20 +425,20 @@  discard block
 block discarded – undo
425 425
 			foreach ( $subkey as $subkey2 ) {
426 426
 				foreach ( (array) $val as $ck => $cv ) {
427 427
 					if ( is_array( $cv ) ) {
428
-						$action[ $ck ] = $this->duplicate_array_walk( $action[ $ck ], $subkey2, $cv );
429
-					} elseif ( isset( $cv[ $subkey ] ) && is_numeric( $cv[ $subkey ] ) && isset( $frm_duplicate_ids[ $cv[ $subkey ] ] ) ) {
430
-						$action[ $ck ][ $subkey ] = $frm_duplicate_ids[ $cv[ $subkey ] ];
428
+						$action[$ck] = $this->duplicate_array_walk( $action[$ck], $subkey2, $cv );
429
+					} elseif ( isset( $cv[$subkey] ) && is_numeric( $cv[$subkey] ) && isset( $frm_duplicate_ids[$cv[$subkey]] ) ) {
430
+						$action[$ck][$subkey] = $frm_duplicate_ids[$cv[$subkey]];
431 431
 					}
432 432
 				}
433 433
 			}
434 434
 		} else {
435 435
 			foreach ( (array) $val as $ck => $cv ) {
436 436
 				if ( is_array( $cv ) ) {
437
-					$action[ $ck ] = $this->duplicate_array_walk( $action[ $ck ], $subkey, $cv );
438
-				} elseif ( $ck == $subkey && isset( $frm_duplicate_ids[ $cv ] ) ) {
439
-					$action[ $ck ] = $frm_duplicate_ids[ $cv ];
437
+					$action[$ck] = $this->duplicate_array_walk( $action[$ck], $subkey, $cv );
438
+				} elseif ( $ck == $subkey && isset( $frm_duplicate_ids[$cv] ) ) {
439
+					$action[$ck] = $frm_duplicate_ids[$cv];
440 440
 				} elseif ( $ck == $subkey ) {
441
-					$action[ $ck ] = $this->maybe_switch_field_ids( $action[ $ck ] );
441
+					$action[$ck] = $this->maybe_switch_field_ids( $action[$ck] );
442 442
 				}
443 443
 			}
444 444
 		}//end if
@@ -466,10 +466,10 @@  discard block
 block discarded – undo
466 466
 		}
467 467
 
468 468
 		// phpcs:ignore WordPress.Security.NonceVerification.Missing
469
-		if ( isset( $_POST[ $this->option_name ] ) && is_array( $_POST[ $this->option_name ] ) ) {
469
+		if ( isset( $_POST[$this->option_name] ) && is_array( $_POST[$this->option_name] ) ) {
470 470
 			// Sanitizing removes scripts and <email> type of values.
471 471
 			// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
472
-			$settings = wp_unslash( $_POST[ $this->option_name ] );
472
+			$settings = wp_unslash( $_POST[$this->option_name] );
473 473
 		} else {
474 474
 			return null;
475 475
 		}
@@ -479,7 +479,7 @@  discard block
 block discarded – undo
479 479
 		foreach ( $settings as $number => $new_instance ) {
480 480
 			$this->_set( $number );
481 481
 
482
-			$old_instance = $all_instances[ $number ] ?? array();
482
+			$old_instance = $all_instances[$number] ?? array();
483 483
 
484 484
 			if ( ! isset( $new_instance['post_status'] ) ) {
485 485
 				$new_instance['post_status'] = 'draft';
@@ -518,7 +518,7 @@  discard block
 block discarded – undo
518 518
 			$instance['post_content'] = apply_filters( 'frm_before_save_' . $this->id_base . '_action', $instance['post_content'], $instance, $new_instance, $old_instance, $this );
519 519
 
520 520
 			if ( false !== $instance ) {
521
-				$all_instances[ $number ] = $instance;
521
+				$all_instances[$number] = $instance;
522 522
 			}
523 523
 
524 524
 			$action_ids[] = $this->save_settings( $instance );
@@ -629,12 +629,12 @@  discard block
 block discarded – undo
629 629
 			// some plugins/themes are formatting the post_excerpt
630 630
 			$action->post_excerpt = sanitize_title( $action->post_excerpt );
631 631
 
632
-			if ( ! isset( $action_controls[ $action->post_excerpt ] ) ) {
632
+			if ( ! isset( $action_controls[$action->post_excerpt] ) ) {
633 633
 				continue;
634 634
 			}
635 635
 
636
-			$action                  = $action_controls[ $action->post_excerpt ]->prepare_action( $action );
637
-			$settings[ $action->ID ] = $action;
636
+			$action                  = $action_controls[$action->post_excerpt]->prepare_action( $action );
637
+			$settings[$action->ID] = $action;
638 638
 
639 639
 			if ( count( $settings ) >= $limit ) {
640 640
 				break;
@@ -684,7 +684,7 @@  discard block
 block discarded – undo
684 684
 			'limit'       => 99,
685 685
 			'post_status' => $default_status,
686 686
 		);
687
-		$args     = wp_parse_args( $args, $defaults );
687
+		$args = wp_parse_args( $args, $defaults );
688 688
 	}
689 689
 
690 690
 	/**
@@ -764,7 +764,7 @@  discard block
 block discarded – undo
764 764
 
765 765
 			$action = $this->prepare_action( $action );
766 766
 
767
-			$settings[ $action->ID ] = $action;
767
+			$settings[$action->ID] = $action;
768 768
 		}
769 769
 
770 770
 		if ( 1 === $limit ) {
@@ -812,10 +812,10 @@  discard block
 block discarded – undo
812 812
 
813 813
 		foreach ( $default_values as $k => $vals ) {
814 814
 			if ( is_array( $vals ) && ! empty( $vals ) ) {
815
-				if ( 'event' === $k && ! $this->action_options['force_event'] && ! empty( $action->post_content[ $k ] ) ) {
815
+				if ( 'event' === $k && ! $this->action_options['force_event'] && ! empty( $action->post_content[$k] ) ) {
816 816
 					continue;
817 817
 				}
818
-				$action->post_content[ $k ] = wp_parse_args( $action->post_content[ $k ], $vals );
818
+				$action->post_content[$k] = wp_parse_args( $action->post_content[$k], $vals );
819 819
 			}
820 820
 		}
821 821
 
@@ -917,9 +917,9 @@  discard block
 block discarded – undo
917 917
 
918 918
 		// fill with existing options
919 919
 		foreach ( $action->post_content as $name => $val ) {
920
-			if ( isset( $form->options[ $name ] ) ) {
921
-				$action->post_content[ $name ] = $form->options[ $name ];
922
-				unset( $form->options[ $name ] );
920
+			if ( isset( $form->options[$name] ) ) {
921
+				$action->post_content[$name] = $form->options[$name];
922
+				unset( $form->options[$name] );
923 923
 			}
924 924
 		}
925 925
 
@@ -1027,7 +1027,7 @@  discard block
 block discarded – undo
1027 1027
 		$form_fields = FrmField::get_all_for_form( $form_id, '', 'include' );
1028 1028
 		return array_filter(
1029 1029
 			$form_fields,
1030
-			function ( $form_field ) {
1030
+			function( $form_field ) {
1031 1031
 				return ! FrmField::is_no_save_field( $form_field->type );
1032 1032
 			}
1033 1033
 		);
Please login to merge, or discard this patch.