Completed
Pull Request — master (#2513)
by
unknown
45s
created
classes/helpers/FrmListHelper.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -230,8 +230,8 @@  discard block
 block discarded – undo
230 230
 			return $this->get_pagenum();
231 231
 		}
232 232
 
233
-		if ( isset( $this->_pagination_args[ $key ] ) ) {
234
-			return $this->_pagination_args[ $key ];
233
+		if ( isset( $this->_pagination_args[$key] ) ) {
234
+			return $this->_pagination_args[$key];
235 235
 		}
236 236
 	}
237 237
 
@@ -281,8 +281,8 @@  discard block
 block discarded – undo
281 281
 	 * @return void
282 282
 	 */
283 283
 	private function hidden_search_inputs( $param_name ) {
284
-		if ( ! empty( $_REQUEST[ $param_name ] ) ) {
285
-			$value = sanitize_text_field( wp_unslash( $_REQUEST[ $param_name ] ) );
284
+		if ( ! empty( $_REQUEST[$param_name] ) ) {
285
+			$value = sanitize_text_field( wp_unslash( $_REQUEST[$param_name] ) );
286 286
 			echo '<input type="hidden" name="' . esc_attr( $param_name ) . '" value="' . esc_attr( $value ) . '" />';
287 287
 		}
288 288
 	}
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
 
325 325
 		echo "<ul class='subsubsub'>\n";
326 326
 		foreach ( $views as $class => $view ) {
327
-			$views[ $class ] = "\t" . '<li class="' . esc_attr( $class ) . '">' . $view;
327
+			$views[$class] = "\t" . '<li class="' . esc_attr( $class ) . '">' . $view;
328 328
 		}
329 329
 		echo implode( " |</li>\n", $views ) . "</li>\n"; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
330 330
 		echo '</ul>';
@@ -490,7 +490,7 @@  discard block
 block discarded – undo
490 490
 
491 491
 		$out = '<div class="' . ( $always_visible ? 'row-actions visible' : 'row-actions' ) . '">';
492 492
 		foreach ( $actions as $action => $link ) {
493
-			++$i;
493
+			++ $i;
494 494
 			$sep  = $i === $action_count ? '' : ' | ';
495 495
 			$out .= "<span class='$action'>$link$sep</span>";
496 496
 		}
@@ -723,7 +723,7 @@  discard block
 block discarded – undo
723 723
 			'next'  => __( 'Next page', 'formidable' ),
724 724
 		);
725 725
 
726
-		return $labels[ $link ];
726
+		return $labels[$link];
727 727
 	}
728 728
 
729 729
 	private function current_url() {
@@ -828,7 +828,7 @@  discard block
 block discarded – undo
828 828
 
829 829
 		// If the primary column doesn't exist fall back to the
830 830
 		// first non-checkbox column.
831
-		if ( ! isset( $columns[ $default ] ) ) {
831
+		if ( ! isset( $columns[$default] ) ) {
832 832
 			$default = self::get_default_primary_column_name();
833 833
 		}
834 834
 
@@ -842,7 +842,7 @@  discard block
 block discarded – undo
842 842
 		 */
843 843
 		$column = apply_filters( 'list_table_primary_column', $default, $this->screen->id );
844 844
 
845
-		if ( empty( $column ) || ! isset( $columns[ $column ] ) ) {
845
+		if ( empty( $column ) || ! isset( $columns[$column] ) ) {
846 846
 			$column = $default;
847 847
 		}
848 848
 
@@ -863,7 +863,7 @@  discard block
 block discarded – undo
863 863
 			// In 4.3, we added a fourth argument for primary column.
864 864
 			$column_headers = array( array(), array(), array(), $this->get_primary_column_name() );
865 865
 			foreach ( $this->_column_headers as $key => $value ) {
866
-				$column_headers[ $key ] = $value;
866
+				$column_headers[$key] = $value;
867 867
 			}
868 868
 
869 869
 			return $column_headers;
@@ -896,7 +896,7 @@  discard block
 block discarded – undo
896 896
 				$data[1] = false;
897 897
 			}
898 898
 
899
-			$sortable[ $id ] = $data;
899
+			$sortable[$id] = $data;
900 900
 		}
901 901
 
902 902
 		$primary = $this->get_primary_column_name();
@@ -954,7 +954,7 @@  discard block
 block discarded – undo
954 954
 			static $cb_counter = 1;
955 955
 			$columns['cb']     = '<label class="screen-reader-text" for="cb-select-all-' . $cb_counter . '">' . __( 'Select All', 'formidable' ) . '</label>';
956 956
 			$columns['cb']    .= '<input id="cb-select-all-' . esc_attr( $cb_counter ) . '" type="checkbox" />';
957
-			++$cb_counter;
957
+			++ $cb_counter;
958 958
 		}
959 959
 
960 960
 		foreach ( $columns as $column_key => $column_display_name ) {
@@ -976,8 +976,8 @@  discard block
 block discarded – undo
976 976
 				$class[] = 'column-primary';
977 977
 			}
978 978
 
979
-			if ( isset( $sortable[ $column_key ] ) ) {
980
-				list( $orderby, $desc_first ) = $sortable[ $column_key ];
979
+			if ( isset( $sortable[$column_key] ) ) {
980
+				list( $orderby, $desc_first ) = $sortable[$column_key];
981 981
 
982 982
 				if ( $current_orderby == $orderby ) {
983 983
 					// The sorted column. The `aria-sort` attribute must be set only on the sorted column.
@@ -1094,7 +1094,7 @@  discard block
 block discarded – undo
1094 1094
 	 * @return bool Returns true if the setting is not set or if it is not false; otherwise, returns false.
1095 1095
 	 */
1096 1096
 	protected function should_display( $args, $settings ) {
1097
-		return ! isset( $args[ $settings ] ) || false !== $args[ $settings ];
1097
+		return ! isset( $args[$settings] ) || false !== $args[$settings];
1098 1098
 	}
1099 1099
 
1100 1100
 	/**
Please login to merge, or discard this patch.
classes/helpers/FrmFieldsHelper.php 2 patches
Braces   +8 added lines, -4 removed lines patch added patch discarded remove patch
@@ -231,7 +231,8 @@  discard block
 block discarded – undo
231 231
 				return false;
232 232
 			}
233 233
 
234
-			if ( ! $_POST || ! isset( $_POST['field_options'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
234
+			if ( ! $_POST || ! isset( $_POST['field_options'] ) ) {
235
+// phpcs:ignore WordPress.Security.NonceVerification.Missing
235 236
 				return false;
236 237
 			}
237 238
 
@@ -338,7 +339,8 @@  discard block
 block discarded – undo
338 339
 	 * @return void
339 340
 	 */
340 341
 	private static function get_posted_field_setting( $setting, &$value ) {
341
-		if ( ! isset( $_POST['field_options'][ $setting ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
342
+		if ( ! isset( $_POST['field_options'][ $setting ] ) ) {
343
+// phpcs:ignore WordPress.Security.NonceVerification.Missing
342 344
 			return;
343 345
 		}
344 346
 
@@ -1531,7 +1533,8 @@  discard block
 block discarded – undo
1531 1533
 
1532 1534
 		// Check posted vals before checking saved values
1533 1535
 		// For fields inside repeating sections - note, don't check if $pointer is true because it will often be zero
1534
-		if ( $parent && isset( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
1536
+		if ( $parent && isset( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ] ) ) {
1537
+// phpcs:ignore WordPress.Security.NonceVerification.Missing
1535 1538
 			if ( FrmField::is_field_with_multiple_values( $field ) ) {
1536 1539
 				// phpcs:ignore WordPress.Security.NonceVerification.Missing
1537 1540
 				$other_val = isset( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ][ $opt_key ] ) ? sanitize_text_field( wp_unslash( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ][ $opt_key ] ) ) : '';
@@ -1542,7 +1545,8 @@  discard block
 block discarded – undo
1542 1545
 			return $other_val;
1543 1546
 		}
1544 1547
 
1545
-		if ( isset( $field['id'] ) && isset( $_POST['item_meta']['other'][ $field['id'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
1548
+		if ( isset( $field['id'] ) && isset( $_POST['item_meta']['other'][ $field['id'] ] ) ) {
1549
+// phpcs:ignore WordPress.Security.NonceVerification.Missing
1546 1550
 			// For normal fields
1547 1551
 
1548 1552
 			if ( FrmField::is_field_with_multiple_values( $field ) ) {
Please login to merge, or discard this patch.
Spacing   +50 added lines, -50 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 			if ( in_array( $type, array( 'data', 'lookup' ), true ) ) {
45 45
 				$values['field_options']['data_type'] = $setting;
46 46
 			} else {
47
-				$values['field_options'][ $setting ] = 1;
47
+				$values['field_options'][$setting] = 1;
48 48
 			}
49 49
 		}
50 50
 
@@ -206,10 +206,10 @@  discard block
 block discarded – undo
206 206
 		}
207 207
 
208 208
 		foreach ( $defaults as $opt => $default ) {
209
-			$values[ $opt ] = $field->field_options[ $opt ] ?? $default;
209
+			$values[$opt] = $field->field_options[$opt] ?? $default;
210 210
 
211 211
 			if ( $check_post ) {
212
-				self::get_posted_field_setting( $opt . '_' . $field->id, $values[ $opt ] );
212
+				self::get_posted_field_setting( $opt . '_' . $field->id, $values[$opt] );
213 213
 			}
214 214
 		}
215 215
 	}
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
 			return self::$context_is_safe_to_load_field_options_from_request_data;
227 227
 		}
228 228
 
229
-		$function = function () {
229
+		$function = function() {
230 230
 			if ( ! FrmAppHelper::is_admin_page() ) {
231 231
 				return false;
232 232
 			}
@@ -338,12 +338,12 @@  discard block
 block discarded – undo
338 338
 	 * @return void
339 339
 	 */
340 340
 	private static function get_posted_field_setting( $setting, &$value ) {
341
-		if ( ! isset( $_POST['field_options'][ $setting ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
341
+		if ( ! isset( $_POST['field_options'][$setting] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
342 342
 			return;
343 343
 		}
344 344
 
345 345
 		if ( strpos( $setting, 'html' ) !== false ) {
346
-			$value = wp_unslash( $_POST['field_options'][ $setting ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
346
+			$value = wp_unslash( $_POST['field_options'][$setting] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
347 347
 
348 348
 			// Conditionally strip script tags if the user sending $_POST data is not allowed to use unfiltered HTML.
349 349
 			if ( ! FrmAppHelper::allow_unfiltered_html() ) {
@@ -351,9 +351,9 @@  discard block
 block discarded – undo
351 351
 			}
352 352
 		} elseif ( strpos( $setting, 'format_' ) === 0 ) {
353 353
 			// TODO: Remove stripslashes on output, and use on input only.
354
-			$value = sanitize_text_field( $_POST['field_options'][ $setting ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.NonceVerification.Missing
354
+			$value = sanitize_text_field( $_POST['field_options'][$setting] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.NonceVerification.Missing
355 355
 		} else {
356
-			$value = wp_unslash( $_POST['field_options'][ $setting ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
356
+			$value = wp_unslash( $_POST['field_options'][$setting] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
357 357
 			FrmAppHelper::sanitize_value( 'wp_kses_post', $value );
358 358
 		}
359 359
 	}
@@ -436,7 +436,7 @@  discard block
 block discarded – undo
436 436
 		$values['default_value'] = FrmAppHelper::maybe_json_encode( $field->default_value );
437 437
 
438 438
 		foreach ( array( 'name', 'description', 'type', 'field_order', 'field_options', 'required' ) as $col ) {
439
-			$values[ $col ] = $field->{$col};
439
+			$values[$col] = $field->{$col};
440 440
 		}
441 441
 	}
442 442
 
@@ -482,7 +482,7 @@  discard block
 block discarded – undo
482 482
 		$defaults = apply_filters( 'frm_default_field_validation_messages', $defaults, $field );
483 483
 
484 484
 		$msg = FrmField::get_option( $field, $error );
485
-		$msg = empty( $msg ) ? $defaults[ $error ]['part'] : $msg;
485
+		$msg = empty( $msg ) ? $defaults[$error]['part'] : $msg;
486 486
 		$msg = do_shortcode( $msg );
487 487
 
488 488
 		$msg = self::maybe_replace_substrings_with_field_name( $msg, $error, $field );
@@ -806,7 +806,7 @@  discard block
 block discarded – undo
806 806
 			'inside_class' => 'inside',
807 807
 			'dismiss-icon' => true,
808 808
 		);
809
-		$args     = array_merge( $defaults, $args );
809
+		$args = array_merge( $defaults, $args );
810 810
 
811 811
 		include FrmAppHelper::plugin_path() . '/classes/views/frm-fields/back-end/inline-modal.php';
812 812
 	}
@@ -1090,7 +1090,7 @@  discard block
 block discarded – undo
1090 1090
 				continue;
1091 1091
 			}
1092 1092
 
1093
-			$atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[3][ $short_key ] );
1093
+			$atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[3][$short_key] );
1094 1094
 			$tag  = FrmShortcodeHelper::get_shortcode_tag( $shortcodes, $short_key );
1095 1095
 
1096 1096
 			$atts['entry'] = $entry;
@@ -1100,7 +1100,7 @@  discard block
 block discarded – undo
1100 1100
 			if ( $replace_with !== null ) {
1101 1101
 				$replace_with = self::trigger_shortcode_atts( $replace_with, $atts );
1102 1102
 				self::sanitize_embedded_shortcodes( compact( 'entry' ), $replace_with );
1103
-				$content = str_replace( $shortcodes[0][ $short_key ], $replace_with, $content );
1103
+				$content = str_replace( $shortcodes[0][$short_key], $replace_with, $content );
1104 1104
 			}
1105 1105
 
1106 1106
 			unset( $atts, $replace_with );
@@ -1118,7 +1118,7 @@  discard block
 block discarded – undo
1118 1118
 		$supported_atts = array( 'remove_accents', 'sanitize', 'sanitize_url' );
1119 1119
 		$included_atts  = array_intersect( $supported_atts, array_keys( $atts ) );
1120 1120
 		foreach ( $included_atts as $included_att ) {
1121
-			if ( '0' === $atts[ $included_att ] ) {
1121
+			if ( '0' === $atts[$included_att] ) {
1122 1122
 				// Skip any option that uses 0 so sanitize_url=0 does not encode.
1123 1123
 				continue;
1124 1124
 			}
@@ -1196,8 +1196,8 @@  discard block
 block discarded – undo
1196 1196
 
1197 1197
 		$dynamic_default = array( 'admin_email', 'siteurl', 'frmurl', 'sitename', 'get', 'default-email', 'default-from-email' );
1198 1198
 
1199
-		if ( isset( $shortcode_values[ $atts['tag'] ] ) ) {
1200
-			$replace_with = $shortcode_values[ $atts['tag'] ];
1199
+		if ( isset( $shortcode_values[$atts['tag']] ) ) {
1200
+			$replace_with = $shortcode_values[$atts['tag']];
1201 1201
 		} elseif ( in_array( $atts['tag'], $dynamic_default, true ) ) {
1202 1202
 			$replace_with = self::dynamic_default_values( $atts['tag'], $atts );
1203 1203
 		} elseif ( $clean_tag === 'user_agent' ) {
@@ -1443,8 +1443,8 @@  discard block
 block discarded – undo
1443 1443
 			self::field_types_for_input( $single_input, $field_selection, $field_types );
1444 1444
 		} elseif ( in_array( $type, $multiple_input, true ) ) {
1445 1445
 			self::field_types_for_input( $multiple_input, $field_selection, $field_types );
1446
-		} elseif ( isset( $field_selection[ $type ] ) ) {
1447
-			$field_types[ $type ] = $field_selection[ $type ];
1446
+		} elseif ( isset( $field_selection[$type] ) ) {
1447
+			$field_types[$type] = $field_selection[$type];
1448 1448
 		}
1449 1449
 
1450 1450
 		$field_types = apply_filters( 'frm_switch_field_types', $field_types, compact( 'type', 'field_selection' ) );
@@ -1488,7 +1488,7 @@  discard block
 block discarded – undo
1488 1488
 		foreach ( $inputs as $input ) {
1489 1489
 			// This may not be set if a field type was removed using the frm_available_fields or frm_pro_available_fields filters.
1490 1490
 			if ( array_key_exists( $input, $fields ) ) {
1491
-				$field_types[ $input ] = $fields[ $input ];
1491
+				$field_types[$input] = $fields[$input];
1492 1492
 			}
1493 1493
 			unset( $input );
1494 1494
 		}
@@ -1523,7 +1523,7 @@  discard block
 block discarded – undo
1523 1523
 			'parent'  => false,
1524 1524
 			'pointer' => false,
1525 1525
 		);
1526
-		$args     = wp_parse_args( $args, $defaults );
1526
+		$args = wp_parse_args( $args, $defaults );
1527 1527
 
1528 1528
 		$opt_key   = $args['opt_key'];
1529 1529
 		$field     = $args['field'];
@@ -1539,25 +1539,25 @@  discard block
 block discarded – undo
1539 1539
 
1540 1540
 		// Check posted vals before checking saved values
1541 1541
 		// For fields inside repeating sections - note, don't check if $pointer is true because it will often be zero
1542
-		if ( $parent && isset( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
1542
+		if ( $parent && isset( $_POST['item_meta'][$parent][$pointer]['other'][$field['id']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
1543 1543
 			if ( FrmField::is_field_with_multiple_values( $field ) ) {
1544 1544
 				// phpcs:ignore WordPress.Security.NonceVerification.Missing
1545
-				$other_val = isset( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ][ $opt_key ] ) ? sanitize_text_field( wp_unslash( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ][ $opt_key ] ) ) : '';
1545
+				$other_val = isset( $_POST['item_meta'][$parent][$pointer]['other'][$field['id']][$opt_key] ) ? sanitize_text_field( wp_unslash( $_POST['item_meta'][$parent][$pointer]['other'][$field['id']][$opt_key] ) ) : '';
1546 1546
 			} else {
1547
-				$other_val = sanitize_text_field( wp_unslash( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing
1547
+				$other_val = sanitize_text_field( wp_unslash( $_POST['item_meta'][$parent][$pointer]['other'][$field['id']] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing
1548 1548
 			}
1549 1549
 
1550 1550
 			return $other_val;
1551 1551
 		}
1552 1552
 
1553
-		if ( isset( $field['id'] ) && isset( $_POST['item_meta']['other'][ $field['id'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
1553
+		if ( isset( $field['id'] ) && isset( $_POST['item_meta']['other'][$field['id']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
1554 1554
 			// For normal fields
1555 1555
 
1556 1556
 			if ( FrmField::is_field_with_multiple_values( $field ) ) {
1557 1557
 				// phpcs:ignore WordPress.Security.NonceVerification.Missing
1558
-				$other_val = isset( $_POST['item_meta']['other'][ $field['id'] ][ $opt_key ] ) ? sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][ $field['id'] ][ $opt_key ] ) ) : '';
1558
+				$other_val = isset( $_POST['item_meta']['other'][$field['id']][$opt_key] ) ? sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][$field['id']][$opt_key] ) ) : '';
1559 1559
 			} else {
1560
-				$other_val = sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][ $field['id'] ] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing
1560
+				$other_val = sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][$field['id']] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing
1561 1561
 			}
1562 1562
 
1563 1563
 			return $other_val;
@@ -1567,8 +1567,8 @@  discard block
 block discarded – undo
1567 1567
 		if ( $field['type'] === 'checkbox' && is_array( $field['value'] ) ) {
1568 1568
 			// Check if there is an "other" val in saved value and make sure the
1569 1569
 			// "other" val is not equal to the Other checkbox option
1570
-			if ( isset( $field['value'][ $opt_key ] ) && $field['options'][ $opt_key ] != $field['value'][ $opt_key ] ) {
1571
-				$other_val = $field['value'][ $opt_key ];
1570
+			if ( isset( $field['value'][$opt_key] ) && $field['options'][$opt_key] != $field['value'][$opt_key] ) {
1571
+				$other_val = $field['value'][$opt_key];
1572 1572
 			}
1573 1573
 		} else {
1574 1574
 			/**
@@ -1580,8 +1580,8 @@  discard block
 block discarded – undo
1580 1580
 				// Multi-select dropdowns - key is not preserved
1581 1581
 				if ( is_array( $field['value'] ) ) {
1582 1582
 					$o_key = array_search( $temp_val, $field['value'] );
1583
-					if ( isset( $field['value'][ $o_key ] ) ) {
1584
-						unset( $field['value'][ $o_key ], $o_key );
1583
+					if ( isset( $field['value'][$o_key] ) ) {
1584
+						unset( $field['value'][$o_key], $o_key );
1585 1585
 					}
1586 1586
 				} elseif ( $temp_val == $field['value'] ) {
1587 1587
 					// For radio and regular dropdowns
@@ -1806,11 +1806,11 @@  discard block
 block discarded – undo
1806 1806
 			foreach ( $val as $k => $v ) {
1807 1807
 				if ( is_string( $v ) ) {
1808 1808
 					if ( 'custom_html' === $k ) {
1809
-						$val[ $k ] = self::switch_ids_except_strings( $replace, $replace_with, array( '[if description]', '[description]', '[/if description]' ), $v );
1809
+						$val[$k] = self::switch_ids_except_strings( $replace, $replace_with, array( '[if description]', '[description]', '[/if description]' ), $v );
1810 1810
 						unset( $k, $v );
1811 1811
 						continue;
1812 1812
 					}
1813
-					$val[ $k ] = str_replace( $replace, $replace_with, $v );
1813
+					$val[$k] = str_replace( $replace, $replace_with, $v );
1814 1814
 					unset( $k, $v );
1815 1815
 				}
1816 1816
 			}
@@ -1839,8 +1839,8 @@  discard block
 block discarded – undo
1839 1839
 			if ( false === $index ) {
1840 1840
 				continue;
1841 1841
 			}
1842
-			unset( $replace[ $index ] );
1843
-			unset( $replace_with[ $index ] );
1842
+			unset( $replace[$index] );
1843
+			unset( $replace_with[$index] );
1844 1844
 		}
1845 1845
 		$value = str_replace( $replace, $replace_with, $value );
1846 1846
 		return $value;
@@ -2198,7 +2198,7 @@  discard block
 block discarded – undo
2198 2198
 			$countries['class'] = 'frm-countries-opts';
2199 2199
 		}
2200 2200
 
2201
-		$prepop[ __( 'Countries', 'formidable' ) ] = $countries;
2201
+		$prepop[__( 'Countries', 'formidable' )] = $countries;
2202 2202
 
2203 2203
 		// State abv.
2204 2204
 		$states    = self::get_us_states();
@@ -2208,7 +2208,7 @@  discard block
 block discarded – undo
2208 2208
 			$state_abv['class'] = 'frm-state-abv-opts';
2209 2209
 		}
2210 2210
 
2211
-		$prepop[ __( 'U.S. State Abbreviations', 'formidable' ) ] = $state_abv;
2211
+		$prepop[__( 'U.S. State Abbreviations', 'formidable' )] = $state_abv;
2212 2212
 
2213 2213
 		// States.
2214 2214
 		$states = array_values( $states );
@@ -2217,7 +2217,7 @@  discard block
 block discarded – undo
2217 2217
 			$states['class'] = 'frm-states-opts';
2218 2218
 		}
2219 2219
 
2220
-		$prepop[ __( 'U.S. States', 'formidable' ) ] = $states;
2220
+		$prepop[__( 'U.S. States', 'formidable' )] = $states;
2221 2221
 		unset( $state_abv, $states );
2222 2222
 
2223 2223
 		// Age.
@@ -2235,7 +2235,7 @@  discard block
 block discarded – undo
2235 2235
 			$ages['class'] = 'frm-age-opts';
2236 2236
 		}
2237 2237
 
2238
-		$prepop[ __( 'Age', 'formidable' ) ] = $ages;
2238
+		$prepop[__( 'Age', 'formidable' )] = $ages;
2239 2239
 
2240 2240
 		// Satisfaction.
2241 2241
 		$satisfaction = array(
@@ -2250,7 +2250,7 @@  discard block
 block discarded – undo
2250 2250
 			$satisfaction['class'] = 'frm-satisfaction-opts';
2251 2251
 		}
2252 2252
 
2253
-		$prepop[ __( 'Satisfaction', 'formidable' ) ] = $satisfaction;
2253
+		$prepop[__( 'Satisfaction', 'formidable' )] = $satisfaction;
2254 2254
 
2255 2255
 		// Importance.
2256 2256
 		$importance = array(
@@ -2265,7 +2265,7 @@  discard block
 block discarded – undo
2265 2265
 			$importance['class'] = 'frm-importance-opts';
2266 2266
 		}
2267 2267
 
2268
-		$prepop[ __( 'Importance', 'formidable' ) ] = $importance;
2268
+		$prepop[__( 'Importance', 'formidable' )] = $importance;
2269 2269
 
2270 2270
 		// Agreement.
2271 2271
 		$agreement = array(
@@ -2280,7 +2280,7 @@  discard block
 block discarded – undo
2280 2280
 			$agreement['class'] = 'frm-agreement-opts';
2281 2281
 		}
2282 2282
 
2283
-		$prepop[ __( 'Agreement', 'formidable' ) ] = $agreement;
2283
+		$prepop[__( 'Agreement', 'formidable' )] = $agreement;
2284 2284
 
2285 2285
 		// Likely.
2286 2286
 		$likely = array(
@@ -2295,7 +2295,7 @@  discard block
 block discarded – undo
2295 2295
 			$likely['class'] = 'frm-likely-opts';
2296 2296
 		}
2297 2297
 
2298
-		$prepop[ __( 'Likely', 'formidable' ) ] = $likely;
2298
+		$prepop[__( 'Likely', 'formidable' )] = $likely;
2299 2299
 
2300 2300
 		$prepop = apply_filters( 'frm_bulk_field_choices', $prepop );
2301 2301
 	}
@@ -2524,16 +2524,16 @@  discard block
 block discarded – undo
2524 2524
 	 */
2525 2525
 	private static function fill_image_setting_options( $options, &$args ) {
2526 2526
 		foreach ( $options as $key => $option ) {
2527
-			$args['options'][ $key ] = $option;
2527
+			$args['options'][$key] = $option;
2528 2528
 
2529 2529
 			if ( ! empty( $option['addon'] ) ) {
2530
-				$args['options'][ $key ]['custom_attrs'] = self::fill_image_setting_addon_link( $option );
2530
+				$args['options'][$key]['custom_attrs'] = self::fill_image_setting_addon_link( $option );
2531 2531
 			}
2532 2532
 
2533
-			unset( $args['options'][ $key ]['addon'] );
2533
+			unset( $args['options'][$key]['addon'] );
2534 2534
 			$fill = array( 'upgrade', 'message', 'content' );
2535 2535
 			foreach ( $fill as $f ) {
2536
-				unset( $args['options'][ $key ][ $f ], $f );
2536
+				unset( $args['options'][$key][$f], $f );
2537 2537
 			}
2538 2538
 		}
2539 2539
 	}
@@ -2556,8 +2556,8 @@  discard block
 block discarded – undo
2556 2556
 
2557 2557
 		$fill = array( 'upgrade', 'message', 'content' );
2558 2558
 		foreach ( $fill as $f ) {
2559
-			if ( isset( $option[ $f ] ) ) {
2560
-				$custom_attrs[ 'data-' . $f ] = $option[ $f ];
2559
+			if ( isset( $option[$f] ) ) {
2560
+				$custom_attrs['data-' . $f] = $option[$f];
2561 2561
 			}
2562 2562
 		}
2563 2563
 
@@ -2623,7 +2623,7 @@  discard block
 block discarded – undo
2623 2623
 
2624 2624
 		return array_filter(
2625 2625
 			$rows,
2626
-			function ( $row ) {
2626
+			function( $row ) {
2627 2627
 				FrmAppHelper::unserialize_or_decode( $row->field_options );
2628 2628
 				return is_array( $row->field_options ) && ! empty( $row->field_options['draft'] );
2629 2629
 			}
@@ -2688,7 +2688,7 @@  discard block
 block discarded – undo
2688 2688
 		if ( empty( $attributes['data-fid'] ) ) {
2689 2689
 			unset( $data['plugin-status'] );
2690 2690
 			foreach ( $data as $key => $value ) {
2691
-				$attributes[ 'data-' . $key ] = $value;
2691
+				$attributes['data-' . $key] = $value;
2692 2692
 			}
2693 2693
 		}
2694 2694
 
Please login to merge, or discard this patch.
classes/models/FrmFieldFormHtml.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -46,8 +46,8 @@  discard block
 block discarded – undo
46 46
 	 * @return void
47 47
 	 */
48 48
 	private function _set( $param, $atts ) {
49
-		if ( isset( $atts[ $param ] ) ) {
50
-			$this->{$param} = $atts[ $param ];
49
+		if ( isset( $atts[$param] ) ) {
50
+			$this->{$param} = $atts[$param];
51 51
 		}
52 52
 	}
53 53
 
@@ -97,8 +97,8 @@  discard block
 block discarded – undo
97 97
 
98 98
 		$exclude = array( 'field_obj', 'html' );
99 99
 		foreach ( $exclude as $ex ) {
100
-			if ( isset( $atts[ $ex ] ) ) {
101
-				unset( $this->pass_args[ $ex ] );
100
+			if ( isset( $atts[$ex] ) ) {
101
+				unset( $this->pass_args[$ex] );
102 102
 			}
103 103
 		}
104 104
 	}
@@ -112,8 +112,8 @@  discard block
 block discarded – undo
112 112
 	 * @return void
113 113
 	 */
114 114
 	private function set_from_field( $atts, $set ) {
115
-		if ( isset( $atts[ $set['param'] ] ) ) {
116
-			$this->{$set['param']} = $atts[ $set['param'] ];
115
+		if ( isset( $atts[$set['param']] ) ) {
116
+			$this->{$set['param']} = $atts[$set['param']];
117 117
 		} else {
118 118
 			$this->{$set['param']} = $this->field_obj->get_field_column( $set['default'] );
119 119
 		}
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
 	 */
265 265
 	private function replace_error_shortcode() {
266 266
 		$this->maybe_add_error_id();
267
-		$error = $this->pass_args['errors'][ 'field' . $this->field_id ] ?? false;
267
+		$error = $this->pass_args['errors']['field' . $this->field_id] ?? false;
268 268
 
269 269
 		if ( ! empty( $error ) && false === strpos( $this->html, 'role="alert"' ) && FrmAppHelper::should_include_alert_role_on_field_errors() ) {
270 270
 			$error_body = self::get_error_body( $this->html );
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
 	 * @return void
308 308
 	 */
309 309
 	private function maybe_add_error_id() {
310
-		if ( ! isset( $this->pass_args['errors'][ 'field' . $this->field_id ] ) ) {
310
+		if ( ! isset( $this->pass_args['errors']['field' . $this->field_id] ) ) {
311 311
 			return;
312 312
 		}
313 313
 
@@ -399,7 +399,7 @@  discard block
 block discarded – undo
399 399
 		preg_match_all( "/\[(input|deletelink)\b(.*?)(?:(\/))?\]/s", $this->html, $shortcodes, PREG_PATTERN_ORDER );
400 400
 
401 401
 		foreach ( $shortcodes[0] as $short_key => $tag ) {
402
-			$shortcode_atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[2][ $short_key ] );
402
+			$shortcode_atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[2][$short_key] );
403 403
 			$tag            = FrmShortcodeHelper::get_shortcode_tag( $shortcodes, $short_key );
404 404
 
405 405
 			$replace_with = '';
@@ -410,7 +410,7 @@  discard block
 block discarded – undo
410 410
 				$replace_with = $this->replace_input_shortcode( $shortcode_atts );
411 411
 			}
412 412
 
413
-			$this->html = str_replace( $shortcodes[0][ $short_key ], $replace_with, $this->html );
413
+			$this->html = str_replace( $shortcodes[0][$short_key], $replace_with, $this->html );
414 414
 		}
415 415
 	}
416 416
 
@@ -432,7 +432,7 @@  discard block
 block discarded – undo
432 432
 	 */
433 433
 	private function prepare_input_shortcode_atts( $shortcode_atts ) {
434 434
 		if ( isset( $shortcode_atts['opt'] ) ) {
435
-			--$shortcode_atts['opt'];
435
+			-- $shortcode_atts['opt'];
436 436
 		}
437 437
 
438 438
 		$field_class = $shortcode_atts['class'] ?? '';
@@ -502,7 +502,7 @@  discard block
 block discarded – undo
502 502
 	 */
503 503
 	private function get_field_div_classes() {
504 504
 		// Add error class
505
-		$classes = isset( $this->pass_args['errors'][ 'field' . $this->field_id ] ) ? ' frm_blank_field' : '';
505
+		$classes = isset( $this->pass_args['errors']['field' . $this->field_id] ) ? ' frm_blank_field' : '';
506 506
 
507 507
 		// Add label position class
508 508
 		$settings = $this->field_obj->display_field_settings();
@@ -583,7 +583,7 @@  discard block
 block discarded – undo
583 583
 		}
584 584
 
585 585
 		// Add 'aria-invalid' attribute to the group if there are errors.
586
-		if ( isset( $this->pass_args['errors'][ 'field' . $this->field_id ] ) ) {
586
+		if ( isset( $this->pass_args['errors']['field' . $this->field_id] ) ) {
587 587
 			$attributes['aria-invalid'] = 'true';
588 588
 		}
589 589
 
Please login to merge, or discard this patch.
classes/models/fields/FrmFieldType.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -160,8 +160,8 @@  discard block
 block discarded – undo
160 160
 		$field_val = '';
161 161
 		if ( is_object( $this->field ) ) {
162 162
 			$field_val = $this->field->{$column};
163
-		} elseif ( is_array( $this->field ) && isset( $this->field[ $column ] ) ) {
164
-			$field_val = $this->field[ $column ];
163
+		} elseif ( is_array( $this->field ) && isset( $this->field[$column] ) ) {
164
+			$field_val = $this->field[$column];
165 165
 		}
166 166
 
167 167
 		return $field_val;
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
 		if ( is_object( $this->field ) ) {
178 178
 			$this->field->{$column} = $value;
179 179
 		} elseif ( is_array( $this->field ) ) {
180
-			$this->field[ $column ] = $value;
180
+			$this->field[$column] = $value;
181 181
 		}
182 182
 	}
183 183
 
@@ -723,7 +723,7 @@  discard block
 block discarded – undo
723 723
 			printf(
724 724
 				/* translators: %s: Field type */
725 725
 				esc_html__( '%s Options', 'formidable' ),
726
-				esc_html( $all_field_types[ $args['display']['type'] ]['name'] )
726
+				esc_html( $all_field_types[$args['display']['type']]['name'] )
727 727
 			);
728 728
 			FrmAppHelper::icon_by_class( 'frmfont frm_arrowdown8_icon', array( 'aria-hidden' => 'true' ) );
729 729
 			?>
@@ -832,7 +832,7 @@  discard block
 block discarded – undo
832 832
 	 * @return array
833 833
 	 */
834 834
 	public function get_new_field_defaults() {
835
-		$field        = array(
835
+		$field = array(
836 836
 			'name'          => $this->get_new_field_name(),
837 837
 			'description'   => '',
838 838
 			'type'          => $this->type,
@@ -863,8 +863,8 @@  discard block
 block discarded – undo
863 863
 
864 864
 		$fields = array_merge( $fields, $pro_fields );
865 865
 
866
-		if ( isset( $fields[ $this->type ] ) ) {
867
-			$name = is_array( $fields[ $this->type ] ) ? $fields[ $this->type ]['name'] : $fields[ $this->type ];
866
+		if ( isset( $fields[$this->type] ) ) {
867
+			$name = is_array( $fields[$this->type] ) ? $fields[$this->type]['name'] : $fields[$this->type];
868 868
 		}
869 869
 
870 870
 		return $name;
@@ -881,7 +881,7 @@  discard block
 block discarded – undo
881 881
 	 * @return array
882 882
 	 */
883 883
 	public function get_default_field_options() {
884
-		$opts        = array(
884
+		$opts = array(
885 885
 			'size'               => '',
886 886
 			'max'                => '',
887 887
 			'label'              => '',
@@ -1135,7 +1135,7 @@  discard block
 block discarded – undo
1135 1135
 	 * @return void
1136 1136
 	 */
1137 1137
 	public function set_aria_invalid_error( &$shortcode_atts, $args ) {
1138
-		$shortcode_atts['aria-invalid'] = isset( $args['errors'][ 'field' . $this->field_id ] ) ? 'true' : 'false';
1138
+		$shortcode_atts['aria-invalid'] = isset( $args['errors']['field' . $this->field_id] ) ? 'true' : 'false';
1139 1139
 	}
1140 1140
 
1141 1141
 	/**
@@ -1316,11 +1316,11 @@  discard block
 block discarded – undo
1316 1316
 		}
1317 1317
 
1318 1318
 		$options = array_values( $this->field['options'] );
1319
-		if ( ! isset( $options[ $opt ] ) ) {
1319
+		if ( ! isset( $options[$opt] ) ) {
1320 1320
 			return $hidden;
1321 1321
 		}
1322 1322
 
1323
-		$option = $options[ $opt ];
1323
+		$option = $options[$opt];
1324 1324
 		if ( is_array( $option ) ) {
1325 1325
 			$option = $option['value'];
1326 1326
 		}
@@ -1403,8 +1403,8 @@  discard block
 block discarded – undo
1403 1403
 		$selected = $values['field_value'];
1404 1404
 
1405 1405
 		if ( isset( $values['combo_name'] ) ) {
1406
-			$options  = $options[ $values['combo_name'] ];
1407
-			$selected = is_array( $selected ) && isset( $selected[ $values['combo_name'] ] ) ? $selected[ $values['combo_name'] ] : '';
1406
+			$options  = $options[$values['combo_name']];
1407
+			$selected = is_array( $selected ) && isset( $selected[$values['combo_name']] ) ? $selected[$values['combo_name']] : '';
1408 1408
 		}
1409 1409
 
1410 1410
 		$input = $this->select_tag( $values );
@@ -1474,7 +1474,7 @@  discard block
 block discarded – undo
1474 1474
 	 * @return array
1475 1475
 	 */
1476 1476
 	protected function fill_display_field_values( $args = array() ) {
1477
-		$defaults        = array(
1477
+		$defaults = array(
1478 1478
 			'field_name'    => 'item_meta[' . $this->get_field_column( 'id' ) . ']',
1479 1479
 			'field_id'      => $this->get_field_column( 'id' ),
1480 1480
 			'field_plus_id' => '',
@@ -1536,7 +1536,7 @@  discard block
 block discarded – undo
1536 1536
 			}
1537 1537
 		}
1538 1538
 
1539
-		if ( isset( $args['errors'][ 'field' . $args['field_id'] ] ) && ! $custom_error_fields ) {
1539
+		if ( isset( $args['errors']['field' . $args['field_id']] ) && ! $custom_error_fields ) {
1540 1540
 			if ( $error_comes_first ) {
1541 1541
 				array_unshift( $describedby, 'frm_error_' . $args['html_id'] );
1542 1542
 			} else {
@@ -1618,11 +1618,11 @@  discard block
 block discarded – undo
1618 1618
 
1619 1619
 		$field_id = $this->get_field_column( 'id' );
1620 1620
 		if ( ! array_key_exists( $field_id, $frm_validated_unique_values ) ) {
1621
-			$frm_validated_unique_values[ $field_id ] = array();
1621
+			$frm_validated_unique_values[$field_id] = array();
1622 1622
 			return false;
1623 1623
 		}
1624 1624
 
1625
-		$already_validated_this_value = in_array( $value, $frm_validated_unique_values[ $field_id ], true );
1625
+		$already_validated_this_value = in_array( $value, $frm_validated_unique_values[$field_id], true );
1626 1626
 		return $already_validated_this_value;
1627 1627
 	}
1628 1628
 
@@ -1649,7 +1649,7 @@  discard block
 block discarded – undo
1649 1649
 	private function value_validated_as_unique( $value ) {
1650 1650
 		global $frm_validated_unique_values;
1651 1651
 		$field_id                                   = $this->get_field_column( 'id' );
1652
-		$frm_validated_unique_values[ $field_id ][] = $value;
1652
+		$frm_validated_unique_values[$field_id][] = $value;
1653 1653
 	}
1654 1654
 
1655 1655
 	/**
@@ -1694,8 +1694,8 @@  discard block
 block discarded – undo
1694 1694
 		$value = $this->prepare_display_value( $value, $atts );
1695 1695
 
1696 1696
 		if ( is_array( $value ) ) {
1697
-			if ( ! empty( $atts['show'] ) && isset( $value[ $atts['show'] ] ) ) {
1698
-				$value = $value[ $atts['show'] ];
1697
+			if ( ! empty( $atts['show'] ) && isset( $value[$atts['show']] ) ) {
1698
+				$value = $value[$atts['show']];
1699 1699
 			} elseif ( empty( $atts['return_array'] ) ) {
1700 1700
 				$sep   = $atts['sep'] ?? ', ';
1701 1701
 				$value = FrmAppHelper::safe_implode( $sep, $value );
@@ -1825,8 +1825,8 @@  discard block
 block discarded – undo
1825 1825
 		$saved_entries = $atts['ids'];
1826 1826
 		$new_value     = array();
1827 1827
 		foreach ( (array) $value as $old_child_id ) {
1828
-			if ( isset( $saved_entries[ $old_child_id ] ) ) {
1829
-				$new_value[] = $saved_entries[ $old_child_id ];
1828
+			if ( isset( $saved_entries[$old_child_id] ) ) {
1829
+				$new_value[] = $saved_entries[$old_child_id];
1830 1830
 			}
1831 1831
 		}
1832 1832
 
Please login to merge, or discard this patch.
classes/models/FrmEntryFormatter.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -169,8 +169,8 @@  discard block
 block discarded – undo
169 169
 
170 170
 		$conditionally_add = array( 'include_fields', 'fields', 'exclude_fields', 'entry' );
171 171
 		foreach ( $conditionally_add as $index ) {
172
-			if ( isset( $atts[ $index ] ) ) {
173
-				$entry_atts[ $index ] = $atts[ $index ];
172
+			if ( isset( $atts[$index] ) ) {
173
+				$entry_atts[$index] = $atts[$index];
174 174
 			}
175 175
 		}
176 176
 
@@ -376,8 +376,8 @@  discard block
 block discarded – undo
376 376
 
377 377
 		$unset = array( 'id', 'form_id', 'format' );
378 378
 		foreach ( $unset as $param ) {
379
-			if ( isset( $atts[ $param ] ) ) {
380
-				unset( $atts[ $param ] );
379
+			if ( isset( $atts[$param] ) ) {
380
+				unset( $atts[$param] );
381 381
 			}
382 382
 		}
383 383
 
@@ -553,11 +553,11 @@  discard block
 block discarded – undo
553 553
 
554 554
 			$displayed_value = $this->prepare_display_value_for_array( $field_value->get_displayed_value() );
555 555
 
556
-			$output[ $this->get_key_or_id( $field_value ) ] = $displayed_value;
556
+			$output[$this->get_key_or_id( $field_value )] = $displayed_value;
557 557
 
558 558
 			$has_separate_value = (bool) $field_value->get_field_option( 'separate_value' );
559 559
 			if ( $has_separate_value || $displayed_value !== $field_value->get_saved_value() ) {
560
-				$output[ $this->get_key_or_id( $field_value ) . '-value' ] = $field_value->get_saved_value();
560
+				$output[$this->get_key_or_id( $field_value ) . '-value'] = $field_value->get_saved_value();
561 561
 			}
562 562
 		}
563 563
 	}
@@ -975,7 +975,7 @@  discard block
 block discarded – undo
975 975
 		if ( $this->is_plain_text ) {
976 976
 			if ( is_array( $value ) ) {
977 977
 				foreach ( $value as $key => $single_value ) {
978
-					$value[ $key ] = $this->strip_html( $single_value );
978
+					$value[$key] = $this->strip_html( $single_value );
979 979
 				}
980 980
 			} elseif ( $this->is_plain_text && ! is_array( $value ) ) {
981 981
 				if ( strpos( $value, '<img' ) !== false ) {
Please login to merge, or discard this patch.
classes/models/FrmFormMigrator.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 	/**
39 39
 	 * @var array
40 40
 	 */
41
-	protected $fields_map          = array();
41
+	protected $fields_map = array();
42 42
 
43 43
 	/**
44 44
 	 * @var mixed
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 	/**
49 49
 	 * @var array
50 50
 	 */
51
-	protected $current_section     = array();
51
+	protected $current_section = array();
52 52
 
53 53
 	/**
54 54
 	 * Define required properties.
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
 
316 316
 			// This may occasionally skip one level/order e.g. after adding a
317 317
 			// list field, as field_order would already be prepared to be used.
318
-			++$field_order;
318
+			++ $field_order;
319 319
 
320 320
 			if ( ! empty( $new_field['fields'] ) && is_array( $new_field['fields'] ) ) {
321 321
 				// we have (inner) fields to merge
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
 
365 365
 		$order = 0;
366 366
 		foreach ( $fields as $field ) {
367
-			++$order;
367
+			++ $order;
368 368
 			$type     = $this->get_field_type( $field );
369 369
 			$new_type = $this->convert_field_type( $type, $field );
370 370
 			if ( ! in_array( $new_type, $with_end ) && $new_type !== 'break' ) {
@@ -399,7 +399,7 @@  discard block
 block discarded – undo
399 399
 		$sub['name'] = __( 'Section Buttons', 'formidable' );
400 400
 		$subs        = array( $sub );
401 401
 		$this->insert_fields_in_array( $subs, $order, 0, $fields );
402
-		++$order;
402
+		++ $order;
403 403
 	}
404 404
 
405 405
 	/**
@@ -513,7 +513,7 @@  discard block
 block discarded – undo
513 513
 	protected function create_fields( $form_id, &$form ) {
514 514
 		foreach ( $form['fields'] as $key => $new_field ) {
515 515
 			$new_field['form_id']         = $form_id;
516
-			$form['fields'][ $key ]['id'] = FrmField::create( $new_field );
516
+			$form['fields'][$key]['id'] = FrmField::create( $new_field );
517 517
 		}
518 518
 	}
519 519
 
@@ -554,9 +554,9 @@  discard block
 block discarded – undo
554 554
 			} elseif ( $key === 'the_post_title' ) {
555 555
 				$new_action->post_content['post_title'] = $value;
556 556
 			} elseif ( is_string( $value ) ) {
557
-				$new_action->post_content[ $key ] = $this->replace_smart_tags( $value, $form['fields'] );
557
+				$new_action->post_content[$key] = $this->replace_smart_tags( $value, $form['fields'] );
558 558
 			} else {
559
-				$new_action->post_content[ $key ] = $value;
559
+				$new_action->post_content[$key] = $value;
560 560
 			}
561 561
 		}
562 562
 
@@ -577,7 +577,7 @@  discard block
 block discarded – undo
577 577
 
578 578
 		$imported = $this->get_tracked_import();
579 579
 
580
-		$imported[ $this->slug ][ $new_form_id ] = $source_id;
580
+		$imported[$this->slug][$new_form_id] = $source_id;
581 581
 
582 582
 		update_option( $this->tracking, $imported, false );
583 583
 	}
@@ -597,11 +597,11 @@  discard block
 block discarded – undo
597 597
 	private function is_imported( $source_id ) {
598 598
 		$imported    = $this->get_tracked_import();
599 599
 		$new_form_id = 0;
600
-		if ( ! isset( $imported[ $this->slug ] ) || ! in_array( $source_id, $imported[ $this->slug ] ) ) {
600
+		if ( ! isset( $imported[$this->slug] ) || ! in_array( $source_id, $imported[$this->slug] ) ) {
601 601
 			return $new_form_id;
602 602
 		}
603 603
 
604
-		$new_form_id = array_search( $source_id, array_reverse( $imported[ $this->slug ], true ) );
604
+		$new_form_id = array_search( $source_id, array_reverse( $imported[$this->slug], true ) );
605 605
 		if ( ! empty( $new_form_id ) && empty( FrmForm::get_key_by_id( $new_form_id ) ) ) {
606 606
 			// Allow reimport if the form was deleted.
607 607
 			$new_form_id = 0;
Please login to merge, or discard this patch.
classes/models/FrmCreateFile.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -33,12 +33,12 @@
 block discarded – undo
33 33
 	/**
34 34
 	 * @var int
35 35
 	 */
36
-	public $chmod_dir       = 0755;
36
+	public $chmod_dir = 0755;
37 37
 
38 38
 	/**
39 39
 	 * @var int
40 40
 	 */
41
-	public $chmod_file      = 0644;
41
+	public $chmod_file = 0644;
42 42
 
43 43
 	/**
44 44
 	 * @var bool
Please login to merge, or discard this patch.
classes/helpers/FrmTipsHelper.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 			'page'  => '',
46 46
 			'class' => 'frm-mt-0',
47 47
 		);
48
-		$tip      = array_merge( $defaults, $tip );
48
+		$tip = array_merge( $defaults, $tip );
49 49
 
50 50
 		if ( isset( $tip['link'] ) && ! isset( $tip['link']['medium'] ) ) {
51 51
 			$tip['link']['medium'] = 'tip';
@@ -402,7 +402,7 @@  discard block
 block discarded – undo
402 402
 		}
403 403
 
404 404
 		$random = random_int( 0, $count - 1 );
405
-		return $tips[ $random ];
405
+		return $tips[$random];
406 406
 	}
407 407
 
408 408
 	/**
Please login to merge, or discard this patch.
stripe/controllers/FrmStrpLiteAppController.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -152,13 +152,13 @@  discard block
 block discarded – undo
152 152
 
153 153
 		$is_setup_intent = 0 === strpos( $intent->id, 'seti_' );
154 154
 		if ( $is_setup_intent ) {
155
-			$errors[ 'field' . $cc_field_id ] = is_object( $intent->last_setup_error ) ? $intent->last_setup_error->message : '';
155
+			$errors['field' . $cc_field_id] = is_object( $intent->last_setup_error ) ? $intent->last_setup_error->message : '';
156 156
 		} else {
157
-			$errors[ 'field' . $cc_field_id ] = is_object( $intent->last_payment_error ) ? $intent->last_payment_error->message : '';
157
+			$errors['field' . $cc_field_id] = is_object( $intent->last_payment_error ) ? $intent->last_payment_error->message : '';
158 158
 		}
159 159
 
160
-		if ( ! $errors[ 'field' . $cc_field_id ] ) {
161
-			$errors[ 'field' . $cc_field_id ] = 'Payment was not successfully processed.';
160
+		if ( ! $errors['field' . $cc_field_id] ) {
161
+			$errors['field' . $cc_field_id] = 'Payment was not successfully processed.';
162 162
 		}
163 163
 
164 164
 		global $frm_vars;
@@ -187,10 +187,10 @@  discard block
 block discarded – undo
187 187
 		$save_draft = ! empty( $form->options['save_draft'] );
188 188
 
189 189
 		global $frm_vars;
190
-		$frm_vars['created_entries'][ $form_id ]['errors'] = $errors;
190
+		$frm_vars['created_entries'][$form_id]['errors'] = $errors;
191 191
 
192 192
 		// Set to true to get FrmProFieldsHelper::get_page_with_error() run.
193
-		$_POST[ 'frm_page_order_' . $form_id ] = true;
193
+		$_POST['frm_page_order_' . $form_id] = true;
194 194
 
195 195
 		if ( ! $save_draft ) {
196 196
 			// If draft saving is not on, delete the entry.
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
 		}
200 200
 
201 201
 		// If draft saving is on, load the draft entry.
202
-		$frm_vars['created_entries'][ $form_id ]['entry_id'] = $entry_id;
202
+		$frm_vars['created_entries'][$form_id]['entry_id'] = $entry_id;
203 203
 		add_action(
204 204
 			'frm_filter_final_form',
205 205
 			/**
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
 			 *
211 211
 			 * @return string
212 212
 			 */
213
-			function ( $html ) use ( $entry_id ) {
213
+			function( $html ) use ( $entry_id ) {
214 214
 				global $wpdb;
215 215
 				$wpdb->update( $wpdb->prefix . 'frm_items', array( 'is_draft' => 1 ), array( 'id' => $entry_id ) );
216 216
 				return $html;
Please login to merge, or discard this patch.