Completed
Pull Request — master (#2229)
by
unknown
54s
created
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 = isset( $form[ 'frmintent' . $form_id ] ) ? $form[ 'frmintent' . $form_id ] : array();
279
+		$intents = isset( $form['frmintent' . $form_id] ) ? $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
 		}
@@ -340,7 +340,7 @@  discard block
 block discarded – undo
340 340
 				if ( $saved->metadata->action != $action->ID ) {
341 341
 					continue;
342 342
 				}
343
-				$intents[ $k ] = array(
343
+				$intents[$k] = array(
344 344
 					'id'     => $intent,
345 345
 					'action' => $action->ID,
346 346
 				);
@@ -383,7 +383,7 @@  discard block
 block discarded – undo
383 383
 			if ( $k === 'item_meta' ) {
384 384
 				foreach ( $v as $f => $value ) {
385 385
 					FrmAppHelper::sanitize_value( 'wp_kses_post', $value );
386
-					$entry->metas[ absint( $f ) ] = $value;
386
+					$entry->metas[absint( $f )] = $value;
387 387
 				}
388 388
 			} else {
389 389
 				FrmAppHelper::sanitize_value( 'wp_kses_post', $v );
@@ -407,14 +407,14 @@  discard block
 block discarded – undo
407 407
 
408 408
 		foreach ( $form as $input ) {
409 409
 			$key = $input['name'];
410
-			if ( isset( $formatted[ $key ] ) ) {
411
-				if ( is_array( $formatted[ $key ] ) ) {
412
-					$formatted[ $key ][] = $input['value'];
410
+			if ( isset( $formatted[$key] ) ) {
411
+				if ( is_array( $formatted[$key] ) ) {
412
+					$formatted[$key][] = $input['value'];
413 413
 				} else {
414
-					$formatted[ $key ] = array( $formatted[ $key ], $input['value'] );
414
+					$formatted[$key] = array( $formatted[$key], $input['value'] );
415 415
 				}
416 416
 			} else {
417
-				$formatted[ $key ] = $input['value'];
417
+				$formatted[$key] = $input['value'];
418 418
 			}
419 419
 		}
420 420
 
@@ -559,7 +559,7 @@  discard block
 block discarded – undo
559 559
 
560 560
 		foreach ( $actions as $k => $action ) {
561 561
 			$amount                                = self::get_amount_before_submit( compact( 'action', 'form' ) );
562
-			$actions[ $k ]->post_content['amount'] = $amount;
562
+			$actions[$k]->post_content['amount'] = $amount;
563 563
 		}
564 564
 	}
565 565
 
Please login to merge, or discard this patch.
stripe/controllers/FrmStrpLiteHooksController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -29,10 +29,10 @@
 block discarded – undo
29 29
 		// This filter hides gateway fields from the entries list.
30 30
 		add_filter(
31 31
 			'frm_fields_in_entries_list_table',
32
-			function ( $form_cols ) {
32
+			function( $form_cols ) {
33 33
 				return array_filter(
34 34
 					$form_cols,
35
-					function ( $form_col ) {
35
+					function( $form_col ) {
36 36
 						return 'gateway' !== $form_col->type;
37 37
 					}
38 38
 				);
Please login to merge, or discard this patch.
stripe/controllers/FrmStrpLiteActionsController.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 			$gateway   = $payment_action->post_content['gateway'];
70 70
 			$is_stripe = $gateway === 'stripe' || ( is_array( $gateway ) && in_array( 'stripe', $gateway, true ) );
71 71
 			if ( ! $is_stripe || empty( $payment_action->post_content['amount'] ) ) {
72
-				unset( $payment_actions[ $k ] );
72
+				unset( $payment_actions[$k] );
73 73
 			}
74 74
 		}
75 75
 		return $payment_actions;
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
 			'run_triggers' => false,
107 107
 			'show_errors'  => true,
108 108
 		);
109
-		$atts     = compact( 'action', 'entry', 'form' );
109
+		$atts = compact( 'action', 'entry', 'form' );
110 110
 
111 111
 		$amount = self::prepare_amount( $action->post_content['amount'], $atts );
112 112
 		if ( empty( $amount ) || $amount == 000 ) {
@@ -293,7 +293,7 @@  discard block
 block discarded – undo
293 293
 
294 294
 		// Gateway is a radio button but it should always be an array in the database for
295 295
 		// compatibility with the payments submodule where it is a checkbox.
296
-		$settings['gateway']  = ! empty( $settings['gateway'] ) ? (array) $settings['gateway'] : array( 'stripe' );
296
+		$settings['gateway'] = ! empty( $settings['gateway'] ) ? (array) $settings['gateway'] : array( 'stripe' );
297 297
 
298 298
 		$is_stripe = in_array( 'stripe', $settings['gateway'], true );
299 299
 		if ( ! $is_stripe ) {
@@ -505,7 +505,7 @@  discard block
 block discarded – undo
505 505
 		$disallowed = array( ';', ':', '!important' );
506 506
 		foreach ( $settings as $k => $s ) {
507 507
 			if ( is_string( $s ) ) {
508
-				$settings[ $k ] = str_replace( $disallowed, '', $s );
508
+				$settings[$k] = str_replace( $disallowed, '', $s );
509 509
 			}
510 510
 		}
511 511
 
@@ -629,18 +629,18 @@  discard block
 block discarded – undo
629 629
 	 * @return array
630 630
 	 */
631 631
 	public static function remove_cc_validation( $errors, $field, $values ) {
632
-		$has_processed = isset( $_POST[ 'frmintent' . $field->form_id ] ); // phpcs:ignore WordPress.Security.NonceVerification.Missing
632
+		$has_processed = isset( $_POST['frmintent' . $field->form_id] ); // phpcs:ignore WordPress.Security.NonceVerification.Missing
633 633
 		if ( ! $has_processed ) {
634 634
 			return $errors;
635 635
 		}
636 636
 
637 637
 		$field_id = isset( $field->temp_id ) ? $field->temp_id : $field->id;
638 638
 
639
-		if ( isset( $errors[ 'field' . $field_id . '-cc' ] ) ) {
640
-			unset( $errors[ 'field' . $field_id . '-cc' ] );
639
+		if ( isset( $errors['field' . $field_id . '-cc'] ) ) {
640
+			unset( $errors['field' . $field_id . '-cc'] );
641 641
 		}
642
-		if ( isset( $errors[ 'field' . $field_id ] ) ) {
643
-			unset( $errors[ 'field' . $field_id ] );
642
+		if ( isset( $errors['field' . $field_id] ) ) {
643
+			unset( $errors['field' . $field_id] );
644 644
 		}
645 645
 
646 646
 		return $errors;
Please login to merge, or discard this patch.
classes/models/FrmSettings.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -239,8 +239,8 @@  discard block
 block discarded – undo
239 239
 		}
240 240
 
241 241
 		foreach ( $settings as $setting => $default ) {
242
-			if ( isset( $params[ 'frm_' . $setting ] ) ) {
243
-				$this->{$setting} = $params[ 'frm_' . $setting ];
242
+			if ( isset( $params['frm_' . $setting] ) ) {
243
+				$this->{$setting} = $params['frm_' . $setting];
244 244
 			} elseif ( ! isset( $this->{$setting} ) ) {
245 245
 				$this->{$setting} = $default;
246 246
 			}
@@ -432,7 +432,7 @@  discard block
 block discarded – undo
432 432
 			'denylist_check',
433 433
 		);
434 434
 		foreach ( $checkboxes as $set ) {
435
-			$this->$set = isset( $params[ 'frm_' . $set ] ) ? absint( $params[ 'frm_' . $set ] ) : 0;
435
+			$this->$set = isset( $params['frm_' . $set] ) ? absint( $params['frm_' . $set] ) : 0;
436 436
 		}
437 437
 	}
438 438
 
@@ -445,7 +445,7 @@  discard block
 block discarded – undo
445 445
 		$frm_roles = FrmAppHelper::frm_capabilities();
446 446
 		$roles     = get_editable_roles();
447 447
 		foreach ( $frm_roles as $frm_role => $frm_role_description ) {
448
-			$this->$frm_role = (array) ( isset( $params[ $frm_role ] ) ? $params[ $frm_role ] : 'administrator' );
448
+			$this->$frm_role = (array) ( isset( $params[$frm_role] ) ? $params[$frm_role] : 'administrator' );
449 449
 
450 450
 			// Make sure administrators always have permissions
451 451
 			if ( ! in_array( 'administrator', $this->$frm_role, true ) ) {
Please login to merge, or discard this patch.
square/models/FrmSquareLiteSettings.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -82,12 +82,12 @@
 block discarded – undo
82 82
 		$settings = $this->default_options();
83 83
 
84 84
 		foreach ( $settings as $setting => $default ) {
85
-			if ( isset( $params[ 'frm_' . $this->param() . '_' . $setting ] ) ) {
86
-				$this->settings->{$setting} = trim( sanitize_text_field( $params[ 'frm_' . $this->param() . '_' . $setting ] ) );
85
+			if ( isset( $params['frm_' . $this->param() . '_' . $setting] ) ) {
86
+				$this->settings->{$setting} = trim( sanitize_text_field( $params['frm_' . $this->param() . '_' . $setting] ) );
87 87
 			}
88 88
 		}
89 89
 
90
-		$this->settings->test_mode = isset( $params[ 'frm_' . $this->param() . '_test_mode' ] ) ? absint( $params[ 'frm_' . $this->param() . '_test_mode' ] ) : 0;
90
+		$this->settings->test_mode = isset( $params['frm_' . $this->param() . '_test_mode'] ) ? absint( $params['frm_' . $this->param() . '_test_mode'] ) : 0;
91 91
 	}
92 92
 
93 93
 	/**
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
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 			$gateway   = $payment_action->post_content['gateway'];
77 77
 			$is_square = $gateway === 'square' || ( is_array( $gateway ) && in_array( 'square', $gateway, true ) );
78 78
 			if ( ! $is_square || empty( $payment_action->post_content['amount'] ) ) {
79
-				unset( $payment_actions[ $k ] );
79
+				unset( $payment_actions[$k] );
80 80
 			}
81 81
 		}
82 82
 		return $payment_actions;
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 			'run_triggers' => false,
98 98
 			'show_errors'  => true,
99 99
 		);
100
-		$atts     = compact( 'action', 'entry', 'form' );
100
+		$atts = compact( 'action', 'entry', 'form' );
101 101
 
102 102
 		$amount = self::prepare_amount( $action->post_content['amount'], $atts );
103 103
 		if ( empty( $amount ) || $amount == 000 ) {
@@ -529,7 +529,7 @@  discard block
 block discarded – undo
529 529
 		$disallowed = array( ';', ':', '!important' );
530 530
 		foreach ( $settings as $k => $s ) {
531 531
 			if ( is_string( $s ) ) {
532
-				$settings[ $k ] = str_replace( $disallowed, '', $s );
532
+				$settings[$k] = str_replace( $disallowed, '', $s );
533 533
 			}
534 534
 		}
535 535
 
@@ -548,18 +548,18 @@  discard block
 block discarded – undo
548 548
 	 * @return array
549 549
 	 */
550 550
 	public static function remove_cc_validation( $errors, $field, $values ) {
551
-		$has_processed = isset( $_POST[ 'frmintent' . $field->form_id ] ); // phpcs:ignore WordPress.Security.NonceVerification.Missing
551
+		$has_processed = isset( $_POST['frmintent' . $field->form_id] ); // phpcs:ignore WordPress.Security.NonceVerification.Missing
552 552
 		if ( ! $has_processed ) {
553 553
 			return $errors;
554 554
 		}
555 555
 
556 556
 		$field_id = isset( $field->temp_id ) ? $field->temp_id : $field->id;
557 557
 
558
-		if ( isset( $errors[ 'field' . $field_id . '-cc' ] ) ) {
559
-			unset( $errors[ 'field' . $field_id . '-cc' ] );
558
+		if ( isset( $errors['field' . $field_id . '-cc'] ) ) {
559
+			unset( $errors['field' . $field_id . '-cc'] );
560 560
 		}
561
-		if ( isset( $errors[ 'field' . $field_id ] ) ) {
562
-			unset( $errors[ 'field' . $field_id ] );
561
+		if ( isset( $errors['field' . $field_id] ) ) {
562
+			unset( $errors['field' . $field_id] );
563 563
 		}
564 564
 
565 565
 		return $errors;
Please login to merge, or discard this patch.
square/controllers/FrmSquareLiteAppController.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -123,9 +123,9 @@  discard block
 block discarded – undo
123 123
 		$address_setting    = $action->post_content['billing_address'];
124 124
 
125 125
 		$entry      = self::generate_false_entry();
126
-		$first_name = $first_name_setting && isset( $entry->metas[ $first_name_setting ] ) ? $entry->metas[ $first_name_setting ] : '';
127
-		$last_name  = $last_name_setting && isset( $entry->metas[ $last_name_setting ] ) ? $entry->metas[ $last_name_setting ] : '';
128
-		$address    = $address_setting && isset( $entry->metas[ $address_setting ] ) ? $entry->metas[ $address_setting ] : '';
126
+		$first_name = $first_name_setting && isset( $entry->metas[$first_name_setting] ) ? $entry->metas[$first_name_setting] : '';
127
+		$last_name  = $last_name_setting && isset( $entry->metas[$last_name_setting] ) ? $entry->metas[$last_name_setting] : '';
128
+		$address    = $address_setting && isset( $entry->metas[$address_setting] ) ? $entry->metas[$address_setting] : '';
129 129
 
130 130
 		if ( is_array( $first_name ) && isset( $first_name['first'] ) ) {
131 131
 			$first_name = $first_name['first'];
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
 		);
142 142
 
143 143
 		if ( $email_setting ) {
144
-			$shortcode_atts   = array(
144
+			$shortcode_atts = array(
145 145
 				'entry' => $entry,
146 146
 				'form'  => $action->menu_order,
147 147
 				'value' => $email_setting,
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
 				if ( is_array( $v ) ) {
182 182
 					foreach ( $v as $f => $value ) {
183 183
 						FrmAppHelper::sanitize_value( 'wp_kses_post', $value );
184
-						$entry->metas[ absint( $f ) ] = $value;
184
+						$entry->metas[absint( $f )] = $value;
185 185
 					}
186 186
 				}
187 187
 			} else {
Please login to merge, or discard this patch.