Completed
Pull Request — master (#2229)
by
unknown
45s
created
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    = isset( $wp_plugins[ $folder ] ) ? $wp_plugins[ $folder ] : array();
550
+			$wp_plugin    = isset( $wp_plugins[$folder] ) ? $wp_plugins[$folder] : array();
553 551
 			$wp_version   = isset( $wp_plugin['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 = isset( $plugin['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/models/FrmSalesApi.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 			return;
90 90
 		}
91 91
 
92
-		self::$sales[ $sale['key'] ] = $this->fill_sale( $sale );
92
+		self::$sales[$sale['key']] = $this->fill_sale( $sale );
93 93
 	}
94 94
 
95 95
 	/**
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 
188 188
 		$sale = self::$instance->get_best_sale();
189 189
 
190
-		return is_array( $sale ) && ! empty( $sale[ $key ] ) ? $sale[ $key ] : false;
190
+		return is_array( $sale ) && ! empty( $sale[$key] ) ? $sale[$key] : false;
191 191
 	}
192 192
 
193 193
 	/**
Please login to merge, or discard this patch.
stripe/controllers/FrmTransLiteHooksController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
 	public static function load_admin_hooks() {
37 37
 		add_action(
38 38
 			'admin_init',
39
-			function () {
39
+			function() {
40 40
 				self::fix_addon_hooks();
41 41
 			}
42 42
 		);
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
@@ -223,8 +223,8 @@  discard block
 block discarded – undo
223 223
 		}
224 224
 
225 225
 		foreach ( $settings as $setting => $default ) {
226
-			if ( isset( $params[ 'frm_' . $setting ] ) ) {
227
-				$this->{$setting} = $params[ 'frm_' . $setting ];
226
+			if ( isset( $params['frm_' . $setting] ) ) {
227
+				$this->{$setting} = $params['frm_' . $setting];
228 228
 			} elseif ( ! isset( $this->{$setting} ) ) {
229 229
 				$this->{$setting} = $default;
230 230
 			}
@@ -402,7 +402,7 @@  discard block
 block discarded – undo
402 402
 
403 403
 		$checkboxes = array( 'mu_menu', 're_multi', 'fade_form', 'no_ips', 'no_gdpr_cookies', 'enable_gdpr', 'custom_header_ip', 'tracking', 'admin_bar', 'summary_emails' );
404 404
 		foreach ( $checkboxes as $set ) {
405
-			$this->$set = isset( $params[ 'frm_' . $set ] ) ? absint( $params[ 'frm_' . $set ] ) : 0;
405
+			$this->$set = isset( $params['frm_' . $set] ) ? absint( $params['frm_' . $set] ) : 0;
406 406
 		}
407 407
 	}
408 408
 
@@ -415,7 +415,7 @@  discard block
 block discarded – undo
415 415
 		$frm_roles = FrmAppHelper::frm_capabilities();
416 416
 		$roles     = get_editable_roles();
417 417
 		foreach ( $frm_roles as $frm_role => $frm_role_description ) {
418
-			$this->$frm_role = (array) ( isset( $params[ $frm_role ] ) ? $params[ $frm_role ] : 'administrator' );
418
+			$this->$frm_role = (array) ( isset( $params[$frm_role] ) ? $params[$frm_role] : 'administrator' );
419 419
 
420 420
 			// Make sure administrators always have permissions
421 421
 			if ( ! in_array( 'administrator', $this->$frm_role, true ) ) {
Please login to merge, or discard this patch.
classes/helpers/FrmApiHelper.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -127,7 +127,7 @@
 block discarded – undo
127 127
 	 * @return bool
128 128
 	 */
129 129
 	private static function check_free_segments( $who ) {
130
-		$segments          = array(
130
+		$segments = array(
131 131
 			'free_first_1',
132 132
 			'free_first_2_3',
133 133
 			'free_first_4_7',
Please login to merge, or discard this patch.
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.
square/controllers/FrmSquareLiteHooksController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
17 17
 		// This filter flags the Pro credit card field that Stripe is enabled.
18 18
 		add_filter(
19 19
 			'frm_pro_show_card_callback',
20
-			function () {
20
+			function() {
21 21
 				return 'FrmSquareLiteActionsController::show_card';
22 22
 			}
23 23
 		);
Please login to merge, or discard this patch.
square/controllers/FrmSquareLiteActionsController.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 			$gateway   = $payment_action->post_content['gateway'];
43 43
 			$is_square = $gateway === 'square' || ( is_array( $gateway ) && in_array( 'square', $gateway, true ) );
44 44
 			if ( ! $is_square || empty( $payment_action->post_content['amount'] ) ) {
45
-				unset( $payment_actions[ $k ] );
45
+				unset( $payment_actions[$k] );
46 46
 			}
47 47
 		}
48 48
 		return $payment_actions;
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 			'run_triggers' => false,
64 64
 			'show_errors'  => true,
65 65
 		);
66
-		$atts     = compact( 'action', 'entry', 'form' );
66
+		$atts = compact( 'action', 'entry', 'form' );
67 67
 
68 68
 		$amount = self::prepare_amount( $action->post_content['amount'], $atts );
69 69
 		if ( empty( $amount ) || $amount == 000 ) {
@@ -401,18 +401,18 @@  discard block
 block discarded – undo
401 401
 	 * @return array
402 402
 	 */
403 403
 	public static function remove_cc_validation( $errors, $field, $values ) {
404
-		$has_processed = isset( $_POST[ 'frmintent' . $field->form_id ] ); // phpcs:ignore WordPress.Security.NonceVerification.Missing
404
+		$has_processed = isset( $_POST['frmintent' . $field->form_id] ); // phpcs:ignore WordPress.Security.NonceVerification.Missing
405 405
 		if ( ! $has_processed ) {
406 406
 			return $errors;
407 407
 		}
408 408
 
409 409
 		$field_id = isset( $field->temp_id ) ? $field->temp_id : $field->id;
410 410
 
411
-		if ( isset( $errors[ 'field' . $field_id . '-cc' ] ) ) {
412
-			unset( $errors[ 'field' . $field_id . '-cc' ] );
411
+		if ( isset( $errors['field' . $field_id . '-cc'] ) ) {
412
+			unset( $errors['field' . $field_id . '-cc'] );
413 413
 		}
414
-		if ( isset( $errors[ 'field' . $field_id ] ) ) {
415
-			unset( $errors[ 'field' . $field_id ] );
414
+		if ( isset( $errors['field' . $field_id] ) ) {
415
+			unset( $errors['field' . $field_id] );
416 416
 		}
417 417
 
418 418
 		return $errors;
Please login to merge, or discard this patch.
classes/models/FrmUsage.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
 		);
127 127
 
128 128
 		foreach ( $skipped_keys as $skipped_key ) {
129
-			unset( $data[ $skipped_key ] );
129
+			unset( $data[$skipped_key] );
130 130
 		}
131 131
 
132 132
 		return $data;
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
 
223 223
 		foreach ( $pass_settings as $setting ) {
224 224
 			if ( isset( $settings_list->$setting ) ) {
225
-				$settings[ $setting ] = $this->maybe_json( $settings_list->$setting );
225
+				$settings[$setting] = $this->maybe_json( $settings_list->$setting );
226 226
 			}
227 227
 		}
228 228
 
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
 
259 259
 		$message_settings = array();
260 260
 		foreach ( $messages as $message ) {
261
-			$message_settings[ 'changed-' . $message ] = $settings_list->$message === $default[ $message ] ? 0 : 1;
261
+			$message_settings['changed-' . $message] = $settings_list->$message === $default[$message] ? 0 : 1;
262 262
 		}
263 263
 
264 264
 		return $message_settings;
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
 
279 279
 		foreach ( $frm_roles as $frm_role => $frm_role_description ) {
280 280
 			if ( isset( $settings_list->$frm_role ) ) {
281
-				$permissions[ $frm_role ] = $settings_list->$frm_role;
281
+				$permissions[$frm_role] = $settings_list->$frm_role;
282 282
 			}
283 283
 		}
284 284
 
@@ -349,9 +349,9 @@  discard block
 block discarded – undo
349 349
 			);
350 350
 
351 351
 			foreach ( $settings as $setting ) {
352
-				if ( isset( $form->options[ $setting ] ) ) {
352
+				if ( isset( $form->options[$setting] ) ) {
353 353
 					if ( 'custom_style' === $setting ) {
354
-						$style->id = $form->options[ $setting ];
354
+						$style->id = $form->options[$setting];
355 355
 
356 356
 						if ( ! $style->id ) {
357 357
 							$style_name = 0;
@@ -362,9 +362,9 @@  discard block
 block discarded – undo
362 362
 							$style_name = $style_post ? $style_post->post_name : 'formidable-style';
363 363
 						}
364 364
 
365
-						$new_form[ $setting ] = $style_name;
365
+						$new_form[$setting] = $style_name;
366 366
 					} else {
367
-						$new_form[ $setting ] = $this->maybe_json( $form->options[ $setting ] );
367
+						$new_form[$setting] = $this->maybe_json( $form->options[$setting] );
368 368
 					}
369 369
 				}
370 370
 			}
@@ -424,7 +424,7 @@  discard block
 block discarded – undo
424 424
 		$fields = FrmDb::get_results( 'frm_fields', array(), 'form_id, name, type, field_options', $args );
425 425
 		foreach ( $fields as $k => $field ) {
426 426
 			FrmAppHelper::unserialize_or_decode( $field->field_options );
427
-			$fields[ $k ]->field_options = json_encode( $field->field_options );
427
+			$fields[$k]->field_options = json_encode( $field->field_options );
428 428
 		}
429 429
 		return $fields;
430 430
 	}
Please login to merge, or discard this patch.