Completed
Pull Request — master (#1517)
by Stephanie
34s
created
stripe/models/FrmTransLitePayment.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -126,11 +126,11 @@
 block discarded – undo
126 126
 		foreach ( $payments as $payment ) {
127 127
 			list( $amount, $currency ) = FrmTransLiteAppHelper::get_amount_and_currency_from_payment( $payment );
128 128
 
129
-			if ( ! isset( $data[ $currency ] ) ) {
130
-				$data[ $currency ] = 0;
129
+			if ( ! isset( $data[$currency] ) ) {
130
+				$data[$currency] = 0;
131 131
 			}
132 132
 
133
-			$data[ $currency ] += floatval( $amount );
133
+			$data[$currency] += floatval( $amount );
134 134
 		}
135 135
 
136 136
 		return $data;
Please login to merge, or discard this patch.
classes/helpers/FrmEmailSummaryHelper.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -236,11 +236,11 @@  discard block
 block discarded – undo
236 236
 	 */
237 237
 	public static function get_last_sent_date( $type ) {
238 238
 		$options = self::get_options();
239
-		if ( empty( $options[ 'last_' . $type ] ) ) {
239
+		if ( empty( $options['last_' . $type] ) ) {
240 240
 			return false;
241 241
 		}
242 242
 
243
-		return $options[ 'last_' . $type ];
243
+		return $options['last_' . $type];
244 244
 	}
245 245
 
246 246
 	/**
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
 	public static function set_last_sent_date( $type, $value = null ) {
253 253
 		$options = self::get_options();
254 254
 
255
-		$options[ 'last_' . $type ] = null === $value ? self::get_date_from_today() : '';
255
+		$options['last_' . $type] = null === $value ? self::get_date_from_today() : '';
256 256
 		self::save_options( $options );
257 257
 	}
258 258
 
Please login to merge, or discard this patch.
classes/models/FrmAddon.php 2 patches
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 	}
43 43
 
44 44
 	public function insert_installed_addon( $plugins ) {
45
-		$plugins[ $this->plugin_slug ] = $this;
45
+		$plugins[$this->plugin_slug] = $this;
46 46
 
47 47
 		return $plugins;
48 48
 	}
@@ -50,8 +50,8 @@  discard block
 block discarded – undo
50 50
 	public static function get_addon( $plugin_slug ) {
51 51
 		$plugins = apply_filters( 'frm_installed_addons', array() );
52 52
 		$plugin  = false;
53
-		if ( isset( $plugins[ $plugin_slug ] ) ) {
54
-			$plugin = $plugins[ $plugin_slug ];
53
+		if ( isset( $plugins[$plugin_slug] ) ) {
54
+			$plugin = $plugins[$plugin_slug];
55 55
 		}
56 56
 
57 57
 		return $plugin;
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 		} else {
112 112
 			$api     = new FrmFormApi( $this->license );
113 113
 			$plugins = $api->get_api_info();
114
-			$_data   = $plugins[ $item_id ];
114
+			$_data   = $plugins[$item_id];
115 115
 		}
116 116
 
117 117
 		$_data['sections'] = array(
@@ -340,19 +340,19 @@  discard block
 block discarded – undo
340 340
 
341 341
 		if ( $this->is_current_version( $transient ) ) {
342 342
 			// Make sure it doesn't show there is an update if plugin is up-to-date.
343
-			if ( isset( $transient->response[ $this->plugin_folder ] ) ) {
344
-				unset( $transient->response[ $this->plugin_folder ] );
343
+			if ( isset( $transient->response[$this->plugin_folder] ) ) {
344
+				unset( $transient->response[$this->plugin_folder] );
345 345
 			}
346
-		} elseif ( isset( $transient->response ) && isset( $transient->response[ $this->plugin_folder ] ) ) {
347
-			$this->prepare_update_details( $transient->response[ $this->plugin_folder ] );
346
+		} elseif ( isset( $transient->response ) && isset( $transient->response[$this->plugin_folder] ) ) {
347
+			$this->prepare_update_details( $transient->response[$this->plugin_folder] );
348 348
 
349 349
 			// if the transient has expired, clear the update and trigger it again
350
-			if ( $transient->response[ $this->plugin_folder ] === false ) {
350
+			if ( $transient->response[$this->plugin_folder] === false ) {
351 351
 				if ( ! $this->has_been_cleared() ) {
352 352
 					$this->cleared_plugins();
353 353
 					$this->manually_queue_update();
354 354
 				}
355
-				unset( $transient->response[ $this->plugin_folder ] );
355
+				unset( $transient->response[$this->plugin_folder] );
356 356
 			}
357 357
 		}
358 358
 
@@ -440,7 +440,7 @@  discard block
 block discarded – undo
440 440
 	}
441 441
 
442 442
 	private function is_current_version( $transient ) {
443
-		if ( empty( $transient->checked ) || ! isset( $transient->checked[ $this->plugin_folder ] ) ) {
443
+		if ( empty( $transient->checked ) || ! isset( $transient->checked[$this->plugin_folder] ) ) {
444 444
 			return false;
445 445
 		}
446 446
 
@@ -449,7 +449,7 @@  discard block
 block discarded – undo
449 449
 			return true;
450 450
 		}
451 451
 
452
-		return isset( $transient->response ) && isset( $transient->response[ $this->plugin_folder ] ) && $transient->checked[ $this->plugin_folder ] === $transient->response[ $this->plugin_folder ]->new_version;
452
+		return isset( $transient->response ) && isset( $transient->response[$this->plugin_folder] ) && $transient->checked[$this->plugin_folder] === $transient->response[$this->plugin_folder]->new_version;
453 453
 	}
454 454
 
455 455
 	private function has_been_cleared() {
@@ -564,8 +564,8 @@  discard block
 block discarded – undo
564 564
 			$response['message'] = $response['status'];
565 565
 		} else {
566 566
 			$messages = $this->get_messages();
567
-			if ( is_string( $response['status'] ) && isset( $messages[ $response['status'] ] ) ) {
568
-				$response['message'] = $messages[ $response['status'] ];
567
+			if ( is_string( $response['status'] ) && isset( $messages[$response['status']] ) ) {
568
+				$response['message'] = $messages[$response['status']];
569 569
 			} else {
570 570
 				$response['message'] = FrmAppHelper::kses( $response['status'], array( 'a' ) );
571 571
 			}
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -465,7 +465,8 @@
 block discarded – undo
465 465
 	}
466 466
 
467 467
 	private function is_license_revoked() {
468
-		if ( empty( $this->license ) || empty( $this->plugin_slug ) || isset( $_POST['license'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
468
+		if ( empty( $this->license ) || empty( $this->plugin_slug ) || isset( $_POST['license'] ) ) {
469
+// phpcs:ignore WordPress.Security.NonceVerification.Missing
469 470
 			return;
470 471
 		}
471 472
 
Please login to merge, or discard this patch.
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/xml/xml.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -18,17 +18,17 @@  discard block
 block discarded – undo
18 18
 
19 19
 foreach ( $type as $tb_type ) {
20 20
 
21
-	if ( ! isset( $tables[ $tb_type ] ) ) {
21
+	if ( ! isset( $tables[$tb_type] ) ) {
22 22
 		do_action( 'frm_xml_import_' . $tb_type, $args );
23 23
 		continue;
24 24
 	}
25 25
 
26
-	if ( ! isset( $records[ $tb_type ] ) ) {
26
+	if ( ! isset( $records[$tb_type] ) ) {
27 27
 		// No records.
28 28
 		continue;
29 29
 	}
30 30
 
31
-	$item_ids = $records[ $tb_type ];
31
+	$item_ids = $records[$tb_type];
32 32
 
33 33
 	if ( in_array( $tb_type, array( 'styles', 'actions' ), true ) ) {
34 34
 		include dirname( __FILE__ ) . '/posts_xml.php';
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 		include FrmProAppHelper::plugin_path() . '/classes/views/xml/' . $tb_type . '_xml.php';
39 39
 	}
40 40
 
41
-	unset( $item_ids, $records[ $tb_type ], $tb_type );
41
+	unset( $item_ids, $records[$tb_type], $tb_type );
42 42
 }//end foreach
43 43
 
44 44
 /**
Please login to merge, or discard this patch.
classes/views/frm-fields/front-end/checkbox-field.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -87,6 +87,6 @@
 block discarded – undo
87 87
 
88 88
 		?></div>
89 89
 <?php
90
-		++$option_index;
90
+		++ $option_index;
91 91
 	}//end foreach
92 92
 }//end if
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
 			?>
@@ -61,10 +61,10 @@  discard block
 block discarded – undo
61 61
 						<input
62 62
 							type="<?php echo esc_attr( $sub_field['type'] ); ?>"
63 63
 							id="<?php echo esc_attr( $html_id . '_' . $name ); ?>"
64
-							value="<?php echo esc_attr( isset( $field_value[ $name ] ) ? $field_value[ $name ] : '' ); ?>"
64
+							value="<?php echo esc_attr( isset( $field_value[$name] ) ? $field_value[$name] : '' ); ?>"
65 65
 							<?php
66
-							if ( ! empty( $field_value[ $name ] ) ) {
67
-								echo 'data-frmval="' . esc_attr( $field_value[ $name ] ) . '" ';
66
+							if ( ! empty( $field_value[$name] ) ) {
67
+								echo 'data-frmval="' . esc_attr( $field_value[$name] ) . '" ';
68 68
 							}
69 69
 							if ( empty( $args['remove_names'] ) ) {
70 70
 								echo 'name="' . esc_attr( $field_name ) . '[' . esc_attr( $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.
classes/controllers/FrmAddonsController.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 		} else {
102 102
 			foreach ( $addons as $k => $addon ) {
103 103
 				if ( empty( $addon['excerpt'] ) && $k !== 'error' ) {
104
-					unset( $addons[ $k ] );
104
+					unset( $addons[$k] );
105 105
 				}
106 106
 			}
107 107
 		}
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
 
203 203
 		foreach ( $list as $k => $info ) {
204 204
 			$info['slug'] = $k;
205
-			$list[ $k ]   = array_merge( $defaults, $info );
205
+			$list[$k]   = array_merge( $defaults, $info );
206 206
 		}
207 207
 		return $list;
208 208
 	}
@@ -353,17 +353,17 @@  discard block
 block discarded – undo
353 353
 				continue;
354 354
 			}
355 355
 
356
-			$wp_plugin    = isset( $wp_plugins[ $folder ] ) ? $wp_plugins[ $folder ] : array();
356
+			$wp_plugin    = isset( $wp_plugins[$folder] ) ? $wp_plugins[$folder] : array();
357 357
 			$wp_version   = isset( $wp_plugin['Version'] ) ? $wp_plugin['Version'] : '1.0';
358 358
 			$plugin->slug = explode( '/', $folder )[0];
359 359
 
360 360
 			if ( version_compare( $wp_version, $plugin->new_version, '<' ) ) {
361
-				$transient->response[ $folder ] = $plugin;
361
+				$transient->response[$folder] = $plugin;
362 362
 			} else {
363
-				$transient->no_update[ $folder ] = $plugin;
363
+				$transient->no_update[$folder] = $plugin;
364 364
 			}
365 365
 
366
-			$transient->checked[ $folder ] = $wp_version;
366
+			$transient->checked[$folder] = $wp_version;
367 367
 
368 368
 		}//end foreach
369 369
 
@@ -396,7 +396,7 @@  discard block
 block discarded – undo
396 396
 	 */
397 397
 	protected static function is_installed( $plugin ) {
398 398
 		$all_plugins = self::get_plugins();
399
-		return isset( $all_plugins[ $plugin ] );
399
+		return isset( $all_plugins[$plugin] );
400 400
 	}
401 401
 
402 402
 	/**
@@ -435,13 +435,13 @@  discard block
 block discarded – undo
435 435
 			}
436 436
 
437 437
 			$download_id = isset( $plugin['id'] ) ? $plugin['id'] : 0;
438
-			if ( ! empty( $download_id ) && ! isset( $version_info[ $download_id ]['package'] ) ) {
438
+			if ( ! empty( $download_id ) && ! isset( $version_info[$download_id]['package'] ) ) {
439 439
 				// if this addon is using its own license, get the update url
440 440
 				$addon_info = $api->get_api_info();
441 441
 
442
-				$version_info[ $download_id ] = $addon_info[ $download_id ];
442
+				$version_info[$download_id] = $addon_info[$download_id];
443 443
 				if ( isset( $addon_info['error'] ) ) {
444
-					$version_info[ $download_id ]['error'] = array(
444
+					$version_info[$download_id]['error'] = array(
445 445
 						'message' => $addon_info['error']['message'],
446 446
 						'code'    => $addon_info['error']['code'],
447 447
 					);
@@ -540,8 +540,8 @@  discard block
 block discarded – undo
540 540
 					return $addon;
541 541
 				}
542 542
 			}
543
-		} elseif ( isset( $addons[ $download_id ] ) ) {
544
-			$plugin = $addons[ $download_id ];
543
+		} elseif ( isset( $addons[$download_id] ) ) {
544
+			$plugin = $addons[$download_id];
545 545
 		}
546 546
 
547 547
 		return $plugin;
@@ -605,7 +605,7 @@  discard block
 block discarded – undo
605 605
 			self::prepare_addon_link( $addon['link'] );
606 606
 
607 607
 			self::set_addon_status( $addon );
608
-			$addons[ $id ] = $addon;
608
+			$addons[$id] = $addon;
609 609
 		}//end foreach
610 610
 	}
611 611
 
@@ -646,7 +646,7 @@  discard block
 block discarded – undo
646 646
 			'utm_medium'   => 'addons',
647 647
 			'utm_campaign' => 'liteplugin',
648 648
 		);
649
-		$link       = add_query_arg( $query_args, $link );
649
+		$link = add_query_arg( $query_args, $link );
650 650
 	}
651 651
 
652 652
 	/**
@@ -1389,7 +1389,7 @@  discard block
 block discarded – undo
1389 1389
 		$addons = $api->get_api_info();
1390 1390
 
1391 1391
 		if ( is_array( $addons ) && array_key_exists( $addon_id, $addons ) ) {
1392
-			$dates    = $addons[ $addon_id ];
1392
+			$dates    = $addons[$addon_id];
1393 1393
 			$requires = FrmFormsHelper::get_plan_required( $dates );
1394 1394
 		}
1395 1395
 
Please login to merge, or discard this patch.
classes/controllers/FrmFormActionsController.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -108,19 +108,19 @@  discard block
 block discarded – undo
108 108
 		}
109 109
 
110 110
 		foreach ( $action_controls as $action ) {
111
-			if ( isset( $groups[ $action->id_base ] ) || in_array( $action->id_base, $grouped ) ) {
111
+			if ( isset( $groups[$action->id_base] ) || in_array( $action->id_base, $grouped ) ) {
112 112
 				continue;
113 113
 			}
114 114
 
115 115
 			$this_group = $action->action_options['group'];
116
-			if ( ! isset( $groups[ $this_group ] ) ) {
116
+			if ( ! isset( $groups[$this_group] ) ) {
117 117
 				$this_group = 'misc';
118 118
 			}
119 119
 
120
-			if ( ! isset( $groups[ $this_group ]['actions'] ) ) {
121
-				$groups[ $this_group ]['actions'] = array();
120
+			if ( ! isset( $groups[$this_group]['actions'] ) ) {
121
+				$groups[$this_group]['actions'] = array();
122 122
 			}
123
-			$groups[ $this_group ]['actions'][] = $action->id_base;
123
+			$groups[$this_group]['actions'][] = $action->id_base;
124 124
 
125 125
 			unset( $action );
126 126
 		}
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
 				return $a;
271 271
 			}
272 272
 
273
-			$actions[ $a->id_base ] = $a;
273
+			$actions[$a->id_base] = $a;
274 274
 		}
275 275
 
276 276
 		return $actions;
@@ -301,16 +301,16 @@  discard block
 block discarded – undo
301 301
 		$action_map = array();
302 302
 
303 303
 		foreach ( $action_controls as $key => $control ) {
304
-			$action_map[ $control->id_base ] = $key;
304
+			$action_map[$control->id_base] = $key;
305 305
 		}
306 306
 
307 307
 		foreach ( $form_actions as $action ) {
308
-			if ( ! isset( $action_map[ $action->post_excerpt ] ) ) {
308
+			if ( ! isset( $action_map[$action->post_excerpt] ) ) {
309 309
 				// don't try and show settings if action no longer exists
310 310
 				continue;
311 311
 			}
312 312
 
313
-			self::action_control( $action, $form, $action->ID, $action_controls[ $action_map[ $action->post_excerpt ] ], $values );
313
+			self::action_control( $action, $form, $action->ID, $action_controls[$action_map[$action->post_excerpt]], $values );
314 314
 		}
315 315
 	}
316 316
 
@@ -539,8 +539,8 @@  discard block
 block discarded – undo
539 539
 			}
540 540
 
541 541
 			// Store actions so they can be triggered with the correct priority.
542
-			$stored_actions[ $action->ID ]  = $action;
543
-			$action_priority[ $action->ID ] = $link_settings[ $action->post_excerpt ]->action_options['priority'];
542
+			$stored_actions[$action->ID]  = $action;
543
+			$action_priority[$action->ID] = $link_settings[$action->post_excerpt]->action_options['priority'];
544 544
 
545 545
 			unset( $action );
546 546
 		}//end foreach
@@ -552,7 +552,7 @@  discard block
 block discarded – undo
552 552
 			new FrmNotification();
553 553
 
554 554
 			foreach ( $action_priority as $action_id => $priority ) {
555
-				$action = $stored_actions[ $action_id ];
555
+				$action = $stored_actions[$action_id];
556 556
 				do_action( 'frm_trigger_' . $action->post_excerpt . '_action', $action, $entry, $form, $event );
557 557
 				do_action( 'frm_trigger_' . $action->post_excerpt . '_' . $event . '_action', $action, $entry, $form );
558 558
 
@@ -599,12 +599,12 @@  discard block
 block discarded – undo
599 599
 	}
600 600
 
601 601
 	public function register( $action_class ) {
602
-		$this->actions[ $action_class ] = new $action_class();
602
+		$this->actions[$action_class] = new $action_class();
603 603
 	}
604 604
 
605 605
 	public function unregister( $action_class ) {
606
-		if ( isset( $this->actions[ $action_class ] ) ) {
607
-			unset( $this->actions[ $action_class ] );
606
+		if ( isset( $this->actions[$action_class] ) ) {
607
+			unset( $this->actions[$action_class] );
608 608
 		}
609 609
 	}
610 610
 
@@ -613,8 +613,8 @@  discard block
 block discarded – undo
613 613
 
614 614
 		foreach ( $keys as $key ) {
615 615
 			// don't register new action if old action with the same id is already registered
616
-			if ( ! isset( $this->actions[ $key ] ) ) {
617
-				$this->actions[ $key ]->_register();
616
+			if ( ! isset( $this->actions[$key] ) ) {
617
+				$this->actions[$key]->_register();
618 618
 			}
619 619
 		}
620 620
 	}
Please login to merge, or discard this patch.