Completed
Pull Request — master (#2509)
by
unknown
41s
created
stripe/helpers/FrmStrpLiteUrlParamHelper.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -26,10 +26,10 @@  discard block
 block discarded – undo
26 26
 	 * @return array|false
27 27
 	 */
28 28
 	public static function get_details_for_form( $form_id ) {
29
-		if ( ! isset( self::$details_by_form_id[ $form_id ] ) ) {
29
+		if ( ! isset( self::$details_by_form_id[$form_id] ) ) {
30 30
 			self::set_details_for_form( (int) $form_id );
31 31
 		}
32
-		return self::$details_by_form_id[ $form_id ] ?? false;
32
+		return self::$details_by_form_id[$form_id] ?? false;
33 33
 	}
34 34
 
35 35
 	/**
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 			return;
91 91
 		}
92 92
 
93
-		self::$details_by_form_id[ $form_id ] = array(
93
+		self::$details_by_form_id[$form_id] = array(
94 94
 			'entry'   => $entry,
95 95
 			'intent'  => $intent,
96 96
 			'payment' => $payment,
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 $statuses[ $status ] ?? $status;
69
+		return $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    = $settings[ $option ] ?? '';
155
+		$value    = $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.
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    = $wp_plugins[ $folder ] ?? array();
550
+			$wp_plugin    = $wp_plugins[$folder] ?? array();
553 551
 			$wp_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 = $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/views/frm-form-actions/_action_inside.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@
 block discarded – undo
43 43
 	$event_labels = FrmFormAction::trigger_labels();
44 44
 	foreach ( $action_control->action_options['event'] as $event ) {
45 45
 		?>
46
-		<option value="<?php echo esc_attr( $event ); ?>" <?php echo in_array( $event, (array) $form_action->post_content['event'] ) ? ' selected="selected"' : ''; ?> ><?php echo esc_html( $event_labels[ $event ] ?? $event ); ?></option>
46
+		<option value="<?php echo esc_attr( $event ); ?>" <?php echo in_array( $event, (array) $form_action->post_content['event'] ) ? ' selected="selected"' : ''; ?> ><?php echo esc_html( $event_labels[$event] ?? $event ); ?></option>
47 47
 <?php } ?>
48 48
 		</select>
49 49
 	</p>
Please login to merge, or discard this patch.
classes/views/frm-fields/back-end/combo-field/sub-field-options.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -40,14 +40,14 @@  discard block
 block discarded – undo
40 40
 				?>
41 41
 				<p class="frm6 frm_form_field">
42 42
 					<label class="frm_description" for="<?php echo esc_attr( $input_id ); ?>">
43
-						<?php echo esc_html( $labels[ $option ] ); ?>
43
+						<?php echo esc_html( $labels[$option] ); ?>
44 44
 					</label>
45 45
 					<span class="frm-with-right-icon">
46 46
 						<input
47 47
 							type="text"
48 48
 							name="<?php echo esc_attr( $input_name ); ?>"
49 49
 							id="<?php echo esc_attr( $input_id ); ?>"
50
-							value="<?php echo esc_attr( $default_value[ $sub_field['name'] ] ?? '' ); ?>"
50
+							value="<?php echo esc_attr( $default_value[$sub_field['name']] ?? '' ); ?>"
51 51
 							data-changeme="field_<?php echo esc_attr( $field_key . '_' . $sub_field['name'] ); ?>"
52 52
 							data-changeatt="value"
53 53
 						/>
@@ -73,13 +73,13 @@  discard block
 block discarded – undo
73 73
 				?>
74 74
 				<p class="frm6 frm_form_field">
75 75
 					<label class="frm_description" for="<?php echo esc_attr( $input_id ); ?>">
76
-						<?php echo esc_html( $labels[ $option ] ); ?>
76
+						<?php echo esc_html( $labels[$option] ); ?>
77 77
 					</label>
78 78
 					<input
79 79
 						type="text"
80 80
 						name="<?php echo esc_attr( $input_name ); ?>"
81 81
 						id="<?php echo esc_attr( $input_id ); ?>"
82
-						value="<?php echo esc_attr( $input_value[ $sub_field['name'] ] ?? '' ); ?>"
82
+						value="<?php echo esc_attr( $input_value[$sub_field['name']] ?? '' ); ?>"
83 83
 						data-changeme="field_<?php echo esc_attr( $field_key . '_' . $sub_field['name'] ); ?>"
84 84
 						data-changeatt="<?php echo esc_attr( $option ); ?>"
85 85
 					/>
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 				?>
96 96
 				<p class="frm_form_field frm-flex-col">
97 97
 					<label class="frm_description" for="<?php echo esc_attr( $input_id ); ?>">
98
-						<?php echo esc_html( $labels[ $option ] ); ?>
98
+						<?php echo esc_html( $labels[$option] ); ?>
99 99
 					</label>
100 100
 					<textarea
101 101
 						name="<?php echo esc_attr( $input_name ); ?>"
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
 			?>
@@ -60,11 +60,11 @@  discard block
 block discarded – undo
60 60
 						$attrs = array(
61 61
 							'type'  => $sub_field['type'],
62 62
 							'id'    => $html_id . '_' . $name,
63
-							'value' => $field_value[ $name ] ?? '',
63
+							'value' => $field_value[$name] ?? '',
64 64
 						);
65 65
 
66
-						if ( ! empty( $field_value[ $name ] ) ) {
67
-							$attrs['data-frmval'] = $field_value[ $name ];
66
+						if ( ! empty( $field_value[$name] ) ) {
67
+							$attrs['data-frmval'] = $field_value[$name];
68 68
 						}
69 69
 						if ( empty( $args['remove_names'] ) ) {
70 70
 							$attrs['name'] = $field_name . '[' . $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/views/solutions/_import.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 				$info['url'] = $xml;
12 12
 			}
13 13
 
14
-			$disabled = isset( $imported[ $info['form'] ] ) ? ' disabled' : '';
14
+			$disabled = isset( $imported[$info['form']] ) ? ' disabled' : '';
15 15
 			$url      = $info['url'] ?? '';
16 16
 			$value    = $importing === 'form' ? $info['form'] : $info['key'];
17 17
 			if ( ! isset( $info['img'] ) ) {
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 				continue;
22 22
 			}
23 23
 
24
-			$hide_views = $importing === 'view' && ( ( $selected && $info['form'] !== $selected ) || isset( $imported[ $info['form'] ] ) );
24
+			$hide_views = $importing === 'view' && ( ( $selected && $info['form'] !== $selected ) || isset( $imported[$info['form']] ) );
25 25
 			?>
26 26
 			<div class="frm_radio radio-inline radio frm_image_option<?php echo esc_attr( $importing === 'view' ? ' show_sub_opt show_' . $info['form'] : '' ); ?>" style="<?php echo esc_attr( $hide_views ? 'display:none' : '' ); ?>">
27 27
 				<?php if ( $importing === 'form' ) { ?>
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 							}
55 55
 
56 56
 							if ( $importing === 'form' && $disabled ) {
57
-								FrmAppHelper::kses_echo( FrmFormsHelper::edit_form_link( $imported[ $info['form'] ] ), array( 'a' ) );
57
+								FrmAppHelper::kses_echo( FrmFormsHelper::edit_form_link( $imported[$info['form']] ), array( 'a' ) );
58 58
 							} else {
59 59
 								echo esc_html( $info['name'] );
60 60
 							}
Please login to merge, or discard this patch.
classes/factories/FrmFieldFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -112,7 +112,7 @@
 block discarded – undo
112 112
 			FrmFieldGdprHelper::FIELD_TYPE => FrmFieldGdprHelper::get_gdpr_field_class( $field_type ),
113 113
 		);
114 114
 
115
-		$class = $type_classes[ $field_type ] ?? '';
115
+		$class = $type_classes[$field_type] ?? '';
116 116
 
117 117
 		return apply_filters( 'frm_get_field_type_class', $class, $field_type );
118 118
 	}
Please login to merge, or discard this patch.
classes/models/fields/FrmFieldUserID.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@
 block discarded – undo
58 58
 	protected function get_field_value( $args ) {
59 59
 		$user_ID      = get_current_user_id();
60 60
 		$user_ID      = ( $user_ID ? $user_ID : '' );
61
-		$posted_value = ( FrmAppHelper::is_admin() && $_POST && isset( $_POST['item_meta'][ $this->field['id'] ] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing
61
+		$posted_value = ( FrmAppHelper::is_admin() && $_POST && isset( $_POST['item_meta'][$this->field['id']] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing
62 62
 		$action       = ( $args['action'] ?? $args['form_action'] ?? '' );
63 63
 		$updating     = $action === 'update';
64 64
 		return is_numeric( $this->field['value'] ) || $posted_value || $updating ? $this->field['value'] : $user_ID;
Please login to merge, or discard this patch.