Completed
Push — master ( ac3d59...56bb23 )
by
unknown
17s
created
stripe/controllers/FrmStrpLiteActionsController.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 			$gateway   = $payment_action->post_content['gateway'];
73 73
 			$is_stripe = $gateway === 'stripe' || ( is_array( $gateway ) && in_array( 'stripe', $gateway, true ) );
74 74
 			if ( ! $is_stripe || empty( $payment_action->post_content['amount'] ) ) {
75
-				unset( $payment_actions[ $k ] );
75
+				unset( $payment_actions[$k] );
76 76
 			}
77 77
 		}
78 78
 		return $payment_actions;
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 			'run_triggers' => false,
110 110
 			'show_errors'  => true,
111 111
 		);
112
-		$atts     = compact( 'action', 'entry', 'form' );
112
+		$atts = compact( 'action', 'entry', 'form' );
113 113
 
114 114
 		$amount = self::prepare_amount( $action->post_content['amount'], $atts );
115 115
 		if ( empty( $amount ) || $amount == 000 ) {
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
 
297 297
 		// Gateway is a radio button but it should always be an array in the database for
298 298
 		// compatibility with the payments submodule where it is a checkbox.
299
-		$settings['gateway']  = ! empty( $settings['gateway'] ) ? (array) $settings['gateway'] : array( 'stripe' );
299
+		$settings['gateway'] = ! empty( $settings['gateway'] ) ? (array) $settings['gateway'] : array( 'stripe' );
300 300
 
301 301
 		$is_stripe = in_array( 'stripe', $settings['gateway'], true );
302 302
 		if ( ! $is_stripe ) {
@@ -487,7 +487,7 @@  discard block
 block discarded – undo
487 487
 		$disallowed = array( ';', ':', '!important' );
488 488
 		foreach ( $settings as $k => $s ) {
489 489
 			if ( is_string( $s ) ) {
490
-				$settings[ $k ] = str_replace( $disallowed, '', $s );
490
+				$settings[$k] = str_replace( $disallowed, '', $s );
491 491
 			}
492 492
 		}
493 493
 
@@ -611,18 +611,18 @@  discard block
 block discarded – undo
611 611
 	 * @return array
612 612
 	 */
613 613
 	public static function remove_cc_validation( $errors, $field, $values ) {
614
-		$has_processed = isset( $_POST[ 'frmintent' . $field->form_id ] ); // phpcs:ignore WordPress.Security.NonceVerification.Missing
614
+		$has_processed = isset( $_POST['frmintent' . $field->form_id] ); // phpcs:ignore WordPress.Security.NonceVerification.Missing
615 615
 		if ( ! $has_processed ) {
616 616
 			return $errors;
617 617
 		}
618 618
 
619 619
 		$field_id = $field->temp_id ?? $field->id;
620 620
 
621
-		if ( isset( $errors[ 'field' . $field_id . '-cc' ] ) ) {
622
-			unset( $errors[ 'field' . $field_id . '-cc' ] );
621
+		if ( isset( $errors['field' . $field_id . '-cc'] ) ) {
622
+			unset( $errors['field' . $field_id . '-cc'] );
623 623
 		}
624
-		if ( isset( $errors[ 'field' . $field_id ] ) ) {
625
-			unset( $errors[ 'field' . $field_id ] );
624
+		if ( isset( $errors['field' . $field_id] ) ) {
625
+			unset( $errors['field' . $field_id] );
626 626
 		}
627 627
 
628 628
 		return $errors;
Please login to merge, or discard this patch.
stripe/models/FrmStrpLiteAuth.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 		$intent_is_processing = 'processing' === $intent->status;
58 58
 		if ( $intent_is_processing ) {
59 59
 			// Append an additional processing message to the end of the success message.
60
-			$filter = function ( $message ) {
60
+			$filter = function( $message ) {
61 61
 				$stripe_settings = FrmStrpLiteAppHelper::get_settings();
62 62
 				$message        .= '<p>' . esc_html( $stripe_settings->settings->processing_message ) . '</p>';
63 63
 				return $message;
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
 		$atts['form']        = FrmForm::getOne( $atts['entry']->form_id );
162 162
 		$atts['entry_id']    = $atts['entry']->id;
163 163
 		$opt                 = 'success_action';
164
-		$atts['conf_method'] = ! empty( $atts['form']->options[ $opt ] ) ? $atts['form']->options[ $opt ] : 'message';
164
+		$atts['conf_method'] = ! empty( $atts['form']->options[$opt] ) ? $atts['form']->options[$opt] : 'message';
165 165
 
166 166
 		$actions = FrmFormsController::get_met_on_submit_actions( $atts, 'create' );
167 167
 		if ( $actions ) {
@@ -246,10 +246,10 @@  discard block
 block discarded – undo
246 246
 	 */
247 247
 	public static function get_payment_intents( $name ) {
248 248
 		// phpcs:ignore WordPress.Security.NonceVerification.Missing
249
-		if ( ! isset( $_POST[ $name ] ) ) {
249
+		if ( ! isset( $_POST[$name] ) ) {
250 250
 			return array();
251 251
 		}
252
-		$intents = $_POST[ $name ]; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
252
+		$intents = $_POST[$name]; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
253 253
 		FrmAppHelper::sanitize_value( 'sanitize_text_field', $intents );
254 254
 		return $intents;
255 255
 	}
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
 		self::format_form_data( $form );
277 277
 
278 278
 		$form_id = absint( $form['form_id'] );
279
-		$intents = $form[ 'frmintent' . $form_id ] ?? array();
279
+		$intents = $form['frmintent' . $form_id] ?? array();
280 280
 
281 281
 		if ( empty( $intents ) ) {
282 282
 			wp_die();
@@ -286,8 +286,8 @@  discard block
 block discarded – undo
286 286
 			$intents = array( $intents );
287 287
 		} else {
288 288
 			foreach ( $intents as $k => $intent ) {
289
-				if ( is_array( $intent ) && isset( $intent[ $k ] ) ) {
290
-					$intents[ $k ] = $intent[ $k ];
289
+				if ( is_array( $intent ) && isset( $intent[$k] ) ) {
290
+					$intents[$k] = $intent[$k];
291 291
 				}
292 292
 			}
293 293
 		}
@@ -344,7 +344,7 @@  discard block
 block discarded – undo
344 344
 				if ( $saved->metadata->action != $action->ID ) {
345 345
 					continue;
346 346
 				}
347
-				$intents[ $k ] = array(
347
+				$intents[$k] = array(
348 348
 					'id'     => $intent,
349 349
 					'action' => $action->ID,
350 350
 				);
@@ -387,7 +387,7 @@  discard block
 block discarded – undo
387 387
 			if ( $k === 'item_meta' ) {
388 388
 				foreach ( $v as $f => $value ) {
389 389
 					FrmAppHelper::sanitize_value( 'wp_kses_post', $value );
390
-					$entry->metas[ absint( $f ) ] = $value;
390
+					$entry->metas[absint( $f )] = $value;
391 391
 				}
392 392
 			} else {
393 393
 				FrmAppHelper::sanitize_value( 'wp_kses_post', $v );
@@ -411,14 +411,14 @@  discard block
 block discarded – undo
411 411
 
412 412
 		foreach ( $form as $input ) {
413 413
 			$key = $input['name'];
414
-			if ( isset( $formatted[ $key ] ) ) {
415
-				if ( is_array( $formatted[ $key ] ) ) {
416
-					$formatted[ $key ][] = $input['value'];
414
+			if ( isset( $formatted[$key] ) ) {
415
+				if ( is_array( $formatted[$key] ) ) {
416
+					$formatted[$key][] = $input['value'];
417 417
 				} else {
418
-					$formatted[ $key ] = array( $formatted[ $key ], $input['value'] );
418
+					$formatted[$key] = array( $formatted[$key], $input['value'] );
419 419
 				}
420 420
 			} else {
421
-				$formatted[ $key ] = $input['value'];
421
+				$formatted[$key] = $input['value'];
422 422
 			}
423 423
 		}
424 424
 
@@ -658,7 +658,7 @@  discard block
 block discarded – undo
658 658
 
659 659
 		foreach ( $actions as $k => $action ) {
660 660
 			$amount                                = self::get_amount_before_submit( compact( 'action', 'form' ) );
661
-			$actions[ $k ]->post_content['amount'] = $amount;
661
+			$actions[$k]->post_content['amount'] = $amount;
662 662
 		}
663 663
 	}
664 664
 
Please login to merge, or discard this patch.
stripe/helpers/FrmStrpLiteUrlParamHelper.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -26,10 +26,10 @@  discard block
 block discarded – undo
26 26
 	 * @return array|false
27 27
 	 */
28 28
 	public static function get_details_for_form( $form_id ) {
29
-		if ( ! isset( self::$details_by_form_id[ $form_id ] ) ) {
29
+		if ( ! isset( self::$details_by_form_id[$form_id] ) ) {
30 30
 			self::set_details_for_form( (int) $form_id );
31 31
 		}
32
-		return self::$details_by_form_id[ $form_id ] ?? false;
32
+		return self::$details_by_form_id[$form_id] ?? false;
33 33
 	}
34 34
 
35 35
 	/**
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 			return;
91 91
 		}
92 92
 
93
-		self::$details_by_form_id[ $form_id ] = array(
93
+		self::$details_by_form_id[$form_id] = array(
94 94
 			'entry'   => $entry,
95 95
 			'intent'  => $intent,
96 96
 			'payment' => $payment,
Please login to merge, or discard this patch.
stripe/helpers/FrmTransLiteAppHelper.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 	 */
67 67
 	public static function show_status( $status ) {
68 68
 		$statuses = array_merge( self::get_payment_statuses(), self::get_subscription_statuses() );
69
-		return $statuses[ $status ] ?? $status;
69
+		return $statuses[$status] ?? $status;
70 70
 	}
71 71
 
72 72
 	/**
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
 	 */
153 153
 	public static function get_action_setting( $option, $atts ) {
154 154
 		$settings = self::get_action_settings( $atts );
155
-		$value    = $settings[ $option ] ?? '';
155
+		$value    = $settings[$option] ?? '';
156 156
 		return $value;
157 157
 	}
158 158
 
@@ -255,8 +255,8 @@  discard block
 block discarded – undo
255 255
 	 */
256 256
 	public static function get_repeat_label_from_value( $value, $number ) {
257 257
 		$times = self::get_plural_repeat_times( $number );
258
-		if ( isset( $times[ $value ] ) ) {
259
-			$value = $times[ $value ];
258
+		if ( isset( $times[$value] ) ) {
259
+			$value = $times[$value];
260 260
 		}
261 261
 		return $value;
262 262
 	}
@@ -504,7 +504,7 @@  discard block
 block discarded – undo
504 504
 		$count = 0;
505 505
 		foreach ( $payments as $payment ) {
506 506
 			if ( $payment->status === 'complete' ) {
507
-				$count++;
507
+				$count ++;
508 508
 			}
509 509
 		}
510 510
 
@@ -526,8 +526,8 @@  discard block
 block discarded – undo
526 526
 		if ( is_array( $gateway ) ) {
527 527
 			$gateway = reset( $gateway );
528 528
 		}
529
-		if ( isset( $gateways[ $gateway ] ) ) {
530
-			$value = $gateways[ $gateway ][ $setting ];
529
+		if ( isset( $gateways[$gateway] ) ) {
530
+			$value = $gateways[$gateway][$setting];
531 531
 		}
532 532
 		return $value;
533 533
 	}
Please login to merge, or discard this patch.
classes/controllers/FrmFormsController.php 1 patch
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -719,7 +719,7 @@  discard block
 block discarded – undo
719 719
 			 * @param string|null $src
720 720
 			 * @return string
721 721
 			 */
722
-			function ( $src ) {
722
+			function( $src ) {
723 723
 				if ( is_null( $src ) ) {
724 724
 					$src = '';
725 725
 				}
@@ -784,11 +784,11 @@  discard block
 block discarded – undo
784 784
 			),
785 785
 		);
786 786
 
787
-		if ( ! isset( $available_status[ $status ] ) ) {
787
+		if ( ! isset( $available_status[$status] ) ) {
788 788
 			return;
789 789
 		}
790 790
 
791
-		FrmAppHelper::permission_check( $available_status[ $status ]['permission'] );
791
+		FrmAppHelper::permission_check( $available_status[$status]['permission'] );
792 792
 
793 793
 		$params = FrmForm::list_page_params();
794 794
 
@@ -796,8 +796,8 @@  discard block
 block discarded – undo
796 796
 		check_admin_referer( $status . '_form_' . $params['id'] );
797 797
 
798 798
 		$count = 0;
799
-		if ( FrmForm::set_status( $params['id'], $available_status[ $status ]['new_status'] ) ) {
800
-			++$count;
799
+		if ( FrmForm::set_status( $params['id'], $available_status[$status]['new_status'] ) ) {
800
+			++ $count;
801 801
 		}
802 802
 
803 803
 		$form_type = FrmAppHelper::get_simple_request(
@@ -813,7 +813,7 @@  discard block
 block discarded – undo
813 813
 		/* translators: %1$s: Number of forms, %2$s: Start link HTML, %3$s: End link HTML */
814 814
 		$available_status['trash']['message'] = sprintf( _n( '%1$s form moved to the Trash. %2$sUndo%3$s', '%1$s forms moved to the Trash. %2$sUndo%3$s', $count, 'formidable' ), $count, '<a href="' . esc_url( wp_nonce_url( '?page=formidable&frm_action=untrash&form_type=' . $form_type . '&id=' . $params['id'], 'untrash_form_' . $params['id'] ) ) . '">', '</a>' );
815 815
 
816
-		$message = $available_status[ $status ]['message'];
816
+		$message = $available_status[$status]['message'];
817 817
 
818 818
 		self::display_forms_list( $params, $message );
819 819
 	}
@@ -828,7 +828,7 @@  discard block
 block discarded – undo
828 828
 		$count = 0;
829 829
 		foreach ( $ids as $id ) {
830 830
 			if ( FrmForm::trash( $id ) ) {
831
-				++$count;
831
+				++ $count;
832 832
 			}
833 833
 		}
834 834
 
@@ -842,7 +842,7 @@  discard block
 block discarded – undo
842 842
 				'type'  => 'request',
843 843
 			)
844 844
 		);
845
-		$message      = sprintf(
845
+		$message = sprintf(
846 846
 			/* translators: %1$s: Number of forms, %2$s: Start link HTML, %3$s: End link HTML */
847 847
 			_n( '%1$s form moved to the Trash. %2$sUndo%3$s', '%1$s forms moved to the Trash. %2$sUndo%3$s', $count, 'formidable' ),
848 848
 			$count,
@@ -863,7 +863,7 @@  discard block
 block discarded – undo
863 863
 
864 864
 		$count = 0;
865 865
 		if ( FrmForm::destroy( $params['id'] ) ) {
866
-			++$count;
866
+			++ $count;
867 867
 		}
868 868
 
869 869
 		/* translators: %1$s: Number of forms */
@@ -883,7 +883,7 @@  discard block
 block discarded – undo
883 883
 		foreach ( $ids as $id ) {
884 884
 			$d = FrmForm::destroy( $id );
885 885
 			if ( $d ) {
886
-				++$count;
886
+				++ $count;
887 887
 			}
888 888
 		}
889 889
 
@@ -1384,7 +1384,7 @@  discard block
 block discarded – undo
1384 1384
 
1385 1385
 		add_action(
1386 1386
 			'wp_enqueue_editor',
1387
-			function () {
1387
+			function() {
1388 1388
 				wp_print_media_templates();
1389 1389
 			}
1390 1390
 		);
@@ -1493,7 +1493,7 @@  discard block
 block discarded – undo
1493 1493
 
1494 1494
 		foreach ( array( 'landing', 'chat', 'abandonment' ) as $feature ) {
1495 1495
 			if ( ! FrmAppHelper::show_new_feature( $feature ) ) {
1496
-				unset( $sections[ $feature ] );
1496
+				unset( $sections[$feature] );
1497 1497
 			}
1498 1498
 		}
1499 1499
 
@@ -1521,7 +1521,7 @@  discard block
 block discarded – undo
1521 1521
 				$section['id'] = $section['anchor'];
1522 1522
 			}
1523 1523
 
1524
-			$sections[ $key ] = $section;
1524
+			$sections[$key] = $section;
1525 1525
 		}//end foreach
1526 1526
 
1527 1527
 		return $sections;
@@ -1644,7 +1644,7 @@  discard block
 block discarded – undo
1644 1644
 		if ( $user_fields ) {
1645 1645
 			$user_helpers = array();
1646 1646
 			foreach ( $user_fields as $uk => $uf ) {
1647
-				$user_helpers[ '|user_id| show="' . $uk . '"' ] = $uf;
1647
+				$user_helpers['|user_id| show="' . $uk . '"'] = $uf;
1648 1648
 				unset( $uk, $uf );
1649 1649
 			}
1650 1650
 
@@ -1778,7 +1778,7 @@  discard block
 block discarded – undo
1778 1778
 		if ( ! isset( $frm_vars['js_validate_forms'] ) ) {
1779 1779
 			$frm_vars['js_validate_forms'] = array();
1780 1780
 		}
1781
-		$frm_vars['js_validate_forms'][ $form->id ] = $form;
1781
+		$frm_vars['js_validate_forms'][$form->id] = $form;
1782 1782
 	}
1783 1783
 
1784 1784
 	public static function get_email_html() {
@@ -1962,7 +1962,7 @@  discard block
 block discarded – undo
1962 1962
 				add_filter( 'frm_validate_form', 'FrmFormsController::json_error' );
1963 1963
 			} else {
1964 1964
 				$vars   = FrmAppHelper::json_to_array( $json_vars );
1965
-				$action = $vars[ $action ];
1965
+				$action = $vars[$action];
1966 1966
 				unset( $_REQUEST['frm_compact_fields'], $_POST['frm_compact_fields'] ); // phpcs:ignore WordPress.Security.NonceVerification.Missing
1967 1967
 				$_REQUEST = array_merge( $_REQUEST, $vars ); // phpcs:ignore WordPress.Security.NonceVerification.Missing
1968 1968
 				$_POST    = array_merge( $_POST, $_REQUEST ); // phpcs:ignore WordPress.Security.NonceVerification.Missing
@@ -2125,7 +2125,7 @@  discard block
 block discarded – undo
2125 2125
 		$actions = array();
2126 2126
 		foreach ( $frm_vars['forms_loaded'] as $form ) {
2127 2127
 			if ( is_object( $form ) ) {
2128
-				$actions[ $form->id ] = $form->name;
2128
+				$actions[$form->id] = $form->name;
2129 2129
 			}
2130 2130
 			unset( $form );
2131 2131
 		}
@@ -2370,8 +2370,8 @@  discard block
 block discarded – undo
2370 2370
 	private static function get_saved_errors( $form, $params ) {
2371 2371
 		global $frm_vars;
2372 2372
 
2373
-		if ( $params['posted_form_id'] == $form->id && $_POST && isset( $frm_vars['created_entries'][ $form->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
2374
-			$errors = $frm_vars['created_entries'][ $form->id ]['errors'];
2373
+		if ( $params['posted_form_id'] == $form->id && $_POST && isset( $frm_vars['created_entries'][$form->id] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
2374
+			$errors = $frm_vars['created_entries'][$form->id]['errors'];
2375 2375
 		} else {
2376 2376
 			$errors = array();
2377 2377
 		}
@@ -2393,7 +2393,7 @@  discard block
 block discarded – undo
2393 2393
 	public static function just_created_entry( $form_id ) {
2394 2394
 		global $frm_vars;
2395 2395
 
2396
-		return isset( $frm_vars['created_entries'] ) && isset( $frm_vars['created_entries'][ $form_id ] ) && isset( $frm_vars['created_entries'][ $form_id ]['entry_id'] ) ? $frm_vars['created_entries'][ $form_id ]['entry_id'] : 0;
2396
+		return isset( $frm_vars['created_entries'] ) && isset( $frm_vars['created_entries'][$form_id] ) && isset( $frm_vars['created_entries'][$form_id]['entry_id'] ) ? $frm_vars['created_entries'][$form_id]['entry_id'] : 0;
2397 2397
 	}
2398 2398
 
2399 2399
 	/**
@@ -2413,7 +2413,7 @@  discard block
 block discarded – undo
2413 2413
 	private static function get_confirmation_method( $atts ) {
2414 2414
 		$action = FrmOnSubmitHelper::current_event( $atts );
2415 2415
 		$opt    = 'update' === $action ? 'edit_action' : 'success_action';
2416
-		$method = ! empty( $atts['form']->options[ $opt ] ) ? $atts['form']->options[ $opt ] : 'message';
2416
+		$method = ! empty( $atts['form']->options[$opt] ) ? $atts['form']->options[$opt] : 'message';
2417 2417
 
2418 2418
 		if ( ! empty( $atts['entry_id'] ) ) {
2419 2419
 			$met_actions = self::get_met_on_submit_actions( $atts, $action );
@@ -2434,7 +2434,7 @@  discard block
 block discarded – undo
2434 2434
 	public static function maybe_trigger_redirect( $form, $params, $args ) {
2435 2435
 		if ( ! isset( $params['id'] ) ) {
2436 2436
 			global $frm_vars;
2437
-			$params['id'] = $frm_vars['created_entries'][ $form->id ]['entry_id'];
2437
+			$params['id'] = $frm_vars['created_entries'][$form->id]['entry_id'];
2438 2438
 		}
2439 2439
 
2440 2440
 		$conf_method = self::get_confirmation_method(
@@ -2516,7 +2516,7 @@  discard block
 block discarded – undo
2516 2516
 		$args['success_opt'] = $opt;
2517 2517
 		$args['ajax']        = ! empty( $frm_vars['ajax'] );
2518 2518
 
2519
-		if ( $args['conf_method'] === 'page' && is_numeric( $args['form']->options[ $opt . '_page_id' ] ) ) {
2519
+		if ( $args['conf_method'] === 'page' && is_numeric( $args['form']->options[$opt . '_page_id'] ) ) {
2520 2520
 			self::load_page_after_submit( $args );
2521 2521
 		} elseif ( $args['conf_method'] === 'redirect' ) {
2522 2522
 			self::redirect_after_submit( $args );
@@ -2540,7 +2540,7 @@  discard block
 block discarded – undo
2540 2540
 		}
2541 2541
 
2542 2542
 		// If a redirect action has already opened the URL in a new tab, we show the default message in the current tab.
2543
-		if ( ! empty( self::$redirected_in_new_tab[ $args['form']->id ] ) ) {
2543
+		if ( ! empty( self::$redirected_in_new_tab[$args['form']->id] ) ) {
2544 2544
 			return array( FrmOnSubmitHelper::get_fallback_action_after_open_in_new_tab( $event ) );
2545 2545
 		}
2546 2546
 
@@ -2728,7 +2728,7 @@  discard block
 block discarded – undo
2728 2728
 
2729 2729
 		$opt = 'update' === $args['action'] ? 'edit_' : 'success_';
2730 2730
 
2731
-		$new_args['conf_method'] = $new_args['form']->options[ $opt . 'action' ];
2731
+		$new_args['conf_method'] = $new_args['form']->options[$opt . 'action'];
2732 2732
 
2733 2733
 		/**
2734 2734
 		 * Filters the run success action args.
@@ -2748,8 +2748,8 @@  discard block
 block discarded – undo
2748 2748
 	private static function load_page_after_submit( $args ) {
2749 2749
 		global $post;
2750 2750
 		$opt = $args['success_opt'];
2751
-		if ( ! $post || $args['form']->options[ $opt . '_page_id' ] != $post->ID ) {
2752
-			$page     = get_post( $args['form']->options[ $opt . '_page_id' ] );
2751
+		if ( ! $post || $args['form']->options[$opt . '_page_id'] != $post->ID ) {
2752
+			$page     = get_post( $args['form']->options[$opt . '_page_id'] );
2753 2753
 			$old_post = $post;
2754 2754
 			$post     = $page;
2755 2755
 			$content  = apply_filters( 'frm_content', $page->post_content, $args['form'], $args['entry_id'] );
@@ -2779,7 +2779,7 @@  discard block
 block discarded – undo
2779 2779
 		add_filter( 'frm_use_wpautop', '__return_false' );
2780 2780
 
2781 2781
 		$opt         = $args['success_opt'];
2782
-		$success_url = trim( $args['form']->options[ $opt . '_url' ] );
2782
+		$success_url = trim( $args['form']->options[$opt . '_url'] );
2783 2783
 		$success_url = apply_filters( 'frm_content', $success_url, $args['form'], $args['entry_id'] );
2784 2784
 		$success_url = do_shortcode( $success_url );
2785 2785
 
@@ -2801,7 +2801,7 @@  discard block
 block discarded – undo
2801 2801
 			// Not AJAX submit, no headers sent, and there is just one Redirect action runs.
2802 2802
 			if ( ! empty( $args['form']->options['open_in_new_tab'] ) ) {
2803 2803
 				self::print_open_in_new_tab_js_with_fallback_handler( $success_url, $args );
2804
-				self::$redirected_in_new_tab[ $args['form']->id ] = 1;
2804
+				self::$redirected_in_new_tab[$args['form']->id] = 1;
2805 2805
 				return;
2806 2806
 			}
2807 2807
 
@@ -3081,7 +3081,7 @@  discard block
 block discarded – undo
3081 3081
 			'description' => false,
3082 3082
 			'reset'       => false,
3083 3083
 		);
3084
-		$args     = wp_parse_args( $args, $defaults );
3084
+		$args = wp_parse_args( $args, $defaults );
3085 3085
 	}
3086 3086
 
3087 3087
 	/**
@@ -3119,7 +3119,7 @@  discard block
 block discarded – undo
3119 3119
 		$opt          = $args['success_opt'] ?? 'success';
3120 3120
 
3121 3121
 		if ( $entry_id && is_numeric( $entry_id ) ) {
3122
-			$message = $form->options[ $opt . '_msg' ] ?? $frm_settings->success_msg;
3122
+			$message = $form->options[$opt . '_msg'] ?? $frm_settings->success_msg;
3123 3123
 			$class   = 'frm_message';
3124 3124
 		} else {
3125 3125
 			$message = $frm_settings->failed_msg;
@@ -3344,8 +3344,8 @@  discard block
 block discarded – undo
3344 3344
 
3345 3345
 		check_ajax_referer( 'frm_ajax', 'nonce' );
3346 3346
 
3347
-		$html             = FrmAppHelper::clip(
3348
-			function () {
3347
+		$html = FrmAppHelper::clip(
3348
+			function() {
3349 3349
 				FrmAppHelper::maybe_autocomplete_pages_options(
3350 3350
 					array(
3351 3351
 						'field_name'  => 'frm_page_dropdown',
Please login to merge, or discard this patch.
classes/controllers/FrmAddonsController.php 1 patch
Spacing   +26 added lines, -28 removed lines patch added patch discarded remove patch
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
 				'<span class="frm-upgrade-submenu">' . esc_html( $cta_text ) . '</span>',
117 117
 				'frm_view_forms',
118 118
 				'formidable-pro-upgrade',
119
-				function () {
119
+				function() {
120 120
 					// This function doesn't need to do anything.
121 121
 					// The redirect is handled earlier to avoid issues with the headers being sent.
122 122
 				}
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 			unset( $addons['error'] );
148 148
 		}
149 149
 
150
-		$pro    = array(
150
+		$pro = array(
151 151
 			'pro' => array(
152 152
 				'title'      => 'Formidable Forms Pro',
153 153
 				'slug'       => 'formidable-pro',
@@ -189,9 +189,9 @@  discard block
 block discarded – undo
189 189
 
190 190
 		// Extract the elements to move
191 191
 		foreach ( $plans as $plan ) {
192
-			if ( isset( self::$categories[ $plan ] ) ) {
193
-				$bottom_categories[ $plan ] = self::$categories[ $plan ];
194
-				unset( self::$categories[ $plan ] );
192
+			if ( isset( self::$categories[$plan] ) ) {
193
+				$bottom_categories[$plan] = self::$categories[$plan];
194
+				unset( self::$categories[$plan] );
195 195
 			}
196 196
 		}
197 197
 
@@ -245,14 +245,12 @@  discard block
 block discarded – undo
245 245
 			// Add the slug to the new array.
246 246
 			$addon['category-slugs'][] = $category_slug;
247 247
 
248
-			if ( ! isset( self::$categories[ $category_slug ] ) ) {
249
-				self::$categories[ $category_slug ] = array(
248
+			if ( ! isset( self::$categories[$category_slug] ) ) {
249
+				self::$categories[$category_slug] = array(
250 250
 					'name'  => $category,
251 251
 					'count' => 0,
252 252
 				);
253
-			}
254
-
255
-			++self::$categories[ $category_slug ]['count'];
253
+			} ++self::$categories[$category_slug]['count'];
256 254
 		}
257 255
 	}
258 256
 
@@ -284,7 +282,7 @@  discard block
 block discarded – undo
284 282
 		} else {
285 283
 			foreach ( $addons as $k => $addon ) {
286 284
 				if ( empty( $addon['excerpt'] ) && $k !== 'error' ) {
287
-					unset( $addons[ $k ] );
285
+					unset( $addons[$k] );
288 286
 				}
289 287
 			}
290 288
 		}
@@ -398,7 +396,7 @@  discard block
 block discarded – undo
398 396
 
399 397
 		foreach ( $list as $k => $info ) {
400 398
 			$info['slug'] = $k;
401
-			$list[ $k ]   = array_merge( $defaults, $info );
399
+			$list[$k]   = array_merge( $defaults, $info );
402 400
 		}
403 401
 		return $list;
404 402
 	}
@@ -549,17 +547,17 @@  discard block
 block discarded – undo
549 547
 				continue;
550 548
 			}
551 549
 
552
-			$wp_plugin    = $wp_plugins[ $folder ] ?? array();
550
+			$wp_plugin    = $wp_plugins[$folder] ?? array();
553 551
 			$wp_version   = $wp_plugin['Version'] ?? '1.0';
554 552
 			$plugin->slug = explode( '/', $folder )[0];
555 553
 
556 554
 			if ( version_compare( $wp_version, $plugin->new_version, '<' ) ) {
557
-				$transient->response[ $folder ] = $plugin;
555
+				$transient->response[$folder] = $plugin;
558 556
 			} else {
559
-				$transient->no_update[ $folder ] = $plugin;
557
+				$transient->no_update[$folder] = $plugin;
560 558
 			}
561 559
 
562
-			$transient->checked[ $folder ] = $wp_version;
560
+			$transient->checked[$folder] = $wp_version;
563 561
 
564 562
 		}//end foreach
565 563
 
@@ -592,7 +590,7 @@  discard block
 block discarded – undo
592 590
 	 */
593 591
 	protected static function is_installed( $plugin ) {
594 592
 		$all_plugins = self::get_plugins();
595
-		return isset( $all_plugins[ $plugin ] );
593
+		return isset( $all_plugins[$plugin] );
596 594
 	}
597 595
 
598 596
 	/**
@@ -631,13 +629,13 @@  discard block
 block discarded – undo
631 629
 			}
632 630
 
633 631
 			$download_id = $plugin['id'] ?? 0;
634
-			if ( ! empty( $download_id ) && ! isset( $version_info[ $download_id ]['package'] ) ) {
632
+			if ( ! empty( $download_id ) && ! isset( $version_info[$download_id]['package'] ) ) {
635 633
 				// if this addon is using its own license, get the update url
636 634
 				$addon_info = $api->get_api_info();
637 635
 
638
-				$version_info[ $download_id ] = $addon_info[ $download_id ];
636
+				$version_info[$download_id] = $addon_info[$download_id];
639 637
 				if ( isset( $addon_info['error'] ) ) {
640
-					$version_info[ $download_id ]['error'] = array(
638
+					$version_info[$download_id]['error'] = array(
641 639
 						'message' => $addon_info['error']['message'],
642 640
 						'code'    => $addon_info['error']['code'],
643 641
 					);
@@ -736,8 +734,8 @@  discard block
 block discarded – undo
736 734
 					return $addon;
737 735
 				}
738 736
 			}
739
-		} elseif ( isset( $addons[ $download_id ] ) ) {
740
-			$plugin = $addons[ $download_id ];
737
+		} elseif ( isset( $addons[$download_id] ) ) {
738
+			$plugin = $addons[$download_id];
741 739
 		}
742 740
 
743 741
 		return $plugin;
@@ -803,7 +801,7 @@  discard block
 block discarded – undo
803 801
 			self::set_addon_status( $addon );
804 802
 			self::set_categories( $addon );
805 803
 
806
-			$addons[ $id ] = $addon;
804
+			$addons[$id] = $addon;
807 805
 		}//end foreach
808 806
 	}
809 807
 
@@ -844,7 +842,7 @@  discard block
 block discarded – undo
844 842
 			'utm_medium'   => 'addons',
845 843
 			'utm_campaign' => 'liteplugin',
846 844
 		);
847
-		$link       = add_query_arg( $query_args, $link );
845
+		$link = add_query_arg( $query_args, $link );
848 846
 	}
849 847
 
850 848
 	/**
@@ -1062,7 +1060,7 @@  discard block
 block discarded – undo
1062 1060
 	 */
1063 1061
 	public static function ajax_activate_addon() {
1064 1062
 		self::process_addon_action(
1065
-			function ( $plugin ) {
1063
+			function( $plugin ) {
1066 1064
 				return self::handle_addon_action( $plugin, 'activate' );
1067 1065
 			},
1068 1066
 			array( 'FrmAddonsController', 'get_addon_activation_response' )
@@ -1087,7 +1085,7 @@  discard block
 block discarded – undo
1087 1085
 	 */
1088 1086
 	public static function ajax_deactivate_addon() {
1089 1087
 		self::process_addon_action(
1090
-			function ( $plugin ) {
1088
+			function( $plugin ) {
1091 1089
 				return self::handle_addon_action( $plugin, 'deactivate' );
1092 1090
 			}
1093 1091
 		);
@@ -1102,7 +1100,7 @@  discard block
 block discarded – undo
1102 1100
 	 */
1103 1101
 	public static function ajax_uninstall_addon() {
1104 1102
 		self::process_addon_action(
1105
-			function ( $plugin ) {
1103
+			function( $plugin ) {
1106 1104
 				return self::handle_addon_action( $plugin, 'uninstall' );
1107 1105
 			}
1108 1106
 		);
@@ -1500,7 +1498,7 @@  discard block
 block discarded – undo
1500 1498
 		$addons = $api->get_api_info();
1501 1499
 
1502 1500
 		if ( is_array( $addons ) && array_key_exists( $addon_id, $addons ) ) {
1503
-			$dates    = $addons[ $addon_id ];
1501
+			$dates    = $addons[$addon_id];
1504 1502
 			$requires = FrmFormsHelper::get_plan_required( $dates );
1505 1503
 		}
1506 1504
 
Please login to merge, or discard this patch.
classes/views/frm-form-actions/_action_inside.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@
 block discarded – undo
43 43
 	$event_labels = FrmFormAction::trigger_labels();
44 44
 	foreach ( $action_control->action_options['event'] as $event ) {
45 45
 		?>
46
-		<option value="<?php echo esc_attr( $event ); ?>" <?php echo in_array( $event, (array) $form_action->post_content['event'] ) ? ' selected="selected"' : ''; ?> ><?php echo esc_html( $event_labels[ $event ] ?? $event ); ?></option>
46
+		<option value="<?php echo esc_attr( $event ); ?>" <?php echo in_array( $event, (array) $form_action->post_content['event'] ) ? ' selected="selected"' : ''; ?> ><?php echo esc_html( $event_labels[$event] ?? $event ); ?></option>
47 47
 <?php } ?>
48 48
 		</select>
49 49
 	</p>
Please login to merge, or discard this patch.
classes/views/frm-fields/back-end/combo-field/sub-field-options.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -40,14 +40,14 @@  discard block
 block discarded – undo
40 40
 				?>
41 41
 				<p class="frm6 frm_form_field">
42 42
 					<label class="frm_description" for="<?php echo esc_attr( $input_id ); ?>">
43
-						<?php echo esc_html( $labels[ $option ] ); ?>
43
+						<?php echo esc_html( $labels[$option] ); ?>
44 44
 					</label>
45 45
 					<span class="frm-with-right-icon">
46 46
 						<input
47 47
 							type="text"
48 48
 							name="<?php echo esc_attr( $input_name ); ?>"
49 49
 							id="<?php echo esc_attr( $input_id ); ?>"
50
-							value="<?php echo esc_attr( $default_value[ $sub_field['name'] ] ?? '' ); ?>"
50
+							value="<?php echo esc_attr( $default_value[$sub_field['name']] ?? '' ); ?>"
51 51
 							data-changeme="field_<?php echo esc_attr( $field_key . '_' . $sub_field['name'] ); ?>"
52 52
 							data-changeatt="value"
53 53
 						/>
@@ -73,13 +73,13 @@  discard block
 block discarded – undo
73 73
 				?>
74 74
 				<p class="frm6 frm_form_field">
75 75
 					<label class="frm_description" for="<?php echo esc_attr( $input_id ); ?>">
76
-						<?php echo esc_html( $labels[ $option ] ); ?>
76
+						<?php echo esc_html( $labels[$option] ); ?>
77 77
 					</label>
78 78
 					<input
79 79
 						type="text"
80 80
 						name="<?php echo esc_attr( $input_name ); ?>"
81 81
 						id="<?php echo esc_attr( $input_id ); ?>"
82
-						value="<?php echo esc_attr( $input_value[ $sub_field['name'] ] ?? '' ); ?>"
82
+						value="<?php echo esc_attr( $input_value[$sub_field['name']] ?? '' ); ?>"
83 83
 						data-changeme="field_<?php echo esc_attr( $field_key . '_' . $sub_field['name'] ); ?>"
84 84
 						data-changeatt="<?php echo esc_attr( $option ); ?>"
85 85
 					/>
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 				?>
96 96
 				<p class="frm_form_field frm-flex-col">
97 97
 					<label class="frm_description" for="<?php echo esc_attr( $input_id ); ?>">
98
-						<?php echo esc_html( $labels[ $option ] ); ?>
98
+						<?php echo esc_html( $labels[$option] ); ?>
99 99
 					</label>
100 100
 					<textarea
101 101
 						name="<?php echo esc_attr( $input_name ); ?>"
Please login to merge, or discard this patch.
classes/views/frm-fields/front-end/combo-field/combo-field.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 			$sub_field_class   = "frm_form_field form-field frm_form_subfield-{$name} {$sub_field['wrapper_classes']}";
42 42
 			$sub_field_desc    = FrmField::get_option( $field, $name . '_desc' );
43 43
 
44
-			if ( isset( $errors[ 'field' . $field_id . '-' . $name ] ) ) {
44
+			if ( isset( $errors['field' . $field_id . '-' . $name] ) ) {
45 45
 				$sub_field_class .= ' frm_blank_field';
46 46
 			}
47 47
 			?>
@@ -60,11 +60,11 @@  discard block
 block discarded – undo
60 60
 						$attrs = array(
61 61
 							'type'  => $sub_field['type'],
62 62
 							'id'    => $html_id . '_' . $name,
63
-							'value' => $field_value[ $name ] ?? '',
63
+							'value' => $field_value[$name] ?? '',
64 64
 						);
65 65
 
66
-						if ( ! empty( $field_value[ $name ] ) ) {
67
-							$attrs['data-frmval'] = $field_value[ $name ];
66
+						if ( ! empty( $field_value[$name] ) ) {
67
+							$attrs['data-frmval'] = $field_value[$name];
68 68
 						}
69 69
 						if ( empty( $args['remove_names'] ) ) {
70 70
 							$attrs['name'] = $field_name . '[' . $name . ']';
@@ -81,9 +81,9 @@  discard block
 block discarded – undo
81 81
 				}
82 82
 
83 83
 				// Don't show individual field errors when there is a combo field error.
84
-				if ( ! empty( $errors ) && isset( $errors[ 'field' . $field_id . '-' . $name ] ) && ! isset( $errors[ 'field' . $field_id ] ) ) {
84
+				if ( ! empty( $errors ) && isset( $errors['field' . $field_id . '-' . $name] ) && ! isset( $errors['field' . $field_id] ) ) {
85 85
 					?>
86
-					<div class="frm_error" role="alert"><?php echo esc_html( $errors[ 'field' . $field_id . '-' . $name ] ); ?></div>
86
+					<div class="frm_error" role="alert"><?php echo esc_html( $errors['field' . $field_id . '-' . $name] ); ?></div>
87 87
 				<?php } ?>
88 88
 			</div>
89 89
 			<?php
Please login to merge, or discard this patch.