Completed
Pull Request — master (#2600)
by
unknown
46s
created
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
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,7 +200,7 @@  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
 			if ( ! empty( $add_atts ) ) {
206 206
 				$this_atts = array_merge( $atts, $add_atts );
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
 			$default = FrmEntriesController::show_entry_shortcode( $this_atts );
212 212
 
213 213
 			// Add the default message.
214
-			$message = str_replace( $shortcodes[0][ $short_key ], $default, $message );
214
+			$message = str_replace( $shortcodes[0][$short_key], $default, $message );
215 215
 		}
216 216
 
217 217
 		return $message;
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
 	 * @return string
226 226
 	 */
227 227
 	public static function prepare_display_value( $entry, $field, $atts ) {
228
-		$field_value = $entry->metas[ $field->id ] ?? false;
228
+		$field_value = $entry->metas[$field->id] ?? false;
229 229
 
230 230
 		if ( FrmAppHelper::pro_is_installed() ) {
231 231
 			$empty = empty( $field_value );
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
 			$child_entries = FrmEntry::getAll( array( 'it.parent_item_id' => $entry->id ), '', '', true );
256 256
 		} else {
257 257
 			// Get all values for this field.
258
-			$child_values = $entry->metas[ $atts['embedded_field_id'] ] ?? false;
258
+			$child_values = $entry->metas[$atts['embedded_field_id']] ?? false;
259 259
 
260 260
 			if ( $child_values ) {
261 261
 				$child_entries = FrmEntry::getAll( array( 'it.id' => (array) $child_values ) );
@@ -387,7 +387,7 @@  discard block
 block discarded – undo
387 387
 		}
388 388
 
389 389
 		if ( empty( $args['parent_field_id'] ) ) {
390
-			$_POST['item_meta'][ $field->id ] = $value;
390
+			$_POST['item_meta'][$field->id] = $value;
391 391
 		} else {
392 392
 			self::set_parent_field_posted_value( $field, $value, $args );
393 393
 		}
@@ -405,17 +405,17 @@  discard block
 block discarded – undo
405 405
 	 * @return void
406 406
 	 */
407 407
 	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
410
-				$_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing
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
410
+				$_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing
411 411
 			}
412 412
 		} else {
413 413
 			// All of the section was probably removed.
414
-			$_POST['item_meta'][ $args['parent_field_id'] ]                         = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing
415
-			$_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing
414
+			$_POST['item_meta'][$args['parent_field_id']]                         = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing
415
+			$_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing
416 416
 		}
417 417
 
418
-		$_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field->id ] = $value; // phpcs:ignore WordPress.Security.NonceVerification.Missing
418
+		$_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']][$field->id] = $value; // phpcs:ignore WordPress.Security.NonceVerification.Missing
419 419
 	}
420 420
 
421 421
 	/**
@@ -462,9 +462,9 @@  discard block
 block discarded – undo
462 462
 	private static function get_posted_meta( $field_id, $args ) {
463 463
 		if ( empty( $args['parent_field_id'] ) ) {
464 464
 			// Sanitizing is done next.
465
-			$value = isset( $_POST['item_meta'][ $field_id ] ) ? wp_unslash( $_POST['item_meta'][ $field_id ] ) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
465
+			$value = isset( $_POST['item_meta'][$field_id] ) ? wp_unslash( $_POST['item_meta'][$field_id] ) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
466 466
 		} else {
467
-			$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
467
+			$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
468 468
 		}
469 469
 		return $value;
470 470
 	}
@@ -498,14 +498,14 @@  discard block
 block discarded – undo
498 498
 		self::set_other_repeating_vals( $field, $value, $args );
499 499
 
500 500
 		// 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
501
+		if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta']['other'][$field->id] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
502 502
 
503 503
 			// Save original value.
504 504
 			$args['temp_value'] = $value;
505 505
 			$args['other']      = true;
506 506
 
507 507
 			// Sanitizing is done next.
508
-			$other_vals = wp_unslash( $_POST['item_meta']['other'][ $field->id ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
508
+			$other_vals = wp_unslash( $_POST['item_meta']['other'][$field->id] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
509 509
 			FrmAppHelper::sanitize_value( 'sanitize_text_field', $other_vals );
510 510
 
511 511
 			// Set the validation value now
@@ -530,12 +530,12 @@  discard block
 block discarded – undo
530 530
 		}
531 531
 
532 532
 		// 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
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
534 534
 			// Save original value
535 535
 			$args['temp_value'] = $value;
536 536
 			$args['other']      = true;
537 537
 
538
-			$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
538
+			$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
539 539
 			FrmAppHelper::sanitize_value( 'sanitize_text_field', $other_vals );
540 540
 
541 541
 			// Set the validation value now.
@@ -564,7 +564,7 @@  discard block
 block discarded – undo
564 564
 		if ( is_array( $value ) && $field->type === 'checkbox' ) {
565 565
 			// Combine "Other" values with checked values. "Other" values will override checked box values.
566 566
 			foreach ( $other_vals as $k => $v ) {
567
-				if ( isset( $value[ $k ] ) && trim( $v ) === '' ) {
567
+				if ( isset( $value[$k] ) && trim( $v ) === '' ) {
568 568
 					// If the other box is checked, but doesn't have a value.
569 569
 					$value = '';
570 570
 					break;
@@ -581,26 +581,26 @@  discard block
 block discarded – undo
581 581
 
582 582
 			// Multi-select dropdown.
583 583
 			if ( is_array( $value ) ) {
584
-				$o_key = array_search( $field->options[ $other_key ], $value );
584
+				$o_key = array_search( $field->options[$other_key], $value );
585 585
 
586 586
 				if ( $o_key !== false ) {
587 587
 					// Modify the original value so other key will be preserved.
588
-					$value[ $other_key ] = $value[ $o_key ];
588
+					$value[$other_key] = $value[$o_key];
589 589
 
590 590
 					// By default, the array keys will be numeric for multi-select dropdowns.
591 591
 					// If going backwards and forwards between pages, the array key will match the other key.
592 592
 					if ( $o_key !== $other_key ) {
593
-						unset( $value[ $o_key ] );
593
+						unset( $value[$o_key] );
594 594
 					}
595 595
 
596 596
 					$args['temp_value']  = $value;
597
-					$value[ $other_key ] = reset( $other_vals );
597
+					$value[$other_key] = reset( $other_vals );
598 598
 
599
-					if ( FrmAppHelper::is_empty_value( $value[ $other_key ] ) ) {
600
-						unset( $value[ $other_key ] );
599
+					if ( FrmAppHelper::is_empty_value( $value[$other_key] ) ) {
600
+						unset( $value[$other_key] );
601 601
 					}
602 602
 				}
603
-			} elseif ( $field->options[ $other_key ] == $value ) {
603
+			} elseif ( $field->options[$other_key] == $value ) {
604 604
 				$value = $other_vals;
605 605
 			}//end if
606 606
 		}//end if
@@ -863,7 +863,7 @@  discard block
 block discarded – undo
863 863
 	 * @return void
864 864
 	 */
865 865
 	public static function maybe_render_captcha_score( $entry_id ) {
866
-		$query                 = array(
866
+		$query = array(
867 867
 			'item_id'  => (int) $entry_id,
868 868
 			'field_id' => 0,
869 869
 		);
@@ -918,7 +918,7 @@  discard block
 block discarded – undo
918 918
 	public static function get_entry_status_label( $status ) {
919 919
 		$statuses = self::get_entry_statuses();
920 920
 
921
-		return $statuses[ self::get_entry_status( $status ) ];
921
+		return $statuses[self::get_entry_status( $status )];
922 922
 	}
923 923
 
924 924
 	/**
Please login to merge, or discard this patch.
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.
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/FrmListHelper.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -246,8 +246,8 @@  discard block
 block discarded – undo
246 246
 			return $this->get_pagenum();
247 247
 		}
248 248
 
249
-		if ( isset( $this->_pagination_args[ $key ] ) ) {
250
-			return $this->_pagination_args[ $key ];
249
+		if ( isset( $this->_pagination_args[$key] ) ) {
250
+			return $this->_pagination_args[$key];
251 251
 		}
252 252
 	}
253 253
 
@@ -297,8 +297,8 @@  discard block
 block discarded – undo
297 297
 	 * @return void
298 298
 	 */
299 299
 	private function hidden_search_inputs( $param_name ) {
300
-		if ( ! empty( $_REQUEST[ $param_name ] ) ) {
301
-			$value = sanitize_text_field( wp_unslash( $_REQUEST[ $param_name ] ) );
300
+		if ( ! empty( $_REQUEST[$param_name] ) ) {
301
+			$value = sanitize_text_field( wp_unslash( $_REQUEST[$param_name] ) );
302 302
 			echo '<input type="hidden" name="' . esc_attr( $param_name ) . '" value="' . esc_attr( $value ) . '" />';
303 303
 		}
304 304
 	}
@@ -341,7 +341,7 @@  discard block
 block discarded – undo
341 341
 		echo "<ul class='subsubsub'>\n";
342 342
 
343 343
 		foreach ( $views as $class => $view ) {
344
-			$views[ $class ] = "\t" . '<li class="' . esc_attr( $class ) . '">' . $view;
344
+			$views[$class] = "\t" . '<li class="' . esc_attr( $class ) . '">' . $view;
345 345
 		}
346 346
 		echo implode( " |</li>\n", $views ) . "</li>\n"; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
347 347
 		echo '</ul>';
@@ -511,7 +511,7 @@  discard block
 block discarded – undo
511 511
 		$out = '<div class="' . ( $always_visible ? 'row-actions visible' : 'row-actions' ) . '">';
512 512
 
513 513
 		foreach ( $actions as $action => $link ) {
514
-			++$i;
514
+			++ $i;
515 515
 			$sep  = $i === $action_count ? '' : ' | ';
516 516
 			$out .= "<span class='$action'>$link$sep</span>";
517 517
 		}
@@ -751,7 +751,7 @@  discard block
 block discarded – undo
751 751
 			'next'  => __( 'Next page', 'formidable' ),
752 752
 		);
753 753
 
754
-		return $labels[ $link ];
754
+		return $labels[$link];
755 755
 	}
756 756
 
757 757
 	private function current_url() {
@@ -856,7 +856,7 @@  discard block
 block discarded – undo
856 856
 
857 857
 		// If the primary column doesn't exist fall back to the
858 858
 		// first non-checkbox column.
859
-		if ( ! isset( $columns[ $default ] ) ) {
859
+		if ( ! isset( $columns[$default] ) ) {
860 860
 			$default = self::get_default_primary_column_name();
861 861
 		}
862 862
 
@@ -870,7 +870,7 @@  discard block
 block discarded – undo
870 870
 		 */
871 871
 		$column = apply_filters( 'list_table_primary_column', $default, $this->screen->id );
872 872
 
873
-		if ( empty( $column ) || ! isset( $columns[ $column ] ) ) {
873
+		if ( empty( $column ) || ! isset( $columns[$column] ) ) {
874 874
 			$column = $default;
875 875
 		}
876 876
 
@@ -892,7 +892,7 @@  discard block
 block discarded – undo
892 892
 			$column_headers = array( array(), array(), array(), $this->get_primary_column_name() );
893 893
 
894 894
 			foreach ( $this->_column_headers as $key => $value ) {
895
-				$column_headers[ $key ] = $value;
895
+				$column_headers[$key] = $value;
896 896
 			}
897 897
 
898 898
 			return $column_headers;
@@ -927,7 +927,7 @@  discard block
 block discarded – undo
927 927
 				$data[1] = false;
928 928
 			}
929 929
 
930
-			$sortable[ $id ] = $data;
930
+			$sortable[$id] = $data;
931 931
 		}
932 932
 
933 933
 		$primary = $this->get_primary_column_name();
@@ -986,7 +986,7 @@  discard block
 block discarded – undo
986 986
 			static $cb_counter = 1;
987 987
 			$columns['cb']     = '<label class="screen-reader-text" for="cb-select-all-' . $cb_counter . '">' . __( 'Select All', 'formidable' ) . '</label>';
988 988
 			$columns['cb']    .= '<input id="cb-select-all-' . esc_attr( $cb_counter ) . '" type="checkbox" />';
989
-			++$cb_counter;
989
+			++ $cb_counter;
990 990
 		}
991 991
 
992 992
 		foreach ( $columns as $column_key => $column_display_name ) {
@@ -1008,8 +1008,8 @@  discard block
 block discarded – undo
1008 1008
 				$class[] = 'column-primary';
1009 1009
 			}
1010 1010
 
1011
-			if ( isset( $sortable[ $column_key ] ) ) {
1012
-				list( $orderby, $desc_first ) = $sortable[ $column_key ];
1011
+			if ( isset( $sortable[$column_key] ) ) {
1012
+				list( $orderby, $desc_first ) = $sortable[$column_key];
1013 1013
 
1014 1014
 				if ( $current_orderby == $orderby ) {
1015 1015
 					// The sorted column. The `aria-sort` attribute must be set only on the sorted column.
@@ -1129,7 +1129,7 @@  discard block
 block discarded – undo
1129 1129
 	 * @return bool Returns true if the setting is not set or if it is not false; otherwise, returns false.
1130 1130
 	 */
1131 1131
 	protected function should_display( $args, $settings ) {
1132
-		return ! isset( $args[ $settings ] ) || false !== $args[ $settings ];
1132
+		return ! isset( $args[$settings] ) || false !== $args[$settings];
1133 1133
 	}
1134 1134
 
1135 1135
 	/**
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.
classes/helpers/FrmOnSubmitHelper.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -247,17 +247,17 @@  discard block
 block discarded – undo
247 247
 		$opt = 'update' === $event ? 'edit_' : 'success_';
248 248
 
249 249
 		if ( ! $action || ! is_object( $action ) ) {
250
-			$form_options[ $opt . 'action' ] = self::get_default_action_type();
251
-			$form_options[ $opt . 'msg' ]    = self::get_default_msg();
250
+			$form_options[$opt . 'action'] = self::get_default_action_type();
251
+			$form_options[$opt . 'msg']    = self::get_default_msg();
252 252
 
253 253
 			return;
254 254
 		}
255 255
 
256
-		$form_options[ $opt . 'action' ] = $action->post_content['success_action'] ?? 'message';
256
+		$form_options[$opt . 'action'] = $action->post_content['success_action'] ?? 'message';
257 257
 
258
-		switch ( $form_options[ $opt . 'action' ] ) {
258
+		switch ( $form_options[$opt . 'action'] ) {
259 259
 			case 'redirect':
260
-				$form_options[ $opt . 'url' ]        = $action->post_content['success_url'] ?? '';
260
+				$form_options[$opt . 'url']        = $action->post_content['success_url'] ?? '';
261 261
 				$form_options['open_in_new_tab']     = ! empty( $action->post_content['open_in_new_tab'] );
262 262
 				$form_options['redirect_delay']      = ! empty( $action->post_content['redirect_delay'] );
263 263
 				$form_options['redirect_delay_time'] = $action->post_content['redirect_delay_time'];
@@ -265,11 +265,11 @@  discard block
 block discarded – undo
265 265
 				break;
266 266
 
267 267
 			case 'page':
268
-				$form_options[ $opt . 'page_id' ] = $action->post_content['success_page_id'] ?? '';
268
+				$form_options[$opt . 'page_id'] = $action->post_content['success_page_id'] ?? '';
269 269
 				break;
270 270
 
271 271
 			default:
272
-				$form_options[ $opt . 'msg' ] = ! empty( $action->post_content['success_msg'] ) ? $action->post_content['success_msg'] : self::get_default_msg();
272
+				$form_options[$opt . 'msg'] = ! empty( $action->post_content['success_msg'] ) ? $action->post_content['success_msg'] : self::get_default_msg();
273 273
 				$form_options['show_form']    = ! empty( $action->post_content['show_form'] );
274 274
 		}
275 275
 	}
@@ -363,20 +363,20 @@  discard block
 block discarded – undo
363 363
 	private static function get_on_submit_action_data_from_form_options( $form_options, $event = 'create' ) {
364 364
 		$opt  = 'update' === $event ? 'edit_' : 'success_';
365 365
 		$data = array(
366
-			'success_action' => $form_options[ $opt . 'action' ] ?? self::get_default_action_type(),
366
+			'success_action' => $form_options[$opt . 'action'] ?? self::get_default_action_type(),
367 367
 		);
368 368
 
369 369
 		switch ( $data['success_action'] ) {
370 370
 			case 'redirect':
371
-				$data['success_url'] = $form_options[ $opt . 'url' ] ?? '';
371
+				$data['success_url'] = $form_options[$opt . 'url'] ?? '';
372 372
 				break;
373 373
 
374 374
 			case 'page':
375
-				$data['success_page_id'] = $form_options[ $opt . 'page_id' ] ?? '';
375
+				$data['success_page_id'] = $form_options[$opt . 'page_id'] ?? '';
376 376
 				break;
377 377
 
378 378
 			default:
379
-				$data['success_msg'] = $form_options[ $opt . 'msg' ] ?? self::get_default_msg();
379
+				$data['success_msg'] = $form_options[$opt . 'msg'] ?? self::get_default_msg();
380 380
 				$data['show_form']   = ! empty( $form_options['show_form'] );
381 381
 		}
382 382
 
Please login to merge, or discard this patch.
classes/helpers/FrmFieldGridHelper.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -230,7 +230,7 @@
 block discarded – undo
230 230
 		}
231 231
 
232 232
 		if ( false !== $this->parent_li ) {
233
-			++$this->current_field_count;
233
+			++ $this->current_field_count;
234 234
 			$this->current_list_size += $this->active_field_size;
235 235
 
236 236
 			if ( 12 === $this->current_list_size ) {
Please login to merge, or discard this patch.
classes/helpers/FrmStringReaderHelper.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 	public function read_until( $char ) {
53 53
 		$value = '';
54 54
 
55
-		while ( $this->pos <= $this->max && ( $one = $this->string[ $this->pos++ ] ) !== $char ) {
55
+		while ( $this->pos <= $this->max && ( $one = $this->string[$this->pos ++] ) !== $char ) {
56 56
 			$value .= $one;
57 57
 		}
58 58
 		return $value;
@@ -70,10 +70,10 @@  discard block
 block discarded – undo
70 70
 	public function read( $count ) {
71 71
 		$value = '';
72 72
 
73
-		while ( $count > 0 && $this->pos <= $this->max && ( ( $one = $this->string[ $this->pos ] ) || '0' === $one ) ) {
73
+		while ( $count > 0 && $this->pos <= $this->max && ( ( $one = $this->string[$this->pos] ) || '0' === $one ) ) {
74 74
 			$value     .= $one;
75 75
 			$this->pos += 1;
76
-			--$count;
76
+			-- $count;
77 77
 		}
78 78
 
79 79
 		/**
Please login to merge, or discard this patch.
stripe/models/FrmStrpLiteAuth.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 
62 62
 		if ( $intent_is_processing ) {
63 63
 			// Append an additional processing message to the end of the success message.
64
-			$filter = function ( $message ) {
64
+			$filter = function( $message ) {
65 65
 				$stripe_settings = FrmStrpLiteAppHelper::get_settings();
66 66
 				$message        .= '<p>' . esc_html( $stripe_settings->settings->processing_message ) . '</p>';
67 67
 				return $message;
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
 		$atts['form']        = FrmForm::getOne( $atts['entry']->form_id );
172 172
 		$atts['entry_id']    = $atts['entry']->id;
173 173
 		$opt                 = 'success_action';
174
-		$atts['conf_method'] = ! empty( $atts['form']->options[ $opt ] ) ? $atts['form']->options[ $opt ] : 'message';
174
+		$atts['conf_method'] = ! empty( $atts['form']->options[$opt] ) ? $atts['form']->options[$opt] : 'message';
175 175
 
176 176
 		$actions = FrmFormsController::get_met_on_submit_actions( $atts, 'create' );
177 177
 
@@ -269,11 +269,11 @@  discard block
 block discarded – undo
269 269
 	 */
270 270
 	public static function get_payment_intents( $name ) {
271 271
 		// phpcs:ignore WordPress.Security.NonceVerification.Missing
272
-		if ( ! isset( $_POST[ $name ] ) ) {
272
+		if ( ! isset( $_POST[$name] ) ) {
273 273
 			return array();
274 274
 		}
275 275
 
276
-		$intents = $_POST[ $name ]; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
276
+		$intents = $_POST[$name]; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
277 277
 		FrmAppHelper::sanitize_value( 'sanitize_text_field', $intents );
278 278
 		return $intents;
279 279
 	}
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
 		self::format_form_data( $form );
302 302
 
303 303
 		$form_id = absint( $form['form_id'] );
304
-		$intents = $form[ 'frmintent' . $form_id ] ?? array();
304
+		$intents = $form['frmintent' . $form_id] ?? array();
305 305
 
306 306
 		if ( empty( $intents ) ) {
307 307
 			wp_die();
@@ -311,8 +311,8 @@  discard block
 block discarded – undo
311 311
 			$intents = array( $intents );
312 312
 		} else {
313 313
 			foreach ( $intents as $k => $intent ) {
314
-				if ( is_array( $intent ) && isset( $intent[ $k ] ) ) {
315
-					$intents[ $k ] = $intent[ $k ];
314
+				if ( is_array( $intent ) && isset( $intent[$k] ) ) {
315
+					$intents[$k] = $intent[$k];
316 316
 				}
317 317
 			}
318 318
 		}
@@ -374,7 +374,7 @@  discard block
 block discarded – undo
374 374
 				if ( $saved->metadata->action != $action->ID ) {
375 375
 					continue;
376 376
 				}
377
-				$intents[ $k ] = array(
377
+				$intents[$k] = array(
378 378
 					'id'     => $intent,
379 379
 					'action' => $action->ID,
380 380
 				);
@@ -421,7 +421,7 @@  discard block
 block discarded – undo
421 421
 			if ( $k === 'item_meta' ) {
422 422
 				foreach ( $v as $f => $value ) {
423 423
 					FrmAppHelper::sanitize_value( 'wp_kses_post', $value );
424
-					$entry->metas[ absint( $f ) ] = $value;
424
+					$entry->metas[absint( $f )] = $value;
425 425
 				}
426 426
 			} else {
427 427
 				FrmAppHelper::sanitize_value( 'wp_kses_post', $v );
@@ -447,14 +447,14 @@  discard block
 block discarded – undo
447 447
 		foreach ( $form as $input ) {
448 448
 			$key = $input['name'];
449 449
 
450
-			if ( isset( $formatted[ $key ] ) ) {
451
-				if ( is_array( $formatted[ $key ] ) ) {
452
-					$formatted[ $key ][] = $input['value'];
450
+			if ( isset( $formatted[$key] ) ) {
451
+				if ( is_array( $formatted[$key] ) ) {
452
+					$formatted[$key][] = $input['value'];
453 453
 				} else {
454
-					$formatted[ $key ] = array( $formatted[ $key ], $input['value'] );
454
+					$formatted[$key] = array( $formatted[$key], $input['value'] );
455 455
 				}
456 456
 			} else {
457
-				$formatted[ $key ] = $input['value'];
457
+				$formatted[$key] = $input['value'];
458 458
 			}
459 459
 		}
460 460
 
@@ -706,7 +706,7 @@  discard block
 block discarded – undo
706 706
 
707 707
 		foreach ( $actions as $k => $action ) {
708 708
 			$amount                                = self::get_amount_before_submit( compact( 'action', 'form' ) );
709
-			$actions[ $k ]->post_content['amount'] = $amount;
709
+			$actions[$k]->post_content['amount'] = $amount;
710 710
 		}
711 711
 	}
712 712
 
Please login to merge, or discard this patch.