Completed
Pull Request — master (#2563)
by
unknown
42s
created
classes/helpers/FrmSubmitHelper.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 	public static function get_current_action_from_global_var( $form_id ) {
91 91
 		global $frm_vars;
92 92
 
93
-		return $frm_vars['form_params'][ $form_id ]['action'] ?? 'create';
93
+		return $frm_vars['form_params'][$form_id]['action'] ?? 'create';
94 94
 	}
95 95
 
96 96
 	/**
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
 	public static function remove_submit_field_from_list( &$fields ) {
190 190
 		foreach ( $fields as $key => $field ) {
191 191
 			if ( self::FIELD_TYPE === FrmField::get_field_type( $field ) ) {
192
-				unset( $fields[ $key ] );
192
+				unset( $fields[$key] );
193 193
 				return;
194 194
 			}
195 195
 		}
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
 			);
246 246
 
247 247
 			if ( false !== $updated ) {
248
-				self::$last_row_fields_order[ $last_row_field_id ] = $new_order;
248
+				self::$last_row_fields_order[$last_row_field_id] = $new_order;
249 249
 			}
250 250
 		}
251 251
 	}
Please login to merge, or discard this patch.
classes/helpers/FrmDashboardHelper.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -90,8 +90,8 @@  discard block
 block discarded – undo
90 90
 		$sections = array( 'counters', 'license', 'get_free_templates', 'payments', 'entries', 'inbox', 'video', 'payments' );
91 91
 
92 92
 		foreach ( $sections as $section ) {
93
-			if ( isset( $data[ $section ] ) ) {
94
-				$this->view[ $section ] = $data[ $section ];
93
+			if ( isset( $data[$section] ) ) {
94
+				$this->view[$section] = $data[$section];
95 95
 			}
96 96
 		}
97 97
 	}
@@ -371,7 +371,7 @@  discard block
 block discarded – undo
371 371
 	private static function load_entries_list_template( $template ) {
372 372
 		add_filter(
373 373
 			'formidable_page_formidable_entries_per_page',
374
-			function () {
374
+			function() {
375 375
 				return 7;
376 376
 			}
377 377
 		);
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
@@ -254,11 +254,11 @@  discard block
 block discarded – undo
254 254
 	public static function get_last_sent_date( $type ) {
255 255
 		$options = self::get_options();
256 256
 
257
-		if ( empty( $options[ 'last_' . $type ] ) ) {
257
+		if ( empty( $options['last_' . $type] ) ) {
258 258
 			return false;
259 259
 		}
260 260
 
261
-		return $options[ 'last_' . $type ];
261
+		return $options['last_' . $type];
262 262
 	}
263 263
 
264 264
 	/**
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
 	public static function set_last_sent_date( $type, $value = null ) {
273 273
 		$options = self::get_options();
274 274
 
275
-		$options[ 'last_' . $type ] = null === $value ? self::get_date_from_today() : '';
275
+		$options['last_' . $type] = null === $value ? self::get_date_from_today() : '';
276 276
 		self::save_options( $options );
277 277
 	}
278 278
 
Please login to merge, or discard this patch.
classes/helpers/FrmCurrencyHelper.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -18,10 +18,10 @@
 block discarded – undo
18 18
 		$currency   = strtoupper( $currency );
19 19
 		$currencies = self::get_currencies();
20 20
 
21
-		if ( isset( $currencies[ $currency ] ) ) {
22
-			$currency = $currencies[ $currency ];
23
-		} elseif ( isset( $currencies[ strtolower( $currency ) ] ) ) {
24
-			$currency = $currencies[ strtolower( $currency ) ];
21
+		if ( isset( $currencies[$currency] ) ) {
22
+			$currency = $currencies[$currency];
23
+		} elseif ( isset( $currencies[strtolower( $currency )] ) ) {
24
+			$currency = $currencies[strtolower( $currency )];
25 25
 		} else {
26 26
 			$currency = $currencies['USD'];
27 27
 		}
Please login to merge, or discard this patch.
classes/helpers/FrmSerializedStringParserHelper.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -134,12 +134,12 @@
 block discarded – undo
134 134
 
135 135
 		$val = array();
136 136
 
137
-		for ( $i = 0; $i < $count; $i++ ) {
137
+		for ( $i = 0; $i < $count; $i ++ ) {
138 138
 			$array_key   = $this->do_parse( $string );
139 139
 			$array_value = $this->do_parse( $string );
140 140
 
141 141
 			if ( ! is_array( $array_key ) ) {
142
-				$val[ $array_key ] = $array_value;
142
+				$val[$array_key] = $array_value;
143 143
 			}
144 144
 		}
145 145
 
Please login to merge, or discard this patch.
classes/helpers/FrmShortcodeHelper.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 		$result                = array();
78 78
 
79 79
 		foreach ( $contextual_shortcodes as $type => $shortcodes ) {
80
-			$result[ $type ] = array_keys( $shortcodes );
80
+			$result[$type] = array_keys( $shortcodes );
81 81
 		}
82 82
 		return $result;
83 83
 	}
@@ -119,8 +119,8 @@  discard block
 block discarded – undo
119 119
 
120 120
 		$with_tags = $args['conditional_check'] ? 3 : 2;
121 121
 
122
-		if ( ! empty( $shortcodes[ $with_tags ][ $short_key ] ) ) {
123
-			$tag  = str_replace( '[' . $prefix, '', $shortcodes[0][ $short_key ] );
122
+		if ( ! empty( $shortcodes[$with_tags][$short_key] ) ) {
123
+			$tag  = str_replace( '[' . $prefix, '', $shortcodes[0][$short_key] );
124 124
 			$tag  = str_replace( ']', '', $tag );
125 125
 			$tag  = str_replace( chr( 194 ) . chr( 160 ), ' ', $tag );
126 126
 			$tags = preg_split( '/\s+/', $tag, 2 );
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
 				$tag = $tags[0];
130 130
 			}
131 131
 		} else {
132
-			$tag = $shortcodes[ $with_tags - 1 ][ $short_key ];
132
+			$tag = $shortcodes[$with_tags - 1][$short_key];
133 133
 		}
134 134
 
135 135
 		return $tag;
Please login to merge, or discard this patch.
classes/helpers/FrmEntriesHelper.php 2 patches
Braces   +14 added lines, -7 removed lines patch added patch discarded remove patch
@@ -149,14 +149,17 @@  discard block
 block discarded – undo
149 149
 	public static function value_is_posted( $field, $args ) {
150 150
 		$value_is_posted = false;
151 151
 
152
-		if ( $_POST ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
152
+		if ( $_POST ) {
153
+// phpcs:ignore WordPress.Security.NonceVerification.Missing
153 154
 			$repeating = isset( $args['repeating'] ) && $args['repeating'];
154 155
 
155 156
 			if ( $repeating ) {
156
-				if ( isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
157
+				if ( isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field->id ] ) ) {
158
+// phpcs:ignore WordPress.Security.NonceVerification.Missing
157 159
 					$value_is_posted = true;
158 160
 				}
159
-			} elseif ( isset( $_POST['item_meta'][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
161
+			} elseif ( isset( $_POST['item_meta'][ $field->id ] ) ) {
162
+// phpcs:ignore WordPress.Security.NonceVerification.Missing
160 163
 				$value_is_posted = true;
161 164
 			}
162 165
 		}
@@ -405,8 +408,10 @@  discard block
 block discarded – undo
405 408
 	 * @return void
406 409
 	 */
407 410
 	private static function set_parent_field_posted_value( $field, $value, $args ) {
408
-		if ( isset( $_POST['item_meta'][ $args['parent_field_id'] ] ) && is_array( $_POST['item_meta'][ $args['parent_field_id'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
409
-			if ( ! isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] ) || ! is_array( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
411
+		if ( isset( $_POST['item_meta'][ $args['parent_field_id'] ] ) && is_array( $_POST['item_meta'][ $args['parent_field_id'] ] ) ) {
412
+// phpcs:ignore WordPress.Security.NonceVerification.Missing
413
+			if ( ! isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] ) || ! is_array( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] ) ) {
414
+// phpcs:ignore WordPress.Security.NonceVerification.Missing
410 415
 				$_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing
411 416
 			}
412 417
 		} else {
@@ -498,7 +503,8 @@  discard block
 block discarded – undo
498 503
 		self::set_other_repeating_vals( $field, $value, $args );
499 504
 
500 505
 		// Check if there are any posted "Other" values.
501
-		if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta']['other'][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
506
+		if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta']['other'][ $field->id ] ) ) {
507
+// phpcs:ignore WordPress.Security.NonceVerification.Missing
502 508
 
503 509
 			// Save original value.
504 510
 			$args['temp_value'] = $value;
@@ -530,7 +536,8 @@  discard block
 block discarded – undo
530 536
 		}
531 537
 
532 538
 		// Check if there are any other posted "other" values for this field.
533
-		if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ]['other'][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
539
+		if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ]['other'][ $field->id ] ) ) {
540
+// phpcs:ignore WordPress.Security.NonceVerification.Missing
534 541
 			// Save original value
535 542
 			$args['temp_value'] = $value;
536 543
 			$args['other']      = true;
Please login to merge, or discard this patch.
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -153,10 +153,10 @@  discard block
 block discarded – undo
153 153
 			$repeating = isset( $args['repeating'] ) && $args['repeating'];
154 154
 
155 155
 			if ( $repeating ) {
156
-				if ( isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
156
+				if ( isset( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']][$field->id] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
157 157
 					$value_is_posted = true;
158 158
 				}
159
-			} elseif ( isset( $_POST['item_meta'][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
159
+			} elseif ( isset( $_POST['item_meta'][$field->id] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
160 160
 				$value_is_posted = true;
161 161
 			}
162 162
 		}
@@ -200,14 +200,14 @@  discard block
 block discarded – undo
200 200
 		preg_match_all( "/\[(default-message|default_message)\b(.*?)(?:(\/))?\]/s", $message, $shortcodes, PREG_PATTERN_ORDER );
201 201
 
202 202
 		foreach ( $shortcodes[0] as $short_key => $tag ) {
203
-			$add_atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[2][ $short_key ] );
203
+			$add_atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[2][$short_key] );
204 204
 
205 205
 			$this_atts = ! empty( $add_atts ) ? array_merge( $atts, $add_atts ) : $atts;
206 206
 
207 207
 			$default = FrmEntriesController::show_entry_shortcode( $this_atts );
208 208
 
209 209
 			// Add the default message.
210
-			$message = str_replace( $shortcodes[0][ $short_key ], $default, $message );
210
+			$message = str_replace( $shortcodes[0][$short_key], $default, $message );
211 211
 		}
212 212
 
213 213
 		return $message;
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
 	 * @return string
222 222
 	 */
223 223
 	public static function prepare_display_value( $entry, $field, $atts ) {
224
-		$field_value = $entry->metas[ $field->id ] ?? false;
224
+		$field_value = $entry->metas[$field->id] ?? false;
225 225
 
226 226
 		if ( FrmAppHelper::pro_is_installed() ) {
227 227
 			$empty = empty( $field_value );
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
 			$child_entries = FrmEntry::getAll( array( 'it.parent_item_id' => $entry->id ), '', '', true );
252 252
 		} else {
253 253
 			// Get all values for this field.
254
-			$child_values = $entry->metas[ $atts['embedded_field_id'] ] ?? false;
254
+			$child_values = $entry->metas[$atts['embedded_field_id']] ?? false;
255 255
 
256 256
 			if ( $child_values ) {
257 257
 				$child_entries = FrmEntry::getAll( array( 'it.id' => (array) $child_values ) );
@@ -383,7 +383,7 @@  discard block
 block discarded – undo
383 383
 		}
384 384
 
385 385
 		if ( empty( $args['parent_field_id'] ) ) {
386
-			$_POST['item_meta'][ $field->id ] = $value;
386
+			$_POST['item_meta'][$field->id] = $value;
387 387
 		} else {
388 388
 			self::set_parent_field_posted_value( $field, $value, $args );
389 389
 		}
@@ -401,17 +401,17 @@  discard block
 block discarded – undo
401 401
 	 * @return void
402 402
 	 */
403 403
 	private static function set_parent_field_posted_value( $field, $value, $args ) {
404
-		if ( isset( $_POST['item_meta'][ $args['parent_field_id'] ] ) && is_array( $_POST['item_meta'][ $args['parent_field_id'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
405
-			if ( ! isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] ) || ! is_array( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
406
-				$_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing
404
+		if ( isset( $_POST['item_meta'][$args['parent_field_id']] ) && is_array( $_POST['item_meta'][$args['parent_field_id']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
405
+			if ( ! isset( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']] ) || ! is_array( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
406
+				$_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing
407 407
 			}
408 408
 		} else {
409 409
 			// All of the section was probably removed.
410
-			$_POST['item_meta'][ $args['parent_field_id'] ]                         = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing
411
-			$_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing
410
+			$_POST['item_meta'][$args['parent_field_id']]                         = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing
411
+			$_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing
412 412
 		}
413 413
 
414
-		$_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field->id ] = $value; // phpcs:ignore WordPress.Security.NonceVerification.Missing
414
+		$_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']][$field->id] = $value; // phpcs:ignore WordPress.Security.NonceVerification.Missing
415 415
 	}
416 416
 
417 417
 	/**
@@ -458,9 +458,9 @@  discard block
 block discarded – undo
458 458
 	private static function get_posted_meta( $field_id, $args ) {
459 459
 		if ( empty( $args['parent_field_id'] ) ) {
460 460
 			// Sanitizing is done next.
461
-			$value = isset( $_POST['item_meta'][ $field_id ] ) ? wp_unslash( $_POST['item_meta'][ $field_id ] ) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
461
+			$value = isset( $_POST['item_meta'][$field_id] ) ? wp_unslash( $_POST['item_meta'][$field_id] ) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
462 462
 		} else {
463
-			$value = isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field_id ] ) ? wp_unslash( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field_id ] ) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
463
+			$value = isset( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']][$field_id] ) ? wp_unslash( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']][$field_id] ) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
464 464
 		}
465 465
 		return $value;
466 466
 	}
@@ -494,14 +494,14 @@  discard block
 block discarded – undo
494 494
 		self::set_other_repeating_vals( $field, $value, $args );
495 495
 
496 496
 		// Check if there are any posted "Other" values.
497
-		if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta']['other'][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
497
+		if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta']['other'][$field->id] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
498 498
 
499 499
 			// Save original value.
500 500
 			$args['temp_value'] = $value;
501 501
 			$args['other']      = true;
502 502
 
503 503
 			// Sanitizing is done next.
504
-			$other_vals = wp_unslash( $_POST['item_meta']['other'][ $field->id ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
504
+			$other_vals = wp_unslash( $_POST['item_meta']['other'][$field->id] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
505 505
 			FrmAppHelper::sanitize_value( 'sanitize_text_field', $other_vals );
506 506
 
507 507
 			// Set the validation value now
@@ -526,12 +526,12 @@  discard block
 block discarded – undo
526 526
 		}
527 527
 
528 528
 		// Check if there are any other posted "other" values for this field.
529
-		if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ]['other'][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
529
+		if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']]['other'][$field->id] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
530 530
 			// Save original value
531 531
 			$args['temp_value'] = $value;
532 532
 			$args['other']      = true;
533 533
 
534
-			$other_vals = wp_unslash( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ]['other'][ $field->id ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
534
+			$other_vals = wp_unslash( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']]['other'][$field->id] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
535 535
 			FrmAppHelper::sanitize_value( 'sanitize_text_field', $other_vals );
536 536
 
537 537
 			// Set the validation value now.
@@ -560,7 +560,7 @@  discard block
 block discarded – undo
560 560
 		if ( is_array( $value ) && $field->type === 'checkbox' ) {
561 561
 			// Combine "Other" values with checked values. "Other" values will override checked box values.
562 562
 			foreach ( $other_vals as $k => $v ) {
563
-				if ( isset( $value[ $k ] ) && trim( $v ) === '' ) {
563
+				if ( isset( $value[$k] ) && trim( $v ) === '' ) {
564 564
 					// If the other box is checked, but doesn't have a value.
565 565
 					$value = '';
566 566
 					break;
@@ -577,26 +577,26 @@  discard block
 block discarded – undo
577 577
 
578 578
 			// Multi-select dropdown.
579 579
 			if ( is_array( $value ) ) {
580
-				$o_key = array_search( $field->options[ $other_key ], $value );
580
+				$o_key = array_search( $field->options[$other_key], $value );
581 581
 
582 582
 				if ( $o_key !== false ) {
583 583
 					// Modify the original value so other key will be preserved.
584
-					$value[ $other_key ] = $value[ $o_key ];
584
+					$value[$other_key] = $value[$o_key];
585 585
 
586 586
 					// By default, the array keys will be numeric for multi-select dropdowns.
587 587
 					// If going backwards and forwards between pages, the array key will match the other key.
588 588
 					if ( $o_key !== $other_key ) {
589
-						unset( $value[ $o_key ] );
589
+						unset( $value[$o_key] );
590 590
 					}
591 591
 
592 592
 					$args['temp_value']  = $value;
593
-					$value[ $other_key ] = reset( $other_vals );
593
+					$value[$other_key] = reset( $other_vals );
594 594
 
595
-					if ( FrmAppHelper::is_empty_value( $value[ $other_key ] ) ) {
596
-						unset( $value[ $other_key ] );
595
+					if ( FrmAppHelper::is_empty_value( $value[$other_key] ) ) {
596
+						unset( $value[$other_key] );
597 597
 					}
598 598
 				}
599
-			} elseif ( $field->options[ $other_key ] == $value ) {
599
+			} elseif ( $field->options[$other_key] == $value ) {
600 600
 				$value = $other_vals;
601 601
 			}//end if
602 602
 		}//end if
@@ -855,7 +855,7 @@  discard block
 block discarded – undo
855 855
 	 * @return void
856 856
 	 */
857 857
 	public static function maybe_render_captcha_score( $entry_id ) {
858
-		$query                 = array(
858
+		$query = array(
859 859
 			'item_id'  => (int) $entry_id,
860 860
 			'field_id' => 0,
861 861
 		);
@@ -910,7 +910,7 @@  discard block
 block discarded – undo
910 910
 	public static function get_entry_status_label( $status ) {
911 911
 		$statuses = self::get_entry_statuses();
912 912
 
913
-		return $statuses[ self::get_entry_status( $status ) ];
913
+		return $statuses[self::get_entry_status( $status )];
914 914
 	}
915 915
 
916 916
 	/**
Please login to merge, or discard this patch.
classes/helpers/FrmStylesCardHelper.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -145,11 +145,11 @@  discard block
 block discarded – undo
145 145
 	private static function has_dark_background( $style ) {
146 146
 		$key = 'fieldset_bg_color';
147 147
 
148
-		if ( empty( $style->post_content[ $key ] ) ) {
148
+		if ( empty( $style->post_content[$key] ) ) {
149 149
 			return false;
150 150
 		}
151 151
 
152
-		$color = $style->post_content[ $key ];
152
+		$color = $style->post_content[$key];
153 153
 
154 154
 		if ( 0 === strpos( $color, 'rgba' ) ) {
155 155
 			preg_match_all( '/([\\d.]+)/', $color, $matches );
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
 			 * @param stdClass $style_object
214 214
 			 * @param array    $style
215 215
 			 */
216
-			$param_filter = function ( $params, $args ) use ( $style_object, $style ) {
216
+			$param_filter = function( $params, $args ) use ( $style_object, $style ) {
217 217
 				if ( $args['style'] !== $style_object ) {
218 218
 					return $params;
219 219
 				}
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
 					),
227 227
 					'/style-templates/' . $style['slug']
228 228
 				);
229
-				$params['data-requires']    = FrmFormsHelper::get_plan_required( $style );
229
+				$params['data-requires'] = FrmFormsHelper::get_plan_required( $style );
230 230
 				return $params;
231 231
 			};
232 232
 		} else {
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
 			 *
239 239
 			 * @return array
240 240
 			 */
241
-			$param_filter = function ( $params ) use ( $style ) {
241
+			$param_filter = function( $params ) use ( $style ) {
242 242
 				$params['data-template-key'] = $style['slug'];
243 243
 				return $params;
244 244
 			};
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
 				continue;
292 292
 			}
293 293
 
294
-			$value = $style->post_content[ $key ];
294
+			$value = $style->post_content[$key];
295 295
 
296 296
 			$is_hex = in_array( $key, $color_settings, true ) && $value && '#' !== $value[0] && false === strpos( $value, 'rgb' ) && $value !== 'transparent';
297 297
 
@@ -414,7 +414,7 @@  discard block
 block discarded – undo
414 414
 			 *
415 415
 			 * @return void
416 416
 			 */
417
-			function ( $style, $key ) {
417
+			function( $style, $key ) {
418 418
 				if ( ! is_numeric( $key ) ) {
419 419
 					// Skip active_sub/expires keys.
420 420
 					return;
@@ -443,10 +443,10 @@  discard block
 block discarded – undo
443 443
 			 *
444 444
 			 * @return void
445 445
 			 */
446
-			function ( $style ) use ( &$count ) {
446
+			function( $style ) use ( &$count ) {
447 447
 				$hidden = $count > self::PAGE_SIZE - 1;
448 448
 				$this->echo_style_card( $style, $hidden );
449
-				++$count;
449
+				++ $count;
450 450
 			}
451 451
 		);
452 452
 
@@ -507,7 +507,7 @@  discard block
 block discarded – undo
507 507
 			 *
508 508
 			 * @return bool
509 509
 			 */
510
-			function ( $style ) {
510
+			function( $style ) {
511 511
 				return $this->default_style->ID !== $style->ID;
512 512
 			}
513 513
 		);
Please login to merge, or discard this patch.
classes/helpers/FrmAddonsHelper.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
 			'convertkit'                      => 'convertkit',
179 179
 		);
180 180
 
181
-		$icon = array_key_exists( $slug, $icons_map ) ? 'frm_' . $icons_map[ $slug ] . '_icon' : 'frm_logo_icon';
181
+		$icon = array_key_exists( $slug, $icons_map ) ? 'frm_' . $icons_map[$slug] . '_icon' : 'frm_logo_icon';
182 182
 
183 183
 		if ( 'ai' === $slug ) {
184 184
 			$icon = str_replace( '_', '-', $icon );
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
 		?>
292 292
 		<span style="color: <?php echo esc_attr( $color ); ?>;">
293 293
 			<?php
294
-			for ( $i = 0; $i < 5; $i++ ) {
294
+			for ( $i = 0; $i < 5; $i ++ ) {
295 295
 				echo $icon; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
296 296
 			}
297 297
 			?>
Please login to merge, or discard this patch.