Completed
Pull Request — master (#2229)
by
unknown
54s
created
square/models/FrmSquareLiteSettings.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -84,8 +84,8 @@
 block discarded – undo
84 84
 		$settings = $this->default_options();
85 85
 
86 86
 		foreach ( $settings as $setting => $default ) {
87
-			if ( isset( $params[ 'frm_' . $this->param() . '_' . $setting ] ) ) {
88
-				$this->settings->{$setting} = trim( sanitize_text_field( $params[ 'frm_' . $this->param() . '_' . $setting ] ) );
87
+			if ( isset( $params['frm_' . $this->param() . '_' . $setting] ) ) {
88
+				$this->settings->{$setting} = trim( sanitize_text_field( $params['frm_' . $this->param() . '_' . $setting] ) );
89 89
 			}
90 90
 		}
91 91
 
Please login to merge, or discard this patch.
stripe/views/action-settings/payments-options.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@
 block discarded – undo
90 90
 
91 91
 			foreach ( $gateways as $gateway_name => $gateway ) {
92 92
 				$gateway_classes = $gateway['recurring'] ? '' : 'frm_gateway_no_recur';
93
-				$gateway_classes .= ( $form_action->post_content['type'] === 'recurring' && ! $gateway['recurring']  ) ? ' frm_hidden' : '';
93
+				$gateway_classes .= ( $form_action->post_content['type'] === 'recurring' && ! $gateway['recurring'] ) ? ' frm_hidden' : '';
94 94
 				$gateway_id       = $this->get_field_id( 'gateways' ) . '_' . $gateway_name;
95 95
 
96 96
 				$radio_atts = array(
Please login to merge, or discard this patch.
square/helpers/FrmSquareLiteConnectHelper.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -160,7 +160,7 @@
 block discarded – undo
160 160
 	 * @return object|string
161 161
 	 */
162 162
 	private static function post_to_connect_server( $action, $additional_body = array() ) {
163
-		$body    = array(
163
+		$body = array(
164 164
 			'frm_square_api_action' => $action,
165 165
 			'frm_square_api_mode'   => FrmSquareLiteAppHelper::active_mode(),
166 166
 		);
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 isset( $statuses[ $status ] ) ? $statuses[ $status ] : $status;
69
+		return isset( $statuses[$status] ) ? $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    = isset( $settings[ $option ] ) ? $settings[ $option ] : '';
155
+		$value    = isset( $settings[$option] ) ? $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.
square/controllers/FrmSquareLiteActionsController.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 			$gateway   = $payment_action->post_content['gateway'];
49 49
 			$is_square = $gateway === 'square' || ( is_array( $gateway ) && in_array( 'square', $gateway, true ) );
50 50
 			if ( ! $is_square || empty( $payment_action->post_content['amount'] ) ) {
51
-				unset( $payment_actions[ $k ] );
51
+				unset( $payment_actions[$k] );
52 52
 			}
53 53
 		}
54 54
 		return $payment_actions;
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 			'run_triggers' => false,
70 70
 			'show_errors'  => true,
71 71
 		);
72
-		$atts     = compact( 'action', 'entry', 'form' );
72
+		$atts = compact( 'action', 'entry', 'form' );
73 73
 
74 74
 		$amount = self::prepare_amount( $action->post_content['amount'], $atts );
75 75
 		if ( empty( $amount ) || $amount == 000 ) {
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
 		// 1. Call the API with the customer and catalog info.
181 181
 		// 2. Add the database rows.
182 182
 
183
-		$action          = $atts['action'];;
183
+		$action          = $atts['action']; ;
184 184
 		$billing_contact = FrmSquareLiteAppController::get_billing_contact( $action );
185 185
 
186 186
 		$info = array(
@@ -502,7 +502,7 @@  discard block
 block discarded – undo
502 502
 		$disallowed = array( ';', ':', '!important' );
503 503
 		foreach ( $settings as $k => $s ) {
504 504
 			if ( is_string( $s ) ) {
505
-				$settings[ $k ] = str_replace( $disallowed, '', $s );
505
+				$settings[$k] = str_replace( $disallowed, '', $s );
506 506
 			}
507 507
 		}
508 508
 
@@ -521,18 +521,18 @@  discard block
 block discarded – undo
521 521
 	 * @return array
522 522
 	 */
523 523
 	public static function remove_cc_validation( $errors, $field, $values ) {
524
-		$has_processed = isset( $_POST[ 'frmintent' . $field->form_id ] ); // phpcs:ignore WordPress.Security.NonceVerification.Missing
524
+		$has_processed = isset( $_POST['frmintent' . $field->form_id] ); // phpcs:ignore WordPress.Security.NonceVerification.Missing
525 525
 		if ( ! $has_processed ) {
526 526
 			return $errors;
527 527
 		}
528 528
 
529 529
 		$field_id = isset( $field->temp_id ) ? $field->temp_id : $field->id;
530 530
 
531
-		if ( isset( $errors[ 'field' . $field_id . '-cc' ] ) ) {
532
-			unset( $errors[ 'field' . $field_id . '-cc' ] );
531
+		if ( isset( $errors['field' . $field_id . '-cc'] ) ) {
532
+			unset( $errors['field' . $field_id . '-cc'] );
533 533
 		}
534
-		if ( isset( $errors[ 'field' . $field_id ] ) ) {
535
-			unset( $errors[ 'field' . $field_id ] );
534
+		if ( isset( $errors['field' . $field_id] ) ) {
535
+			unset( $errors['field' . $field_id] );
536 536
 		}
537 537
 
538 538
 		return $errors;
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.
square/controllers/FrmSquareLiteAppController.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -124,9 +124,9 @@  discard block
 block discarded – undo
124 124
 		$address_setting    = $action->post_content['billing_address'];
125 125
 
126 126
 		$entry      = self::generate_false_entry();
127
-		$first_name = $first_name_setting && isset( $entry->metas[ $first_name_setting ] ) ? $entry->metas[ $first_name_setting ] : '';
128
-		$last_name  = $last_name_setting && isset( $entry->metas[ $last_name_setting ] ) ? $entry->metas[ $last_name_setting ] : '';
129
-		$address    = $address_setting && isset( $entry->metas[ $address_setting ] ) ? $entry->metas[ $address_setting ] : '';
127
+		$first_name = $first_name_setting && isset( $entry->metas[$first_name_setting] ) ? $entry->metas[$first_name_setting] : '';
128
+		$last_name  = $last_name_setting && isset( $entry->metas[$last_name_setting] ) ? $entry->metas[$last_name_setting] : '';
129
+		$address    = $address_setting && isset( $entry->metas[$address_setting] ) ? $entry->metas[$address_setting] : '';
130 130
 
131 131
 		if ( is_array( $first_name ) && isset( $first_name['first'] ) ) {
132 132
 			$first_name = $first_name['first'];
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
 				if ( is_array( $v ) ) {
183 183
 					foreach ( $v as $f => $value ) {
184 184
 						FrmAppHelper::sanitize_value( 'wp_kses_post', $value );
185
-						$entry->metas[ absint( $f ) ] = $value;
185
+						$entry->metas[absint( $f )] = $value;
186 186
 					}
187 187
 				}
188 188
 			} else {
Please login to merge, or discard this patch.