Completed
Pull Request — master (#1311)
by Stephanie
29s
created
stripe/helpers/FrmTransLiteAppHelper.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 	 */
35 35
 	public static function show_status( $status ) {
36 36
 		$statuses = array_merge( self::get_payment_statuses(), self::get_subscription_statuses() );
37
-		return isset( $statuses[ $status ] ) ? $statuses[ $status ] : $status;
37
+		return isset( $statuses[$status] ) ? $statuses[$status] : $status;
38 38
 	}
39 39
 
40 40
 	/**
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 	 */
120 120
 	public static function get_action_setting( $option, $atts ) {
121 121
 		$settings = self::get_action_settings( $atts );
122
-		$value    = isset( $settings[ $option ] ) ? $settings[ $option ] : '';
122
+		$value    = isset( $settings[$option] ) ? $settings[$option] : '';
123 123
 		return $value;
124 124
 	}
125 125
 
@@ -222,8 +222,8 @@  discard block
 block discarded – undo
222 222
 	 */
223 223
 	public static function get_repeat_label_from_value( $value, $number ) {
224 224
 		$times = self::get_plural_repeat_times( $number );
225
-		if ( isset( $times[ $value ] ) ) {
226
-			$value = $times[ $value ];
225
+		if ( isset( $times[$value] ) ) {
226
+			$value = $times[$value];
227 227
 		}
228 228
 		return $value;
229 229
 	}
Please login to merge, or discard this patch.
stripe/helpers/FrmTransLiteListHelper.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 			'payments'      => $frm_payment->get_count(),
113 113
 			'subscriptions' => $frm_sub->get_count(),
114 114
 		);
115
-		$type        = FrmAppHelper::get_simple_request(
115
+		$type = FrmAppHelper::get_simple_request(
116 116
 			array(
117 117
 				'param'   => 'trans_type',
118 118
 				'type'    => 'request',
@@ -127,10 +127,10 @@  discard block
 block discarded – undo
127 127
 				$class = '';
128 128
 			}
129 129
 
130
-			if ( $counts[ $status ] || 'published' === $status ) {
131
-				$links[ $status ] = '<a href="' . esc_url( '?page=formidable-payments&trans_type=' . $status ) . '" ' . $class . '>'
130
+			if ( $counts[$status] || 'published' === $status ) {
131
+				$links[$status] = '<a href="' . esc_url( '?page=formidable-payments&trans_type=' . $status ) . '" ' . $class . '>'
132 132
 					// translators: %1$s: Transaction type (Payments or Subscriptions), %2$s: Span start tag, %3$s: Count, %3$s: Span close tag.
133
-					. sprintf( esc_html__( '%1$s %2$s(%3$s)%4$s', 'formidable' ), esc_html( $name ), '<span class="count">', number_format_i18n( $counts[ $status ] ), '</span>' )
133
+					. sprintf( esc_html__( '%1$s %2$s(%3$s)%4$s', 'formidable' ), esc_html( $name ), '<span class="count">', number_format_i18n( $counts[$status] ), '</span>' )
134 134
 					. '</a>';
135 135
 			}
136 136
 
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
 			echo '<tr id="payment-' . esc_attr( $item->id ) . '" ';
207 207
 
208 208
 			$is_alternate = 0 === $alt % 2;
209
-			$alt++;
209
+			$alt ++;
210 210
 
211 211
 			if ( $is_alternate ) {
212 212
 				echo 'class="alternate"';
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
 
296 296
 		$form_ids = array();
297 297
 		foreach ( $forms as $form ) {
298
-			$form_ids[ $form->id ] = $form;
298
+			$form_ids[$form->id] = $form;
299 299
 			unset( $form );
300 300
 		}
301 301
 
@@ -395,8 +395,8 @@  discard block
 block discarded – undo
395 395
 	 * @return mixed
396 396
 	 */
397 397
 	private function get_form_id_column( $item, $atts ) {
398
-		if ( isset( $atts['form_ids'][ $item->item_id ] ) ) {
399
-			$form_link = FrmFormsHelper::edit_form_link( $atts['form_ids'][ $item->item_id ]->form_id );
398
+		if ( isset( $atts['form_ids'][$item->item_id] ) ) {
399
+			$form_link = FrmFormsHelper::edit_form_link( $atts['form_ids'][$item->item_id]->form_id );
400 400
 			return $form_link;
401 401
 		}
402 402
 
@@ -452,7 +452,7 @@  discard block
 block discarded – undo
452 452
 
453 453
 		foreach ( $completed_payments as $completed_payment ) {
454 454
 			if ( $completed_payment->status === 'complete' ) {
455
-				$count++;
455
+				$count ++;
456 456
 			}
457 457
 		}
458 458
 
Please login to merge, or discard this patch.
stripe/controllers/FrmTransLiteSubscriptionsController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@
 block discarded – undo
69 69
 			'canceled' => __( 'Canceled', 'formidable' ),
70 70
 			'confirm'  => __( 'Are you sure you want to cancel that subscription?', 'formidable' ),
71 71
 		);
72
-		$atts     = array_merge( $defaults, $atts );
72
+		$atts = array_merge( $defaults, $atts );
73 73
 
74 74
 		if ( $sub->status === 'active' ) {
75 75
 			$link  = admin_url( 'admin-ajax.php?action=frm_trans_cancel&sub=' . $sub->id . '&nonce=' . wp_create_nonce( 'frm_trans_ajax' ) );
Please login to merge, or discard this patch.
classes/helpers/FrmTipsHelper.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 			'page'  => '',
46 46
 			'class' => 'frm-mt-0',
47 47
 		);
48
-		$tip      = array_merge( $defaults, $tip );
48
+		$tip = array_merge( $defaults, $tip );
49 49
 
50 50
 		if ( isset( $tip['link'] ) && ! isset( $tip['link']['medium'] ) ) {
51 51
 			$tip['link']['medium'] = 'tip';
@@ -361,7 +361,7 @@  discard block
 block discarded – undo
361 361
 	 * @return array
362 362
 	 */
363 363
 	public static function get_banner_tip() {
364
-		$tips       = array(
364
+		$tips = array(
365 365
 			array(
366 366
 				'link' => array(
367 367
 					'medium'  => 'banner',
@@ -388,7 +388,7 @@  discard block
 block discarded – undo
388 388
 			),
389 389
 		);
390 390
 		$random     = rand( 0, count( $tips ) - 1 );
391
-		$tip        = $tips[ $random ];
391
+		$tip        = $tips[$random];
392 392
 		$tip['num'] = $random;
393 393
 
394 394
 		return $tip;
@@ -397,6 +397,6 @@  discard block
 block discarded – undo
397 397
 	public static function get_random_tip( $tips ) {
398 398
 		$random = rand( 0, count( $tips ) - 1 );
399 399
 
400
-		return $tips[ $random ];
400
+		return $tips[$random];
401 401
 	}
402 402
 }
Please login to merge, or discard this patch.
stripe/models/FrmStrpLiteAuth.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 			return $html;
37 37
 		}
38 38
 
39
-		$details = self::$details_by_form_id[ $form_id ];
39
+		$details = self::$details_by_form_id[$form_id];
40 40
 		$atts    = array(
41 41
 			'fields' => FrmFieldsHelper::get_form_fields( $form_id ),
42 42
 			'entry'  => $details['entry'],
@@ -143,13 +143,13 @@  discard block
 block discarded – undo
143 143
 			return false;
144 144
 		}
145 145
 
146
-		self::$details_by_form_id[ $form_id ] = array(
146
+		self::$details_by_form_id[$form_id] = array(
147 147
 			'entry'   => $entry,
148 148
 			'intent'  => $intent,
149 149
 			'payment' => $payment,
150 150
 		);
151 151
 
152
-		return self::$details_by_form_id[ $form_id ];
152
+		return self::$details_by_form_id[$form_id];
153 153
 	}
154 154
 
155 155
 	/**
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
 		$atts['form']        = FrmForm::getOne( $atts['entry']->form_id );
237 237
 		$atts['entry_id']    = $atts['entry']->id;
238 238
 		$opt                 = 'success_action';
239
-		$atts['conf_method'] = ! empty( $atts['form']->options[ $opt ] ) ? $atts['form']->options[ $opt ] : 'message';
239
+		$atts['conf_method'] = ! empty( $atts['form']->options[$opt] ) ? $atts['form']->options[$opt] : 'message';
240 240
 	}
241 241
 
242 242
 	/**
@@ -313,10 +313,10 @@  discard block
 block discarded – undo
313 313
 	 */
314 314
 	public static function get_payment_intents( $name ) {
315 315
 		// phpcs:ignore WordPress.Security.NonceVerification.Missing
316
-		if ( ! isset( $_POST[ $name ] ) ) {
316
+		if ( ! isset( $_POST[$name] ) ) {
317 317
 			return array();
318 318
 		}
319
-		$intents = $_POST[ $name ]; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
319
+		$intents = $_POST[$name]; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
320 320
 		FrmAppHelper::sanitize_value( 'sanitize_text_field', $intents );
321 321
 		return $intents;
322 322
 	}
@@ -343,7 +343,7 @@  discard block
 block discarded – undo
343 343
 		self::format_form_data( $form );
344 344
 
345 345
 		$form_id = absint( $form['form_id'] );
346
-		$intents = isset( $form[ 'frmintent' . $form_id ] ) ? $form[ 'frmintent' . $form_id ] : array();
346
+		$intents = isset( $form['frmintent' . $form_id] ) ? $form['frmintent' . $form_id] : array();
347 347
 
348 348
 		if ( empty( $intents ) ) {
349 349
 			wp_die();
@@ -353,8 +353,8 @@  discard block
 block discarded – undo
353 353
 			$intents = array( $intents );
354 354
 		} else {
355 355
 			foreach ( $intents as $k => $intent ) {
356
-				if ( is_array( $intent ) && isset( $intent[ $k ] ) ) {
357
-					$intents[ $k ] = $intent[ $k ];
356
+				if ( is_array( $intent ) && isset( $intent[$k] ) ) {
357
+					$intents[$k] = $intent[$k];
358 358
 				}
359 359
 			}
360 360
 		}
@@ -402,12 +402,12 @@  discard block
 block discarded – undo
402 402
 				continue;
403 403
 			}
404 404
 
405
-			$saved     = FrmStrpLiteAppHelper::call_stripe_helper_class( 'get_intent', $intent_id );
405
+			$saved = FrmStrpLiteAppHelper::call_stripe_helper_class( 'get_intent', $intent_id );
406 406
 			foreach ( $actions as $action ) {
407 407
 				if ( $saved->metadata->action != $action->ID ) {
408 408
 					continue;
409 409
 				}
410
-				$intents[ $k ] = array(
410
+				$intents[$k] = array(
411 411
 					'id'     => $intent,
412 412
 					'action' => $action->ID,
413 413
 				);
@@ -450,7 +450,7 @@  discard block
 block discarded – undo
450 450
 			if ( $k === 'item_meta' ) {
451 451
 				foreach ( $v as $f => $value ) {
452 452
 					FrmAppHelper::sanitize_value( 'wp_kses_post', $value );
453
-					$entry->metas[ absint( $f ) ] = $value;
453
+					$entry->metas[absint( $f )] = $value;
454 454
 				}
455 455
 			} else {
456 456
 				FrmAppHelper::sanitize_value( 'wp_kses_post', $v );
@@ -474,14 +474,14 @@  discard block
 block discarded – undo
474 474
 
475 475
 		foreach ( $form as $input ) {
476 476
 			$key = $input['name'];
477
-			if ( isset( $formatted[ $key ] ) ) {
478
-				if ( is_array( $formatted[ $key ] ) ) {
479
-					$formatted[ $key ][] = $input['value'];
477
+			if ( isset( $formatted[$key] ) ) {
478
+				if ( is_array( $formatted[$key] ) ) {
479
+					$formatted[$key][] = $input['value'];
480 480
 				} else {
481
-					$formatted[ $key ] = array( $formatted[ $key ], $input['value'] );
481
+					$formatted[$key] = array( $formatted[$key], $input['value'] );
482 482
 				}
483 483
 			} else {
484
-				$formatted[ $key ] = $input['value'];
484
+				$formatted[$key] = $input['value'];
485 485
 			}
486 486
 		}
487 487
 
@@ -609,7 +609,7 @@  discard block
 block discarded – undo
609 609
 
610 610
 		foreach ( $actions as $k => $action ) {
611 611
 			$amount = self::get_amount_before_submit( compact( 'action', 'form' ) );
612
-			$actions[ $k ]->post_content['amount'] = $amount;
612
+			$actions[$k]->post_content['amount'] = $amount;
613 613
 		}
614 614
 	}
615 615
 
Please login to merge, or discard this patch.
classes/controllers/FrmOverlayController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 	private function update_next_execution_time() {
86 86
 		$config_option_name = $this->config['config-option-name'];
87 87
 
88
-		$this->options_data[ $config_option_name ] = $this->get_next_execution();
88
+		$this->options_data[$config_option_name] = $this->get_next_execution();
89 89
 		$this->update_options_data();
90 90
 	}
91 91
 
@@ -104,11 +104,11 @@  discard block
 block discarded – undo
104 104
 	 * @return boolean
105 105
 	 */
106 106
 	private function is_time_to_execute() {
107
-		if ( ! isset( $this->options_data[ $this->config['config-option-name'] ] ) ) {
107
+		if ( ! isset( $this->options_data[$this->config['config-option-name']] ) ) {
108 108
 			return true;
109 109
 		}
110 110
 
111
-		$options = $this->options_data[ $this->config['config-option-name'] ];
111
+		$options = $this->options_data[$this->config['config-option-name']];
112 112
 
113 113
 		return ! ( isset( $options['timestamp'] ) && (int) $options['timestamp'] > $this->get_time() );
114 114
 	}
Please login to merge, or discard this patch.