Completed
Push — master ( 49319d...867d5a )
by Stephanie
02:43 queued 10s
created
css/_single_theme.css.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -129,11 +129,11 @@  discard block
 block discarded – undo
129 129
 <?php } ?>
130 130
 
131 131
 .<?php echo esc_html( $style_class ); ?> .frm_icon_font.frm_minus_icon:before{
132
-	content:"\e<?php echo esc_html( isset( $minus_icons[ $repeat_icon ] ) ? $minus_icons[ $repeat_icon ]['-'] : $minus_icons[1]['-'] ); ?>";
132
+	content:"\e<?php echo esc_html( isset( $minus_icons[$repeat_icon] ) ? $minus_icons[$repeat_icon]['-'] : $minus_icons[1]['-'] ); ?>";
133 133
 }
134 134
 
135 135
 .<?php echo esc_html( $style_class ); ?> .frm_icon_font.frm_plus_icon:before{
136
-	content:"\e<?php echo esc_html( isset( $minus_icons[ $repeat_icon ] ) ? $minus_icons[ $repeat_icon ]['+'] : $minus_icons[1]['+'] ); ?>";
136
+	content:"\e<?php echo esc_html( isset( $minus_icons[$repeat_icon] ) ? $minus_icons[$repeat_icon]['+'] : $minus_icons[1]['+'] ); ?>";
137 137
 }
138 138
 
139 139
 .<?php echo esc_html( $style_class ); ?> .frm_icon_font.frm_minus_icon:before,
@@ -145,14 +145,14 @@  discard block
 block discarded – undo
145 145
 }
146 146
 
147 147
 .<?php echo esc_html( $style_class ); ?> .frm_trigger.active .frm_icon_font.frm_arrow_icon:before{
148
-	content:"\e<?php echo esc_html( isset( $arrow_icons[ $collapse_icon ] ) ? $arrow_icons[ $collapse_icon ]['-'] : $arrow_icons[1]['-'] ); ?>";
148
+	content:"\e<?php echo esc_html( isset( $arrow_icons[$collapse_icon] ) ? $arrow_icons[$collapse_icon]['-'] : $arrow_icons[1]['-'] ); ?>";
149 149
 	<?php if ( ! empty( $section_color ) ) { ?>
150 150
 		color:<?php echo esc_html( $section_color . $important ); ?>;
151 151
 	<?php } ?>
152 152
 }
153 153
 
154 154
 .<?php echo esc_html( $style_class ); ?> .frm_trigger .frm_icon_font.frm_arrow_icon:before{
155
-	content:"\e<?php echo esc_html( isset( $arrow_icons[ $collapse_icon ] ) ? $arrow_icons[ $collapse_icon ]['+'] : $arrow_icons[1]['+'] ); ?>";
155
+	content:"\e<?php echo esc_html( isset( $arrow_icons[$collapse_icon] ) ? $arrow_icons[$collapse_icon]['+'] : $arrow_icons[1]['+'] ); ?>";
156 156
 	<?php if ( ! empty( $section_color ) ) { ?>
157 157
 		color:<?php echo esc_html( $section_color . $important ); ?>;
158 158
 	<?php } ?>
Please login to merge, or discard this patch.
classes/controllers/FrmInboxController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
 	private static function get_notice_count() {
25 25
 		FrmFormMigratorsHelper::maybe_add_to_inbox();
26 26
 
27
-		$inbox  = new FrmInbox();
27
+		$inbox = new FrmInbox();
28 28
 		return $inbox->unread_html();
29 29
 	}
30 30
 
Please login to merge, or discard this patch.
classes/helpers/FrmAppHelper.php 2 patches
Doc Comments   +25 added lines patch added patch discarded remove patch
@@ -69,6 +69,9 @@  discard block
 block discarded – undo
69 69
 		return $url;
70 70
 	}
71 71
 
72
+	/**
73
+	 * @return string
74
+	 */
72 75
 	public static function get_affiliate() {
73 76
 		return absint( apply_filters( 'frm_affiliate_id', 0 ) );
74 77
 	}
@@ -134,6 +137,9 @@  discard block
 block discarded – undo
134 137
 		return $frm_settings;
135 138
 	}
136 139
 
140
+	/**
141
+	 * @return string
142
+	 */
137 143
 	public static function get_menu_name() {
138 144
 		$frm_settings = self::get_settings();
139 145
 
@@ -1063,6 +1069,8 @@  discard block
 block discarded – undo
1063 1069
 	 * This is for reverse compatibility with switching 3 params to 1.
1064 1070
 	 *
1065 1071
 	 * @since 4.03.06
1072
+	 * @param string $page_id
1073
+	 * @param boolean $truncate
1066 1074
 	 */
1067 1075
 	private static function prep_page_dropdown_params( $page_id, $truncate, &$args ) {
1068 1076
 		if ( ! is_array( $args ) ) {
@@ -1300,6 +1308,9 @@  discard block
 block discarded – undo
1300 1308
 		return ( is_array( $values ) && in_array( $current, $values ) ) || ( ! is_array( $values ) && $values == $current );
1301 1309
 	}
1302 1310
 
1311
+	/**
1312
+	 * @param string $function
1313
+	 */
1303 1314
 	public static function recursive_function_map( $value, $function ) {
1304 1315
 		if ( is_array( $value ) ) {
1305 1316
 			$original_function = $function;
@@ -1348,6 +1359,9 @@  discard block
 block discarded – undo
1348 1359
 		return $return;
1349 1360
 	}
1350 1361
 
1362
+	/**
1363
+	 * @return string
1364
+	 */
1351 1365
 	public static function esc_textarea( $text, $is_rich_text = false ) {
1352 1366
 		$safe_text = str_replace( '&quot;', '"', $text );
1353 1367
 		if ( ! $is_rich_text ) {
@@ -1548,6 +1562,9 @@  discard block
 block discarded – undo
1548 1562
 		return $values;
1549 1563
 	}
1550 1564
 
1565
+	/**
1566
+	 * @param string $fields
1567
+	 */
1551 1568
 	private static function prepare_field_arrays( $fields, $record, array &$values, $args ) {
1552 1569
 		if ( ! empty( $fields ) ) {
1553 1570
 			foreach ( (array) $fields as $field ) {
@@ -1754,6 +1771,9 @@  discard block
 block discarded – undo
1754 1771
 		return $sub . ( ( $len < $original_len ) ? $continue : '' );
1755 1772
 	}
1756 1773
 
1774
+	/**
1775
+	 * @param string[] $function_names
1776
+	 */
1757 1777
 	public static function mb_function( $function_names, $args ) {
1758 1778
 		$mb_function_name = $function_names[0];
1759 1779
 		$function_name    = $function_names[1];
@@ -1788,6 +1808,9 @@  discard block
 block discarded – undo
1788 1808
 		return $formatted;
1789 1809
 	}
1790 1810
 
1811
+	/**
1812
+	 * @param string $time_format
1813
+	 */
1791 1814
 	private static function add_time_to_date( $time_format, $date ) {
1792 1815
 		if ( empty( $time_format ) ) {
1793 1816
 			$time_format = get_option( 'time_format' );
@@ -1898,6 +1921,7 @@  discard block
 block discarded – undo
1898 1921
 
1899 1922
 	/**
1900 1923
 	 * @since 4.05.01
1924
+	 * @param string $from
1901 1925
 	 */
1902 1926
 	private static function convert_time( $from, $to ) {
1903 1927
 		$convert = array(
@@ -2371,6 +2395,7 @@  discard block
 block discarded – undo
2371 2395
 	 * If Pro is far outdated, show a message.
2372 2396
 	 *
2373 2397
 	 * @since 4.0.01
2398
+	 * @param string $min_version
2374 2399
 	 */
2375 2400
 	public static function min_pro_version_notice( $min_version ) {
2376 2401
 		if ( ! self::is_formidable_admin() ) {
Please login to merge, or discard this patch.
Spacing   +69 added lines, -69 removed lines patch added patch discarded remove patch
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
 			'fill'   => '#4d4d4d',
151 151
 			'orange' => '#f05a24',
152 152
 		);
153
-		$atts     = array_merge( $defaults, $atts );
153
+		$atts = array_merge( $defaults, $atts );
154 154
 
155 155
 		return '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 599.68 601.37" width="' . esc_attr( $atts['width'] ) . '" height="' . esc_attr( $atts['height'] ) . '">
156 156
 			<path fill="' . esc_attr( $atts['orange'] ) . '" d="M289.6 384h140v76h-140z"/>
@@ -349,7 +349,7 @@  discard block
 block discarded – undo
349 349
 	 * @return string
350 350
 	 */
351 351
 	public static function get_server_value( $value ) {
352
-		return isset( $_SERVER[ $value ] ) ? wp_strip_all_tags( wp_unslash( $_SERVER[ $value ] ) ) : '';
352
+		return isset( $_SERVER[$value] ) ? wp_strip_all_tags( wp_unslash( $_SERVER[$value] ) ) : '';
353 353
 	}
354 354
 
355 355
 	/**
@@ -372,7 +372,7 @@  discard block
 block discarded – undo
372 372
 		);
373 373
 		$ip = '';
374 374
 		foreach ( $ip_options as $key ) {
375
-			if ( ! isset( $_SERVER[ $key ] ) ) {
375
+			if ( ! isset( $_SERVER[$key] ) ) {
376 376
 				continue;
377 377
 			}
378 378
 
@@ -397,10 +397,10 @@  discard block
 block discarded – undo
397 397
 
398 398
 		if ( $src == 'get' ) {
399 399
 			// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
400
-			$value = isset( $_POST[ $param ] ) ? wp_unslash( $_POST[ $param ] ) : ( isset( $_GET[ $param ] ) ? wp_unslash( $_GET[ $param ] ) : $default );
401
-			if ( ! isset( $_POST[ $param ] ) && isset( $_GET[ $param ] ) && ! is_array( $value ) ) {
400
+			$value = isset( $_POST[$param] ) ? wp_unslash( $_POST[$param] ) : ( isset( $_GET[$param] ) ? wp_unslash( $_GET[$param] ) : $default );
401
+			if ( ! isset( $_POST[$param] ) && isset( $_GET[$param] ) && ! is_array( $value ) ) {
402 402
 				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
403
-				$value = htmlspecialchars_decode( wp_unslash( $_GET[ $param ] ) );
403
+				$value = htmlspecialchars_decode( wp_unslash( $_GET[$param] ) );
404 404
 			}
405 405
 			self::sanitize_value( $sanitize, $value );
406 406
 		} else {
@@ -421,7 +421,7 @@  discard block
 block discarded – undo
421 421
 				}
422 422
 
423 423
 				$p     = trim( $p, ']' );
424
-				$value = isset( $value[ $p ] ) ? $value[ $p ] : $default;
424
+				$value = isset( $value[$p] ) ? $value[$p] : $default;
425 425
 			}
426 426
 		}
427 427
 
@@ -477,26 +477,26 @@  discard block
 block discarded – undo
477 477
 			'sanitize' => 'sanitize_text_field',
478 478
 			'serialized' => false,
479 479
 		);
480
-		$args     = wp_parse_args( $args, $defaults );
480
+		$args = wp_parse_args( $args, $defaults );
481 481
 
482 482
 		$value = $args['default'];
483 483
 		if ( $args['type'] == 'get' ) {
484
-			if ( $_GET && isset( $_GET[ $args['param'] ] ) ) {
484
+			if ( $_GET && isset( $_GET[$args['param']] ) ) {
485 485
 				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
486
-				$value = wp_unslash( $_GET[ $args['param'] ] );
486
+				$value = wp_unslash( $_GET[$args['param']] );
487 487
 			}
488 488
 		} elseif ( $args['type'] == 'post' ) {
489
-			if ( isset( $_POST[ $args['param'] ] ) ) {
489
+			if ( isset( $_POST[$args['param']] ) ) {
490 490
 				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
491
-				$value = wp_unslash( $_POST[ $args['param'] ] );
491
+				$value = wp_unslash( $_POST[$args['param']] );
492 492
 				if ( $args['serialized'] === true && is_serialized_string( $value ) && is_serialized( $value ) ) {
493 493
 					self::unserialize_or_decode( $value );
494 494
 				}
495 495
 			}
496 496
 		} else {
497
-			if ( isset( $_REQUEST[ $args['param'] ] ) ) {
497
+			if ( isset( $_REQUEST[$args['param']] ) ) {
498 498
 				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
499
-				$value = wp_unslash( $_REQUEST[ $args['param'] ] );
499
+				$value = wp_unslash( $_REQUEST[$args['param']] );
500 500
 			}
501 501
 		}
502 502
 
@@ -528,7 +528,7 @@  discard block
 block discarded – undo
528 528
 			if ( is_array( $value ) ) {
529 529
 				$temp_values = $value;
530 530
 				foreach ( $temp_values as $k => $v ) {
531
-					self::sanitize_value( $sanitize, $value[ $k ] );
531
+					self::sanitize_value( $sanitize, $value[$k] );
532 532
 				}
533 533
 			} else {
534 534
 				$value = call_user_func( $sanitize, $value );
@@ -539,8 +539,8 @@  discard block
 block discarded – undo
539 539
 	public static function sanitize_request( $sanitize_method, &$values ) {
540 540
 		$temp_values = $values;
541 541
 		foreach ( $temp_values as $k => $val ) {
542
-			if ( isset( $sanitize_method[ $k ] ) ) {
543
-				$values[ $k ] = call_user_func( $sanitize_method[ $k ], $val );
542
+			if ( isset( $sanitize_method[$k] ) ) {
543
+				$values[$k] = call_user_func( $sanitize_method[$k], $val );
544 544
 			}
545 545
 		}
546 546
 	}
@@ -563,7 +563,7 @@  discard block
 block discarded – undo
563 563
 		if ( is_array( $value ) ) {
564 564
 			$temp_values = $value;
565 565
 			foreach ( $temp_values as $k => $v ) {
566
-				self::decode_specialchars( $value[ $k ] );
566
+				self::decode_specialchars( $value[$k] );
567 567
 			}
568 568
 		} else {
569 569
 			self::decode_amp( $value );
@@ -640,7 +640,7 @@  discard block
 block discarded – undo
640 640
 			$allowed_html = $html;
641 641
 		} elseif ( ! empty( $allowed ) ) {
642 642
 			foreach ( (array) $allowed as $a ) {
643
-				$allowed_html[ $a ] = isset( $html[ $a ] ) ? $html[ $a ] : array();
643
+				$allowed_html[$a] = isset( $html[$a] ) ? $html[$a] : array();
644 644
 			}
645 645
 		}
646 646
 
@@ -797,8 +797,8 @@  discard block
 block discarded – undo
797 797
 		}
798 798
 
799 799
 		global $wp_query;
800
-		if ( isset( $wp_query->query_vars[ $param ] ) ) {
801
-			$value = $wp_query->query_vars[ $param ];
800
+		if ( isset( $wp_query->query_vars[$param] ) ) {
801
+			$value = $wp_query->query_vars[$param];
802 802
 		}
803 803
 
804 804
 		return $value;
@@ -965,7 +965,7 @@  discard block
 block discarded – undo
965 965
 				'new_file_path' => self::plugin_path() . '/js',
966 966
 			)
967 967
 		);
968
-		$new_file  = new FrmCreateFile( $file_atts );
968
+		$new_file = new FrmCreateFile( $file_atts );
969 969
 
970 970
 		$files = array(
971 971
 			self::plugin_path() . '/js/jquery/jquery.placeholder.min.js',
@@ -1277,8 +1277,8 @@  discard block
 block discarded – undo
1277 1277
 			return $error;
1278 1278
 		}
1279 1279
 
1280
-		$nonce_value = ( $_REQUEST && isset( $_REQUEST[ $nonce_name ] ) ) ? sanitize_text_field( wp_unslash( $_REQUEST[ $nonce_name ] ) ) : '';
1281
-		if ( $_REQUEST && ( ! isset( $_REQUEST[ $nonce_name ] ) || ! wp_verify_nonce( $nonce_value, $nonce ) ) ) {
1280
+		$nonce_value = ( $_REQUEST && isset( $_REQUEST[$nonce_name] ) ) ? sanitize_text_field( wp_unslash( $_REQUEST[$nonce_name] ) ) : '';
1281
+		if ( $_REQUEST && ( ! isset( $_REQUEST[$nonce_name] ) || ! wp_verify_nonce( $nonce_value, $nonce ) ) ) {
1282 1282
 			$frm_settings = self::get_settings();
1283 1283
 			$error        = $frm_settings->admin_permission;
1284 1284
 		}
@@ -1313,7 +1313,7 @@  discard block
 block discarded – undo
1313 1313
 			} else {
1314 1314
 				foreach ( $value as $k => $v ) {
1315 1315
 					if ( ! is_array( $v ) ) {
1316
-						$value[ $k ] = call_user_func( $original_function, $v );
1316
+						$value[$k] = call_user_func( $original_function, $v );
1317 1317
 					}
1318 1318
 				}
1319 1319
 			}
@@ -1338,7 +1338,7 @@  discard block
 block discarded – undo
1338 1338
 				$return = array_merge( $return, self::array_flatten( $value, $keys ) );
1339 1339
 			} else {
1340 1340
 				if ( $keys == 'keep' ) {
1341
-					$return[ $key ] = $value;
1341
+					$return[$key] = $value;
1342 1342
 				} else {
1343 1343
 					$return[] = $value;
1344 1344
 				}
@@ -1402,11 +1402,11 @@  discard block
 block discarded – undo
1402 1402
 		}
1403 1403
 
1404 1404
 		$ver = $default;
1405
-		if ( ! isset( $wp_scripts->registered[ $handle ] ) ) {
1405
+		if ( ! isset( $wp_scripts->registered[$handle] ) ) {
1406 1406
 			return $ver;
1407 1407
 		}
1408 1408
 
1409
-		$query = $wp_scripts->registered[ $handle ];
1409
+		$query = $wp_scripts->registered[$handle];
1410 1410
 		if ( is_object( $query ) && ! empty( $query->ver ) ) {
1411 1411
 			$ver = $query->ver;
1412 1412
 		}
@@ -1529,7 +1529,7 @@  discard block
 block discarded – undo
1529 1529
 
1530 1530
 		foreach ( array( 'name', 'description' ) as $var ) {
1531 1531
 			$default_val    = isset( $record->{$var} ) ? $record->{$var} : '';
1532
-			$values[ $var ] = self::get_param( $var, $default_val, 'get', 'wp_kses_post' );
1532
+			$values[$var] = self::get_param( $var, $default_val, 'get', 'wp_kses_post' );
1533 1533
 			unset( $var, $default_val );
1534 1534
 		}
1535 1535
 
@@ -1587,9 +1587,9 @@  discard block
 block discarded – undo
1587 1587
 			}
1588 1588
 		}
1589 1589
 
1590
-		$field_type = isset( $post_values['field_options'][ 'type_' . $field->id ] ) ? $post_values['field_options'][ 'type_' . $field->id ] : $field->type;
1591
-		if ( isset( $post_values['item_meta'][ $field->id ] ) ) {
1592
-			$new_value = $post_values['item_meta'][ $field->id ];
1590
+		$field_type = isset( $post_values['field_options']['type_' . $field->id] ) ? $post_values['field_options']['type_' . $field->id] : $field->type;
1591
+		if ( isset( $post_values['item_meta'][$field->id] ) ) {
1592
+			$new_value = $post_values['item_meta'][$field->id];
1593 1593
 			self::unserialize_or_decode( $new_value );
1594 1594
 		} else {
1595 1595
 			$new_value = $meta_value;
@@ -1610,7 +1610,7 @@  discard block
 block discarded – undo
1610 1610
 
1611 1611
 		$field_array = array_merge( (array) $field->field_options, $field_array );
1612 1612
 
1613
-		$values['fields'][ $field->id ] = $field_array;
1613
+		$values['fields'][$field->id] = $field_array;
1614 1614
 	}
1615 1615
 
1616 1616
 	/**
@@ -1657,11 +1657,11 @@  discard block
 block discarded – undo
1657 1657
 		}
1658 1658
 
1659 1659
 		foreach ( $form->options as $opt => $value ) {
1660
-			if ( isset( $post_values[ $opt ] ) ) {
1661
-				$values[ $opt ] = $post_values[ $opt ];
1662
-				self::unserialize_or_decode( $values[ $opt ] );
1660
+			if ( isset( $post_values[$opt] ) ) {
1661
+				$values[$opt] = $post_values[$opt];
1662
+				self::unserialize_or_decode( $values[$opt] );
1663 1663
 			} else {
1664
-				$values[ $opt ] = $value;
1664
+				$values[$opt] = $value;
1665 1665
 			}
1666 1666
 		}
1667 1667
 
@@ -1675,8 +1675,8 @@  discard block
 block discarded – undo
1675 1675
 		$form_defaults = FrmFormsHelper::get_default_opts();
1676 1676
 
1677 1677
 		foreach ( $form_defaults as $opt => $default ) {
1678
-			if ( ! isset( $values[ $opt ] ) || $values[ $opt ] == '' ) {
1679
-				$values[ $opt ] = ( $post_values && isset( $post_values['options'][ $opt ] ) ) ? $post_values['options'][ $opt ] : $default;
1678
+			if ( ! isset( $values[$opt] ) || $values[$opt] == '' ) {
1679
+				$values[$opt] = ( $post_values && isset( $post_values['options'][$opt] ) ) ? $post_values['options'][$opt] : $default;
1680 1680
 			}
1681 1681
 
1682 1682
 			unset( $opt, $default );
@@ -1687,8 +1687,8 @@  discard block
 block discarded – undo
1687 1687
 		}
1688 1688
 
1689 1689
 		foreach ( array( 'before', 'after', 'submit' ) as $h ) {
1690
-			if ( ! isset( $values[ $h . '_html' ] ) ) {
1691
-				$values[ $h . '_html' ] = ( isset( $post_values['options'][ $h . '_html' ] ) ? $post_values['options'][ $h . '_html' ] : FrmFormsHelper::get_default_html( $h ) );
1690
+			if ( ! isset( $values[$h . '_html'] ) ) {
1691
+				$values[$h . '_html'] = ( isset( $post_values['options'][$h . '_html'] ) ? $post_values['options'][$h . '_html'] : FrmFormsHelper::get_default_html( $h ) );
1692 1692
 			}
1693 1693
 			unset( $h );
1694 1694
 		}
@@ -1840,25 +1840,25 @@  discard block
 block discarded – undo
1840 1840
 		if ( ! is_numeric( $levels ) ) {
1841 1841
 			// Show time in specified unit.
1842 1842
 			$levels = self::get_unit( $levels );
1843
-			if ( isset( $time_strings[ $levels ] ) ) {
1843
+			if ( isset( $time_strings[$levels] ) ) {
1844 1844
 				$diff = array(
1845 1845
 					$levels => self::time_format( $levels, $diff ),
1846 1846
 				);
1847 1847
 				$time_strings = array(
1848
-					$levels => $time_strings[ $levels ],
1848
+					$levels => $time_strings[$levels],
1849 1849
 				);
1850 1850
 			}
1851 1851
 			$levels = 1;
1852 1852
 		}
1853 1853
 
1854 1854
 		foreach ( $time_strings as $k => $v ) {
1855
-			if ( isset( $diff[ $k ] ) && $diff[ $k ] ) {
1856
-				$time_strings[ $k ] = $diff[ $k ] . ' ' . ( $diff[ $k ] > 1 ? $v[1] : $v[0] );
1857
-			} elseif ( isset( $diff[ $k ] ) && count( $time_strings ) === 1 ) {
1855
+			if ( isset( $diff[$k] ) && $diff[$k] ) {
1856
+				$time_strings[$k] = $diff[$k] . ' ' . ( $diff[$k] > 1 ? $v[1] : $v[0] );
1857
+			} elseif ( isset( $diff[$k] ) && count( $time_strings ) === 1 ) {
1858 1858
 				// Account for 0.
1859
-				$time_strings[ $k ] = $diff[ $k ] . ' ' . $v[1];
1859
+				$time_strings[$k] = $diff[$k] . ' ' . $v[1];
1860 1860
 			} else {
1861
-				unset( $time_strings[ $k ] );
1861
+				unset( $time_strings[$k] );
1862 1862
 			}
1863 1863
 		}
1864 1864
 
@@ -1877,8 +1877,8 @@  discard block
 block discarded – undo
1877 1877
 			'y' => 'y',
1878 1878
 			'd' => 'days',
1879 1879
 		);
1880
-		if ( isset( $return[ $unit ] ) ) {
1881
-			return $diff[ $return[ $unit ] ];
1880
+		if ( isset( $return[$unit] ) ) {
1881
+			return $diff[$return[$unit]];
1882 1882
 		}
1883 1883
 
1884 1884
 		$total = $diff['days'] * self::convert_time( 'd', $unit );
@@ -1886,11 +1886,11 @@  discard block
 block discarded – undo
1886 1886
 		$times = array( 'h', 'i', 's' );
1887 1887
 
1888 1888
 		foreach ( $times as $time ) {
1889
-			if ( ! isset( $diff[ $time ] ) ) {
1889
+			if ( ! isset( $diff[$time] ) ) {
1890 1890
 				continue;
1891 1891
 			}
1892 1892
 
1893
-			$total += $diff[ $time ] * self::convert_time( $time, $unit );
1893
+			$total += $diff[$time] * self::convert_time( $time, $unit );
1894 1894
 		}
1895 1895
 
1896 1896
 		return floor( $total );
@@ -1910,7 +1910,7 @@  discard block
 block discarded – undo
1910 1910
 			'y' => DAY_IN_SECONDS * 365.25,
1911 1911
 		);
1912 1912
 
1913
-		return $convert[ $from ] / $convert[ $to ];
1913
+		return $convert[$from] / $convert[$to];
1914 1914
 	}
1915 1915
 
1916 1916
 	/**
@@ -1918,7 +1918,7 @@  discard block
 block discarded – undo
1918 1918
 	 */
1919 1919
 	private static function get_unit( $unit ) {
1920 1920
 		$units = self::get_time_strings();
1921
-		if ( isset( $units[ $unit ] ) || is_numeric( $unit ) ) {
1921
+		if ( isset( $units[$unit] ) || is_numeric( $unit ) ) {
1922 1922
 			return $unit;
1923 1923
 		}
1924 1924
 
@@ -1999,17 +1999,17 @@  discard block
 block discarded – undo
1999 1999
 
2000 2000
 					case 1:
2001 2001
 						$l2 = $name;
2002
-						self::add_value_to_array( $name, $l2, $this_val, $vars[ $l1 ] );
2002
+						self::add_value_to_array( $name, $l2, $this_val, $vars[$l1] );
2003 2003
 						break;
2004 2004
 
2005 2005
 					case 2:
2006 2006
 						$l3 = $name;
2007
-						self::add_value_to_array( $name, $l3, $this_val, $vars[ $l1 ][ $l2 ] );
2007
+						self::add_value_to_array( $name, $l3, $this_val, $vars[$l1][$l2] );
2008 2008
 						break;
2009 2009
 
2010 2010
 					case 3:
2011 2011
 						$l4 = $name;
2012
-						self::add_value_to_array( $name, $l4, $this_val, $vars[ $l1 ][ $l2 ][ $l3 ] );
2012
+						self::add_value_to_array( $name, $l4, $this_val, $vars[$l1][$l2][$l3] );
2013 2013
 				}
2014 2014
 
2015 2015
 				unset( $this_val, $n );
@@ -2028,8 +2028,8 @@  discard block
 block discarded – undo
2028 2028
 	public static function add_value_to_array( $name, $l1, $val, &$vars ) {
2029 2029
 		if ( $name == '' ) {
2030 2030
 			$vars[] = $val;
2031
-		} elseif ( ! isset( $vars[ $l1 ] ) ) {
2032
-			$vars[ $l1 ] = $val;
2031
+		} elseif ( ! isset( $vars[$l1] ) ) {
2032
+			$vars[$l1] = $val;
2033 2033
 		}
2034 2034
 	}
2035 2035
 
@@ -2045,7 +2045,7 @@  discard block
 block discarded – undo
2045 2045
 			'email_subject' => esc_attr( sprintf( __( 'If you leave the subject blank, the default will be used: %1$s Form submitted on %2$s', 'formidable' ), $form_name, self::site_name() ) ),
2046 2046
 		);
2047 2047
 
2048
-		if ( ! isset( $tooltips[ $name ] ) ) {
2048
+		if ( ! isset( $tooltips[$name] ) ) {
2049 2049
 			return;
2050 2050
 		}
2051 2051
 
@@ -2055,7 +2055,7 @@  discard block
 block discarded – undo
2055 2055
 			echo ' class="frm_help"';
2056 2056
 		}
2057 2057
 
2058
-		echo ' title="' . esc_attr( $tooltips[ $name ] );
2058
+		echo ' title="' . esc_attr( $tooltips[$name] );
2059 2059
 
2060 2060
 		if ( 'open' != $class ) {
2061 2061
 			echo '"';
@@ -2108,13 +2108,13 @@  discard block
 block discarded – undo
2108 2108
 	}
2109 2109
 
2110 2110
 	private static function prepare_action_slashes( $val, $key, &$post_content ) {
2111
-		if ( ! isset( $post_content[ $key ] ) ) {
2111
+		if ( ! isset( $post_content[$key] ) ) {
2112 2112
 			return;
2113 2113
 		}
2114 2114
 
2115 2115
 		if ( is_array( $val ) ) {
2116 2116
 			foreach ( $val as $k1 => $v1 ) {
2117
-				self::prepare_action_slashes( $v1, $k1, $post_content[ $key ] );
2117
+				self::prepare_action_slashes( $v1, $k1, $post_content[$key] );
2118 2118
 				unset( $k1, $v1 );
2119 2119
 			}
2120 2120
 		} else {
@@ -2122,7 +2122,7 @@  discard block
 block discarded – undo
2122 2122
 			$val = stripslashes( $val );
2123 2123
 
2124 2124
 			// Add backslashes before double quotes and forward slashes only
2125
-			$post_content[ $key ] = addcslashes( $val, '"\\/' );
2125
+			$post_content[$key] = addcslashes( $val, '"\\/' );
2126 2126
 		}
2127 2127
 	}
2128 2128
 
@@ -2181,14 +2181,14 @@  discard block
 block discarded – undo
2181 2181
 				continue;
2182 2182
 			}
2183 2183
 			$key = $input['name'];
2184
-			if ( isset( $formatted[ $key ] ) ) {
2185
-				if ( is_array( $formatted[ $key ] ) ) {
2186
-					$formatted[ $key ][] = $input['value'];
2184
+			if ( isset( $formatted[$key] ) ) {
2185
+				if ( is_array( $formatted[$key] ) ) {
2186
+					$formatted[$key][] = $input['value'];
2187 2187
 				} else {
2188
-					$formatted[ $key ] = array( $formatted[ $key ], $input['value'] );
2188
+					$formatted[$key] = array( $formatted[$key], $input['value'] );
2189 2189
 				}
2190 2190
 			} else {
2191
-				$formatted[ $key ] = $input['value'];
2191
+				$formatted[$key] = $input['value'];
2192 2192
 			}
2193 2193
 		}
2194 2194
 
Please login to merge, or discard this patch.
classes/models/FrmReviews.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -71,12 +71,12 @@  discard block
 block discarded – undo
71 71
 		$show_intervals = array( 50, 200, 500 );
72 72
 		$asked          = $this->review_status['asked'];
73 73
 
74
-		if ( ! isset( $show_intervals[ $asked ] ) ) {
74
+		if ( ! isset( $show_intervals[$asked] ) ) {
75 75
 			return;
76 76
 		}
77 77
 
78 78
 		$entries = FrmEntry::getRecordCount();
79
-		$count   = $show_intervals[ $asked ];
79
+		$count   = $show_intervals[$asked];
80 80
 		$user    = wp_get_current_user();
81 81
 
82 82
 		// Only show review request if the site has collected enough entries
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
 		$requests = $message->get_messages();
119 119
 		$key      = $this->inbox_key . ( $asked ? $asked : '' );
120 120
 
121
-		if ( isset( $requests[ $key ] ) ) {
121
+		if ( isset( $requests[$key] ) ) {
122 122
 			return;
123 123
 		}
124 124
 
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
 	 * @since 4.05.02
155 155
 	 */
156 156
 	private function has_later_request( $requests, $asked ) {
157
-		return isset( $requests[ $this->inbox_key . ( $asked + 1 ) ] ) || isset( $requests[ $this->inbox_key . ( $asked + 2 ) ] );
157
+		return isset( $requests[$this->inbox_key . ( $asked + 1 )] ) || isset( $requests[$this->inbox_key . ( $asked + 2 )] );
158 158
 	}
159 159
 
160 160
 	/**
Please login to merge, or discard this patch.
classes/models/FrmSolution.php 3 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -125,7 +125,8 @@
 block discarded – undo
125 125
 		}
126 126
 
127 127
 		// Only do this for single site installs.
128
-		if ( isset( $_GET['activate-multi'] ) || is_network_admin() ) { // WPCS: CSRF ok.
128
+		if ( isset( $_GET['activate-multi'] ) || is_network_admin() ) {
129
+// WPCS: CSRF ok.
129 130
 			return;
130 131
 		}
131 132
 
Please login to merge, or discard this patch.
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -546,6 +546,9 @@
 block discarded – undo
546 546
 		$this->show_import_options( $this->view_options(), 'view' );
547 547
 	}
548 548
 
549
+	/**
550
+	 * @param string $importing
551
+	 */
549 552
 	protected function show_import_options( $options, $importing, $xml = '' ) {
550 553
 		if ( empty( $options ) ) {
551 554
 			return;
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
 	 */
160 160
 	public function add_settings( $sections ) {
161 161
 		wp_enqueue_style( 'formidable-pro-fields' );
162
-		$sections[ $this->plugin_slug ] = array(
162
+		$sections[$this->plugin_slug] = array(
163 163
 			'class'    => $this,
164 164
 			'function' => 'settings_page',
165 165
 			'name'     => $this->plugin_name(),
@@ -316,9 +316,9 @@  discard block
 block discarded – undo
316 316
 			// Set the current step.
317 317
 			if ( ! isset( $step['current'] ) ) {
318 318
 				if ( $step['complete'] ) {
319
-					$steps[ $k ]['current'] = false;
319
+					$steps[$k]['current'] = false;
320 320
 				} else {
321
-					$steps[ $k ]['current'] = ! $has_current;
321
+					$steps[$k]['current'] = ! $has_current;
322 322
 					$has_current = true;
323 323
 				}
324 324
 			} elseif ( $step['current'] ) {
@@ -328,10 +328,10 @@  discard block
 block discarded – undo
328 328
 			// Set disabled buttons.
329 329
 			$class = isset( $step['button_class'] ) ? $step['button_class'] : '';
330 330
 			$class .= ' button-primary frm-button-primary';
331
-			if ( ! $steps[ $k ]['current'] ) {
331
+			if ( ! $steps[$k]['current'] ) {
332 332
 				$class .= ' frm_grey disabled';
333 333
 			}
334
-			$steps[ $k ]['button_class'] = $class;
334
+			$steps[$k]['button_class'] = $class;
335 335
 		}
336 336
 
337 337
 		return $steps;
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
 			if ( $plugin['status'] === 'active' ) {
354 354
 				continue;
355 355
 			}
356
-			$links[ $plugin_key ] = $plugin;
356
+			$links[$plugin_key] = $plugin;
357 357
 			if ( isset( $plugin['url'] ) ) {
358 358
 				$rel[] = $plugin['url'];
359 359
 			} else {
@@ -468,7 +468,7 @@  discard block
 block discarded – undo
468 468
 		$addons = $api->get_api_info();
469 469
 
470 470
 		$id = $this->download_id();
471
-		$has_file = isset( $addons[ $id ] ) && isset( $addons[ $id ]['beta'] );
471
+		$has_file = isset( $addons[$id] ) && isset( $addons[$id]['beta'] );
472 472
 
473 473
 		if ( ! $step['current'] ) {
474 474
 			?>
@@ -483,10 +483,10 @@  discard block
 block discarded – undo
483 483
 
484 484
 		if ( ! $has_file ) {
485 485
 			echo '<p class="frm_error_style">' . esc_html__( 'We didn\'t find anything to import. Please contact our team.', 'formidable' ) . '</p>';
486
-		} elseif ( ! isset( $addons[ $id ]['beta']['package'] ) ) {
486
+		} elseif ( ! isset( $addons[$id]['beta']['package'] ) ) {
487 487
 			echo '<p class="frm_error_style">' . esc_html__( 'Looks like you may not have a current subscription for this solution. Please check your account.', 'formidable' ) . '</p>';
488 488
 		} else {
489
-			$xml = $addons[ $id ]['beta']['package'];
489
+			$xml = $addons[$id]['beta']['package'];
490 490
 			if ( is_array( $xml ) ) {
491 491
 				$xml = reset( $xml );
492 492
 			}
@@ -624,7 +624,7 @@  discard block
 block discarded – undo
624 624
 		foreach ( $forms as $form ) {
625 625
 			$was_imported = isset( $form['form'] ) ? FrmForm::get_id_by_key( $form['form'] ) : false;
626 626
 			if ( $was_imported ) {
627
-				$imported[ $form['form'] ] = $was_imported;
627
+				$imported[$form['form']] = $was_imported;
628 628
 			}
629 629
 		}
630 630
 
Please login to merge, or discard this patch.
classes/views/inbox/list.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@
 block discarded – undo
29 29
 			</h3>
30 30
 			<span class="frm_inbox_date">
31 31
 				<?php
32
-				if ( ! isset( $message['read'] ) || ! isset( $message['read'][ $user->ID ] ) ) {
32
+				if ( ! isset( $message['read'] ) || ! isset( $message['read'][$user->ID] ) ) {
33 33
 					$inbox->mark_read( $key );
34 34
 					?>
35 35
 					<span class="frm_inbox_unread"></span>
Please login to merge, or discard this patch.
classes/models/FrmInbox.php 2 patches
Doc Comments   +4 added lines patch added patch discarded remove patch
@@ -132,6 +132,9 @@  discard block
 block discarded – undo
132 132
 		}
133 133
 	}
134 134
 
135
+	/**
136
+	 * @param boolean $messages
137
+	 */
135 138
 	private function filter_messages( &$messages ) {
136 139
 		$user_id = get_current_user_id();
137 140
 		foreach ( $messages as $k => $message ) {
@@ -256,6 +259,7 @@  discard block
 block discarded – undo
256 259
 
257 260
 	/**
258 261
 	 * @since 4.05.02
262
+	 * @param string $key
259 263
 	 */
260 264
 	public function remove( $key ) {
261 265
 		if ( isset( $this->messages[ $key ] ) ) {
Please login to merge, or discard this patch.
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -75,18 +75,18 @@  discard block
 block discarded – undo
75 75
 	 * @param array $message
76 76
 	 */
77 77
 	public function add_message( $message ) {
78
-		if ( isset( $this->messages[ $message['key'] ] ) && ! isset( $message['force'] ) ) {
78
+		if ( isset( $this->messages[$message['key']] ) && ! isset( $message['force'] ) ) {
79 79
 			// Don't replace messages unless required.
80 80
 			return;
81 81
 		}
82 82
 
83
-		if ( isset( $this->messages[ $message['key'] ] ) ) {
83
+		if ( isset( $this->messages[$message['key']] ) ) {
84 84
 			// Move up and mark as new.
85
-			unset( $this->messages[ $message['key'] ] );
85
+			unset( $this->messages[$message['key']] );
86 86
 		}
87 87
 
88 88
 		$this->fill_message( $message );
89
-		$this->messages[ $message['key'] ] = $message;
89
+		$this->messages[$message['key']] = $message;
90 90
 
91 91
 		$this->update_list();
92 92
 
@@ -114,11 +114,11 @@  discard block
 block discarded – undo
114 114
 	private function clean_messages() {
115 115
 		$removed  = false;
116 116
 		foreach ( $this->messages as $t => $message ) {
117
-			$read    = isset( $message['read'] ) && ! empty( $message['read'] ) && isset( $message['read'][ get_current_user_id() ] ) && $message['read'][ get_current_user_id() ] < strtotime( '-1 month' );
118
-			$dismissed = isset( $message['dismissed'] ) && ! empty( $message['dismissed'] ) && isset( $message['dismissed'][ get_current_user_id() ] ) && $message['dismissed'][ get_current_user_id() ] < strtotime( '-1 week' );
117
+			$read    = isset( $message['read'] ) && ! empty( $message['read'] ) && isset( $message['read'][get_current_user_id()] ) && $message['read'][get_current_user_id()] < strtotime( '-1 month' );
118
+			$dismissed = isset( $message['dismissed'] ) && ! empty( $message['dismissed'] ) && isset( $message['dismissed'][get_current_user_id()] ) && $message['dismissed'][get_current_user_id()] < strtotime( '-1 week' );
119 119
 			$expired = $this->is_expired( $message );
120 120
 			if ( $read || $expired || $dismissed ) {
121
-				unset( $this->messages[ $t ] );
121
+				unset( $this->messages[$t] );
122 122
 				$removed = true;
123 123
 			}
124 124
 		}
@@ -131,11 +131,11 @@  discard block
 block discarded – undo
131 131
 	private function filter_messages( &$messages ) {
132 132
 		$user_id = get_current_user_id();
133 133
 		foreach ( $messages as $k => $message ) {
134
-			$dismissed = isset( $message['dismissed'] ) && isset( $message['dismissed'][ $user_id ] );
134
+			$dismissed = isset( $message['dismissed'] ) && isset( $message['dismissed'][$user_id] );
135 135
 			if ( $this->is_expired( $message ) || $dismissed ) {
136
-				unset( $messages[ $k ] );
136
+				unset( $messages[$k] );
137 137
 			} elseif ( ! $this->is_for_user( $message ) ) {
138
-				unset( $messages[ $k ] );
138
+				unset( $messages[$k] );
139 139
 			}
140 140
 		}
141 141
 		$messages = apply_filters( 'frm_filter_inbox', $messages );
@@ -168,14 +168,14 @@  discard block
 block discarded – undo
168 168
 	 * @param string $key
169 169
 	 */
170 170
 	public function mark_read( $key ) {
171
-		if ( ! isset( $this->messages[ $key ] ) ) {
171
+		if ( ! isset( $this->messages[$key] ) ) {
172 172
 			return;
173 173
 		}
174 174
 
175
-		if ( ! isset( $this->messages[ $key ]['read'] ) ) {
176
-			$this->messages[ $key ]['read'] = array();
175
+		if ( ! isset( $this->messages[$key]['read'] ) ) {
176
+			$this->messages[$key]['read'] = array();
177 177
 		}
178
-		$this->messages[ $key ]['read'][ get_current_user_id() ] = time();
178
+		$this->messages[$key]['read'][get_current_user_id()] = time();
179 179
 
180 180
 		$this->update_list();
181 181
 	}
@@ -186,9 +186,9 @@  discard block
 block discarded – undo
186 186
 	 * @since 4.05.02
187 187
 	 */
188 188
 	public function mark_unread( $key ) {
189
-		$is_read = isset( $this->messages[ $key ] ) && isset( $this->messages[ $key ]['read'] ) && isset( $this->messages[ $key ]['read'][ get_current_user_id() ] );
189
+		$is_read = isset( $this->messages[$key] ) && isset( $this->messages[$key]['read'] ) && isset( $this->messages[$key]['read'][get_current_user_id()] );
190 190
 		if ( $is_read ) {
191
-			unset( $this->messages[ $key ]['read'][ get_current_user_id() ] );
191
+			unset( $this->messages[$key]['read'][get_current_user_id()] );
192 192
 			$this->update_list();
193 193
 		}
194 194
 	}
@@ -202,14 +202,14 @@  discard block
 block discarded – undo
202 202
 			return;
203 203
 		}
204 204
 
205
-		if ( ! isset( $this->messages[ $key ] ) ) {
205
+		if ( ! isset( $this->messages[$key] ) ) {
206 206
 			return;
207 207
 		}
208 208
 
209
-		if ( ! isset( $this->messages[ $key ]['dismissed'] ) ) {
210
-			$this->messages[ $key ]['dismissed'] = array();
209
+		if ( ! isset( $this->messages[$key]['dismissed'] ) ) {
210
+			$this->messages[$key]['dismissed'] = array();
211 211
 		}
212
-		$this->messages[ $key ]['dismissed'][ get_current_user_id() ] = time();
212
+		$this->messages[$key]['dismissed'][get_current_user_id()] = time();
213 213
 
214 214
 		$this->update_list();
215 215
 	}
@@ -221,11 +221,11 @@  discard block
 block discarded – undo
221 221
 		$user_id = get_current_user_id();
222 222
 		foreach ( $this->messages as $key => $message ) {
223 223
 			if ( ! isset( $message['dismissed'] ) ) {
224
-				$this->messages[ $key ]['dismissed'] = array();
224
+				$this->messages[$key]['dismissed'] = array();
225 225
 			}
226 226
 
227
-			if ( ! isset( $message['dismissed'][ $user_id ] ) ) {
228
-				$this->messages[ $key ]['dismissed'][ $user_id ] = time();
227
+			if ( ! isset( $message['dismissed'][$user_id] ) ) {
228
+				$this->messages[$key]['dismissed'][$user_id] = time();
229 229
 			}
230 230
 		}
231 231
 		$this->update_list();
@@ -235,8 +235,8 @@  discard block
 block discarded – undo
235 235
 		$messages = $this->get_messages( 'filter' );
236 236
 		$user_id  = get_current_user_id();
237 237
 		foreach ( $messages as $t => $message ) {
238
-			if ( isset( $message['read'] ) && isset( $message['read'][ $user_id ] ) ) {
239
-				unset( $messages[ $t ] );
238
+			if ( isset( $message['read'] ) && isset( $message['read'][$user_id] ) ) {
239
+				unset( $messages[$t] );
240 240
 			}
241 241
 		}
242 242
 		return $messages;
@@ -260,8 +260,8 @@  discard block
 block discarded – undo
260 260
 	 * @since 4.05.02
261 261
 	 */
262 262
 	public function remove( $key ) {
263
-		if ( isset( $this->messages[ $key ] ) ) {
264
-			unset( $this->messages[ $key ] );
263
+		if ( isset( $this->messages[$key] ) ) {
264
+			unset( $this->messages[$key] );
265 265
 			$this->update_list();
266 266
 		}
267 267
 	}
Please login to merge, or discard this patch.
classes/models/FrmForm.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 
141 141
 		foreach ( $values as $value_key => $value ) {
142 142
 			if ( $value_key && in_array( $value_key, $form_fields ) ) {
143
-				$new_values[ $value_key ] = $value;
143
+				$new_values[$value_key] = $value;
144 144
 			}
145 145
 		}
146 146
 
@@ -210,15 +210,15 @@  discard block
 block discarded – undo
210 210
 		$existing_keys = array_keys( $values['item_meta'] );
211 211
 		foreach ( $all_fields as $fid ) {
212 212
 			if ( ! in_array( $fid->id, $existing_keys ) && ( isset( $values['frm_fields_submitted'] ) && in_array( $fid->id, $values['frm_fields_submitted'] ) ) || isset( $values['options'] ) ) {
213
-				$values['item_meta'][ $fid->id ] = '';
213
+				$values['item_meta'][$fid->id] = '';
214 214
 			}
215
-			$field_array[ $fid->id ] = $fid;
215
+			$field_array[$fid->id] = $fid;
216 216
 		}
217 217
 		unset( $all_fields );
218 218
 
219 219
 		foreach ( $values['item_meta'] as $field_id => $default_value ) {
220
-			if ( isset( $field_array[ $field_id ] ) ) {
221
-				$field = $field_array[ $field_id ];
220
+			if ( isset( $field_array[$field_id] ) ) {
221
+				$field = $field_array[$field_id];
222 222
 			} else {
223 223
 				$field = FrmField::getOne( $field_id );
224 224
 			}
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
 				continue;
228 228
 			}
229 229
 
230
-			$is_settings_page = ( isset( $values['options'] ) || isset( $values['field_options'][ 'custom_html_' . $field_id ] ) );
230
+			$is_settings_page = ( isset( $values['options'] ) || isset( $values['field_options']['custom_html_' . $field_id] ) );
231 231
 			if ( $is_settings_page ) {
232 232
 				self::get_settings_page_html( $values, $field );
233 233
 
@@ -242,15 +242,15 @@  discard block
 block discarded – undo
242 242
 			$update_options = apply_filters( 'frm_field_options_to_update', $update_options );
243 243
 
244 244
 			foreach ( $update_options as $opt => $default ) {
245
-				$field->field_options[ $opt ] = isset( $values['field_options'][ $opt . '_' . $field_id ] ) ? $values['field_options'][ $opt . '_' . $field_id ] : $default;
246
-				self::sanitize_field_opt( $opt, $field->field_options[ $opt ] );
245
+				$field->field_options[$opt] = isset( $values['field_options'][$opt . '_' . $field_id] ) ? $values['field_options'][$opt . '_' . $field_id] : $default;
246
+				self::sanitize_field_opt( $opt, $field->field_options[$opt] );
247 247
 			}
248 248
 
249 249
 			$field->field_options = apply_filters( 'frm_update_field_options', $field->field_options, $field, $values );
250 250
 
251 251
 			$new_field = array(
252 252
 				'field_options' => $field->field_options,
253
-				'default_value' => isset( $values[ 'default_value_' . $field_id ] ) ? FrmAppHelper::maybe_json_encode( $values[ 'default_value_' . $field_id ] ) : '',
253
+				'default_value' => isset( $values['default_value_' . $field_id] ) ? FrmAppHelper::maybe_json_encode( $values['default_value_' . $field_id] ) : '',
254 254
 			);
255 255
 
256 256
 			self::prepare_field_update_values( $field, $values, $new_field );
@@ -283,11 +283,11 @@  discard block
 block discarded – undo
283 283
 	 * Updating the settings page
284 284
 	 */
285 285
 	private static function get_settings_page_html( $values, &$field ) {
286
-		if ( isset( $values['field_options'][ 'custom_html_' . $field->id ] ) ) {
286
+		if ( isset( $values['field_options']['custom_html_' . $field->id] ) ) {
287 287
 			$prev_opts     = array();
288 288
 			$fallback_html = isset( $field->field_options['custom_html'] ) ? $field->field_options['custom_html'] : FrmFieldsHelper::get_default_html( $field->type );
289 289
 
290
-			$field->field_options['custom_html'] = isset( $values['field_options'][ 'custom_html_' . $field->id ] ) ? $values['field_options'][ 'custom_html_' . $field->id ] : $fallback_html;
290
+			$field->field_options['custom_html'] = isset( $values['field_options']['custom_html_' . $field->id] ) ? $values['field_options']['custom_html_' . $field->id] : $fallback_html;
291 291
 		} elseif ( $field->type == 'hidden' || $field->type == 'user_id' ) {
292 292
 			$prev_opts = $field->field_options;
293 293
 		}
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
 		foreach ( $field_cols as $col => $default ) {
314 314
 			$default = ( $default === '' ) ? $field->{$col} : $default;
315 315
 
316
-			$new_field[ $col ] = isset( $values['field_options'][ $col . '_' . $field->id ] ) ? $values['field_options'][ $col . '_' . $field->id ] : $default;
316
+			$new_field[$col] = isset( $values['field_options'][$col . '_' . $field->id] ) ? $values['field_options'][$col . '_' . $field->id] : $default;
317 317
 		}
318 318
 
319 319
 		// Don't save the template option.
@@ -727,8 +727,8 @@  discard block
 block discarded – undo
727 727
 			self::maybe_get_form( $form );
728 728
 		}
729 729
 
730
-		if ( isset( $frm_vars['form_params'] ) && is_array( $frm_vars['form_params'] ) && isset( $frm_vars['form_params'][ $form->id ] ) ) {
731
-			return $frm_vars['form_params'][ $form->id ];
730
+		if ( isset( $frm_vars['form_params'] ) && is_array( $frm_vars['form_params'] ) && isset( $frm_vars['form_params'][$form->id] ) ) {
731
+			return $frm_vars['form_params'][$form->id];
732 732
 		}
733 733
 
734 734
 		$action_var = isset( $_REQUEST['frm_action'] ) ? 'frm_action' : 'action'; // WPCS: CSRF ok.
@@ -757,15 +757,15 @@  discard block
 block discarded – undo
757 757
 			//if there are two forms on the same page, make sure not to submit both
758 758
 			foreach ( $default_values as $var => $default ) {
759 759
 				if ( $var == 'action' ) {
760
-					$values[ $var ] = FrmAppHelper::get_param( $action_var, $default, 'get', 'sanitize_title' );
760
+					$values[$var] = FrmAppHelper::get_param( $action_var, $default, 'get', 'sanitize_title' );
761 761
 				} else {
762
-					$values[ $var ] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' );
762
+					$values[$var] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' );
763 763
 				}
764 764
 				unset( $var, $default );
765 765
 			}
766 766
 		} else {
767 767
 			foreach ( $default_values as $var => $default ) {
768
-				$values[ $var ] = $default;
768
+				$values[$var] = $default;
769 769
 				unset( $var, $default );
770 770
 			}
771 771
 		}
@@ -791,7 +791,7 @@  discard block
 block discarded – undo
791 791
 			'sdir'     => '',
792 792
 		);
793 793
 		foreach ( $defaults as $var => $default ) {
794
-			$values[ $var ] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' );
794
+			$values[$var] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' );
795 795
 		}
796 796
 
797 797
 		return $values;
@@ -819,7 +819,7 @@  discard block
 block discarded – undo
819 819
 			'keep_post' => '',
820 820
 		);
821 821
 		foreach ( $defaults as $var => $default ) {
822
-			$values[ $var ] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' );
822
+			$values[$var] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' );
823 823
 		}
824 824
 
825 825
 		return $values;
@@ -905,7 +905,7 @@  discard block
 block discarded – undo
905 905
 		$form = $atts['form'];
906 906
 		$default = isset( $atts['default'] ) ? $atts['default'] : '';
907 907
 
908
-		return isset( $form->options[ $atts['option'] ] ) ? $form->options[ $atts['option'] ] : $default;
908
+		return isset( $form->options[$atts['option']] ) ? $form->options[$atts['option']] : $default;
909 909
 	}
910 910
 
911 911
 	/**
Please login to merge, or discard this patch.
classes/helpers/FrmXMLHelper.php 3 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -78,7 +78,8 @@
 block discarded – undo
78 78
 
79 79
 		if ( ! isset( $imported['form_status'] ) || empty( $imported['form_status'] ) ) {
80 80
 			// Check for an error message in the XML.
81
-			if ( isset( $xml->Code ) && isset( $xml->Message ) ) { // phpcs:ignore WordPress.NamingConventions
81
+			if ( isset( $xml->Code ) && isset( $xml->Message ) ) {
82
+// phpcs:ignore WordPress.NamingConventions
82 83
 				$imported['error'] = reset( $xml->Message ); // phpcs:ignore WordPress.NamingConventions
83 84
 			}
84 85
 		}
Please login to merge, or discard this patch.
Doc Comments   +9 added lines, -2 removed lines patch added patch discarded remove patch
@@ -562,6 +562,7 @@  discard block
 block discarded – undo
562 562
 	 * Also called during database migration in FrmMigrate.
563 563
 	 *
564 564
 	 * @since 4.0
565
+	 * @param string $type
565 566
 	 * @return array
566 567
 	 */
567 568
 	public static function migrate_field_placeholder( $field, $type ) {
@@ -1217,6 +1218,7 @@  discard block
 block discarded – undo
1217 1218
 	 * The line endings may prevent html from being equal when it should
1218 1219
 	 *
1219 1220
 	 * @since 3.06
1221
+	 * @param string $html_name
1220 1222
 	 */
1221 1223
 	private static function remove_default_html( $html_name, $defaults, &$options ) {
1222 1224
 		if ( ! isset( $options[ $html_name ] ) || ! isset( $defaults[ $html_name ] ) ) {
@@ -1290,6 +1292,7 @@  discard block
 block discarded – undo
1290 1292
 	 * Migrate post settings to form action
1291 1293
 	 *
1292 1294
 	 * @param string $post_type
1295
+	 * @param boolean $switch
1293 1296
 	 */
1294 1297
 	private static function migrate_post_settings_to_action( $form_options, $form_id, $post_type, &$imported, $switch ) {
1295 1298
 		if ( ! isset( $form_options['create_post'] ) || ! $form_options['create_post'] ) {
@@ -1368,8 +1371,8 @@  discard block
 block discarded – undo
1368 1371
 	 * @since 2.0
1369 1372
 	 *
1370 1373
 	 * @param array $post_content - check for old field IDs
1371
-	 * @param array $basic_fields - fields with string or int saved
1372
-	 * @param array $array_fields - fields with arrays saved
1374
+	 * @param string[] $basic_fields - fields with string or int saved
1375
+	 * @param string[] $array_fields - fields with arrays saved
1373 1376
 	 *
1374 1377
 	 * @return string $post_content - new field IDs
1375 1378
 	 */
@@ -1404,6 +1407,10 @@  discard block
 block discarded – undo
1404 1407
 		return $post_content;
1405 1408
 	}
1406 1409
 
1410
+	/**
1411
+	 * @param string $post_type
1412
+	 * @param boolean $switch
1413
+	 */
1407 1414
 	private static function migrate_email_settings_to_action( $form_options, $form_id, $post_type, &$imported, $switch ) {
1408 1415
 		// No old notifications or autoresponders to carry over
1409 1416
 		if ( ! isset( $form_options['auto_responder'] ) && ! isset( $form_options['notification'] ) && ! isset( $form_options['email_to'] ) ) {
Please login to merge, or discard this patch.
Spacing   +76 added lines, -76 removed lines patch added patch discarded remove patch
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
 
130 130
 			if ( $term && is_array( $term ) ) {
131 131
 				$imported['imported']['terms'] ++;
132
-				$imported['terms'][ (int) $t->term_id ] = $term['term_id'];
132
+				$imported['terms'][(int) $t->term_id] = $term['term_id'];
133 133
 			}
134 134
 
135 135
 			unset( $term, $t );
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
 					}
186 186
 
187 187
 					// Keep track of whether this specific form was updated or not.
188
-					$imported['form_status'][ $form_id ] = 'imported';
188
+					$imported['form_status'][$form_id] = 'imported';
189 189
 					self::track_imported_child_forms( (int) $form_id, $form['parent_form_id'], $child_forms );
190 190
 				}
191 191
 			}
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
 			// Update field ids/keys to new ones.
198 198
 			do_action( 'frm_after_duplicate_form', $form_id, $form, array( 'old_id' => $old_id ) );
199 199
 
200
-			$imported['forms'][ (int) $item->id ] = $form_id;
200
+			$imported['forms'][(int) $item->id] = $form_id;
201 201
 
202 202
 			// Send pre 2.0 form options through function that creates actions.
203 203
 			self::migrate_form_settings_to_actions( $form['options'], $form_id, $imported, true );
@@ -260,15 +260,15 @@  discard block
 block discarded – undo
260 260
 		}
261 261
 
262 262
 		// Keep track of whether this specific form was updated or not
263
-		$imported['form_status'][ $form_id ] = 'updated';
263
+		$imported['form_status'][$form_id] = 'updated';
264 264
 	}
265 265
 
266 266
 	private static function get_form_fields( $form_id ) {
267 267
 		$form_fields = FrmField::get_all_for_form( $form_id, '', 'exclude', 'exclude' );
268 268
 		$old_fields  = array();
269 269
 		foreach ( $form_fields as $f ) {
270
-			$old_fields[ $f->id ]        = $f;
271
-			$old_fields[ $f->field_key ] = $f->id;
270
+			$old_fields[$f->id]        = $f;
271
+			$old_fields[$f->field_key] = $f->id;
272 272
 			unset( $f );
273 273
 		}
274 274
 		$form_fields = $old_fields;
@@ -325,7 +325,7 @@  discard block
 block discarded – undo
325 325
 	 */
326 326
 	private static function track_imported_child_forms( $form_id, $parent_form_id, &$child_forms ) {
327 327
 		if ( $parent_form_id ) {
328
-			$child_forms[ $form_id ] = $parent_form_id;
328
+			$child_forms[$form_id] = $parent_form_id;
329 329
 		}
330 330
 	}
331 331
 
@@ -341,9 +341,9 @@  discard block
 block discarded – undo
341 341
 	private static function maybe_update_child_form_parent_id( $imported_forms, $child_forms ) {
342 342
 		foreach ( $child_forms as $child_form_id => $old_parent_form_id ) {
343 343
 
344
-			if ( isset( $imported_forms[ $old_parent_form_id ] ) && $imported_forms[ $old_parent_form_id ] != $old_parent_form_id ) {
344
+			if ( isset( $imported_forms[$old_parent_form_id] ) && $imported_forms[$old_parent_form_id] != $old_parent_form_id ) {
345 345
 				// Update all children with this old parent_form_id
346
-				$new_parent_form_id = (int) $imported_forms[ $old_parent_form_id ];
346
+				$new_parent_form_id = (int) $imported_forms[$old_parent_form_id];
347 347
 
348 348
 				FrmForm::update( $child_form_id, array( 'parent_form_id' => $new_parent_form_id ) );
349 349
 			}
@@ -374,27 +374,27 @@  discard block
 block discarded – undo
374 374
 
375 375
 			if ( ! empty( $this_form ) ) {
376 376
 				// check for field to edit by field id
377
-				if ( isset( $form_fields[ $f['id'] ] ) ) {
377
+				if ( isset( $form_fields[$f['id']] ) ) {
378 378
 					FrmField::update( $f['id'], $f );
379 379
 					$imported['updated']['fields'] ++;
380 380
 
381
-					unset( $form_fields[ $f['id'] ] );
381
+					unset( $form_fields[$f['id']] );
382 382
 
383 383
 					//unset old field key
384
-					if ( isset( $form_fields[ $f['field_key'] ] ) ) {
385
-						unset( $form_fields[ $f['field_key'] ] );
384
+					if ( isset( $form_fields[$f['field_key']] ) ) {
385
+						unset( $form_fields[$f['field_key']] );
386 386
 					}
387
-				} elseif ( isset( $form_fields[ $f['field_key'] ] ) ) {
388
-					$keys_by_original_field_id[ $f['id'] ] = $f['field_key'];
387
+				} elseif ( isset( $form_fields[$f['field_key']] ) ) {
388
+					$keys_by_original_field_id[$f['id']] = $f['field_key'];
389 389
 
390 390
 					// check for field to edit by field key
391 391
 					unset( $f['id'] );
392 392
 
393
-					FrmField::update( $form_fields[ $f['field_key'] ], $f );
393
+					FrmField::update( $form_fields[$f['field_key']], $f );
394 394
 					$imported['updated']['fields'] ++;
395 395
 
396
-					unset( $form_fields[ $form_fields[ $f['field_key'] ] ] ); //unset old field id
397
-					unset( $form_fields[ $f['field_key'] ] ); //unset old field key
396
+					unset( $form_fields[$form_fields[$f['field_key']]] ); //unset old field id
397
+					unset( $form_fields[$f['field_key']] ); //unset old field key
398 398
 				} else {
399 399
 					// if no matching field id or key in this form, create the field
400 400
 					self::create_imported_field( $f, $imported );
@@ -504,8 +504,8 @@  discard block
 block discarded – undo
504 504
 		if ( $f['type'] == 'form' || ( $f['type'] == 'divider' && FrmField::is_option_true( $f['field_options'], 'repeat' ) ) ) {
505 505
 			if ( FrmField::is_option_true( $f['field_options'], 'form_select' ) ) {
506 506
 				$form_select = (int) $f['field_options']['form_select'];
507
-				if ( isset( $imported['forms'][ $form_select ] ) ) {
508
-					$f['field_options']['form_select'] = $imported['forms'][ $form_select ];
507
+				if ( isset( $imported['forms'][$form_select] ) ) {
508
+					$f['field_options']['form_select'] = $imported['forms'][$form_select];
509 509
 				}
510 510
 			}
511 511
 		}
@@ -526,8 +526,8 @@  discard block
 block discarded – undo
526 526
 
527 527
 		if ( FrmField::is_option_true_in_array( $f['field_options'], 'get_values_form' ) ) {
528 528
 			$old_form = $f['field_options']['get_values_form'];
529
-			if ( isset( $imported['forms'][ $old_form ] ) ) {
530
-				$f['field_options']['get_values_form'] = $imported['forms'][ $old_form ];
529
+			if ( isset( $imported['forms'][$old_form] ) ) {
530
+				$f['field_options']['get_values_form'] = $imported['forms'][$old_form];
531 531
 			}
532 532
 		}
533 533
 	}
@@ -548,12 +548,12 @@  discard block
 block discarded – undo
548 548
 	private static function migrate_placeholders( &$f ) {
549 549
 		$update_values = self::migrate_field_placeholder( $f, 'clear_on_focus' );
550 550
 		foreach ( $update_values as $k => $v ) {
551
-			$f[ $k ] = $v;
551
+			$f[$k] = $v;
552 552
 		}
553 553
 
554 554
 		$update_values = self::migrate_field_placeholder( $f, 'default_blank' );
555 555
 		foreach ( $update_values as $k => $v ) {
556
-			$f[ $k ] = $v;
556
+			$f[$k] = $v;
557 557
 		}
558 558
 	}
559 559
 
@@ -567,7 +567,7 @@  discard block
 block discarded – undo
567 567
 	public static function migrate_field_placeholder( $field, $type ) {
568 568
 		$field = (array) $field;
569 569
 		$field_options = $field['field_options'];
570
-		if ( empty( $field_options[ $type ] ) || empty( $field['default_value'] ) ) {
570
+		if ( empty( $field_options[$type] ) || empty( $field['default_value'] ) ) {
571 571
 			return array();
572 572
 		}
573 573
 
@@ -593,7 +593,7 @@  discard block
 block discarded – undo
593 593
 				}
594 594
 
595 595
 				if ( $opt == $default_value ) {
596
-					unset( $options[ $opt_key ] );
596
+					unset( $options[$opt_key] );
597 597
 					break;
598 598
 				}
599 599
 			}
@@ -788,17 +788,17 @@  discard block
 block discarded – undo
788 788
 			self::update_postmeta( $post, $post_id );
789 789
 
790 790
 			$this_type = 'posts';
791
-			if ( isset( $post_types[ $post['post_type'] ] ) ) {
792
-				$this_type = $post_types[ $post['post_type'] ];
791
+			if ( isset( $post_types[$post['post_type']] ) ) {
792
+				$this_type = $post_types[$post['post_type']];
793 793
 			}
794 794
 
795 795
 			if ( isset( $post['ID'] ) && $post_id == $post['ID'] ) {
796
-				$imported['updated'][ $this_type ] ++;
796
+				$imported['updated'][$this_type] ++;
797 797
 			} else {
798
-				$imported['imported'][ $this_type ] ++;
798
+				$imported['imported'][$this_type] ++;
799 799
 			}
800 800
 
801
-			$imported['posts'][ (int) $old_id ] = $post_id;
801
+			$imported['posts'][(int) $old_id] = $post_id;
802 802
 
803 803
 			do_action( 'frm_after_import_view', $post_id, $post );
804 804
 
@@ -815,9 +815,9 @@  discard block
 block discarded – undo
815 815
 			$post['attachment_url'] = (string) $item->attachment_url;
816 816
 		}
817 817
 
818
-		if ( $post['post_type'] == FrmFormActionsController::$action_post_type && isset( $imported['forms'][ (int) $post['menu_order'] ] ) ) {
818
+		if ( $post['post_type'] == FrmFormActionsController::$action_post_type && isset( $imported['forms'][(int) $post['menu_order']] ) ) {
819 819
 			// update to new form id
820
-			$post['menu_order'] = $imported['forms'][ (int) $post['menu_order'] ];
820
+			$post['menu_order'] = $imported['forms'][(int) $post['menu_order']];
821 821
 		}
822 822
 
823 823
 		// Don't allow default styles to take over a site's default style
@@ -844,8 +844,8 @@  discard block
 block discarded – undo
844 844
 		);
845 845
 
846 846
 		//switch old form and field ids to new ones
847
-		if ( $m['key'] == 'frm_form_id' && isset( $imported['forms'][ (int) $m['value'] ] ) ) {
848
-			$m['value'] = $imported['forms'][ (int) $m['value'] ];
847
+		if ( $m['key'] == 'frm_form_id' && isset( $imported['forms'][(int) $m['value']] ) ) {
848
+			$m['value'] = $imported['forms'][(int) $m['value']];
849 849
 		} else {
850 850
 			$m['value'] = FrmAppHelper::maybe_json_decode( $m['value'] );
851 851
 
@@ -856,15 +856,15 @@  discard block
 block discarded – undo
856 856
 				} elseif ( $m['key'] == 'frm_options' ) {
857 857
 
858 858
 					foreach ( array( 'date_field_id', 'edate_field_id' ) as $setting_name ) {
859
-						if ( isset( $m['value'][ $setting_name ] ) && is_numeric( $m['value'][ $setting_name ] ) && isset( $frm_duplicate_ids[ $m['value'][ $setting_name ] ] ) ) {
860
-							$m['value'][ $setting_name ] = $frm_duplicate_ids[ $m['value'][ $setting_name ] ];
859
+						if ( isset( $m['value'][$setting_name] ) && is_numeric( $m['value'][$setting_name] ) && isset( $frm_duplicate_ids[$m['value'][$setting_name]] ) ) {
860
+							$m['value'][$setting_name] = $frm_duplicate_ids[$m['value'][$setting_name]];
861 861
 						}
862 862
 					}
863 863
 
864 864
 					$check_dup_array = array();
865 865
 					if ( isset( $m['value']['order_by'] ) && ! empty( $m['value']['order_by'] ) ) {
866
-						if ( is_numeric( $m['value']['order_by'] ) && isset( $frm_duplicate_ids[ $m['value']['order_by'] ] ) ) {
867
-							$m['value']['order_by'] = $frm_duplicate_ids[ $m['value']['order_by'] ];
866
+						if ( is_numeric( $m['value']['order_by'] ) && isset( $frm_duplicate_ids[$m['value']['order_by']] ) ) {
867
+							$m['value']['order_by'] = $frm_duplicate_ids[$m['value']['order_by']];
868 868
 						} elseif ( is_array( $m['value']['order_by'] ) ) {
869 869
 							$check_dup_array[] = 'order_by';
870 870
 						}
@@ -875,9 +875,9 @@  discard block
 block discarded – undo
875 875
 					}
876 876
 
877 877
 					foreach ( $check_dup_array as $check_k ) {
878
-						foreach ( (array) $m['value'][ $check_k ] as $mk => $mv ) {
879
-							if ( isset( $frm_duplicate_ids[ $mv ] ) ) {
880
-								$m['value'][ $check_k ][ $mk ] = $frm_duplicate_ids[ $mv ];
878
+						foreach ( (array) $m['value'][$check_k] as $mk => $mv ) {
879
+							if ( isset( $frm_duplicate_ids[$mv] ) ) {
880
+								$m['value'][$check_k][$mk] = $frm_duplicate_ids[$mv];
881 881
 							}
882 882
 							unset( $mk, $mv );
883 883
 						}
@@ -890,7 +890,7 @@  discard block
 block discarded – undo
890 890
 			$m['value'] = FrmAppHelper::maybe_json_decode( $m['value'] );
891 891
 		}
892 892
 
893
-		$post['postmeta'][ (string) $meta->meta_key ] = $m['value'];
893
+		$post['postmeta'][(string) $meta->meta_key] = $m['value'];
894 894
 	}
895 895
 
896 896
 	/**
@@ -918,11 +918,11 @@  discard block
 block discarded – undo
918 918
 				$name = (string) $c;
919 919
 			}
920 920
 
921
-			if ( ! isset( $post['tax_input'][ $taxonomy ] ) ) {
922
-				$post['tax_input'][ $taxonomy ] = array();
921
+			if ( ! isset( $post['tax_input'][$taxonomy] ) ) {
922
+				$post['tax_input'][$taxonomy] = array();
923 923
 			}
924 924
 
925
-			$post['tax_input'][ $taxonomy ][] = $name;
925
+			$post['tax_input'][$taxonomy][] = $name;
926 926
 			unset( $name );
927 927
 		}
928 928
 	}
@@ -1021,7 +1021,7 @@  discard block
 block discarded – undo
1021 1021
 
1022 1022
 		$message = '<ul>';
1023 1023
 		foreach ( $result as $type => $results ) {
1024
-			if ( ! isset( $t_strings[ $type ] ) ) {
1024
+			if ( ! isset( $t_strings[$type] ) ) {
1025 1025
 				// only print imported and updated
1026 1026
 				continue;
1027 1027
 			}
@@ -1033,7 +1033,7 @@  discard block
 block discarded – undo
1033 1033
 			}
1034 1034
 
1035 1035
 			if ( ! empty( $s_message ) ) {
1036
-				$message .= '<li><strong>' . $t_strings[ $type ] . ':</strong> ';
1036
+				$message .= '<li><strong>' . $t_strings[$type] . ':</strong> ';
1037 1037
 				$message .= implode( ', ', $s_message );
1038 1038
 				$message .= '</li>';
1039 1039
 			}
@@ -1073,7 +1073,7 @@  discard block
 block discarded – undo
1073 1073
 			'actions' => sprintf( _n( '%1$s Form Action', '%1$s Form Actions', $m, 'formidable' ), $m ),
1074 1074
 		);
1075 1075
 
1076
-		$s_message[] = isset( $strings[ $type ] ) ? $strings[ $type ] : ' ' . $m . ' ' . ucfirst( $type );
1076
+		$s_message[] = isset( $strings[$type] ) ? $strings[$type] : ' ' . $m . ' ' . ucfirst( $type );
1077 1077
 	}
1078 1078
 
1079 1079
 	/**
@@ -1205,10 +1205,10 @@  discard block
 block discarded – undo
1205 1205
 		$array_defaults = array_filter( $defaults, 'is_array' );
1206 1206
 		foreach ( $array_defaults as $d => $default ) {
1207 1207
 			// compare array defaults
1208
-			if ( $default == $saved[ $d ] ) {
1209
-				unset( $saved[ $d ] );
1208
+			if ( $default == $saved[$d] ) {
1209
+				unset( $saved[$d] );
1210 1210
 			}
1211
-			unset( $defaults[ $d ] );
1211
+			unset( $defaults[$d] );
1212 1212
 		}
1213 1213
 		$saved = array_diff_assoc( (array) $saved, $defaults );
1214 1214
 	}
@@ -1219,14 +1219,14 @@  discard block
 block discarded – undo
1219 1219
 	 * @since 3.06
1220 1220
 	 */
1221 1221
 	private static function remove_default_html( $html_name, $defaults, &$options ) {
1222
-		if ( ! isset( $options[ $html_name ] ) || ! isset( $defaults[ $html_name ] ) ) {
1222
+		if ( ! isset( $options[$html_name] ) || ! isset( $defaults[$html_name] ) ) {
1223 1223
 			return;
1224 1224
 		}
1225 1225
 
1226
-		$old_html     = str_replace( "\r\n", "\n", $options[ $html_name ] );
1227
-		$default_html = $defaults[ $html_name ];
1226
+		$old_html     = str_replace( "\r\n", "\n", $options[$html_name] );
1227
+		$default_html = $defaults[$html_name];
1228 1228
 		if ( $old_html == $default_html ) {
1229
-			unset( $options[ $html_name ] );
1229
+			unset( $options[$html_name] );
1230 1230
 
1231 1231
 			return;
1232 1232
 		}
@@ -1234,7 +1234,7 @@  discard block
 block discarded – undo
1234 1234
 		// Account for some of the older field default HTML.
1235 1235
 		$default_html = str_replace( ' id="frm_desc_field_[key]"', '', $default_html );
1236 1236
 		if ( $old_html == $default_html ) {
1237
-			unset( $options[ $html_name ] );
1237
+			unset( $options[$html_name] );
1238 1238
 		}
1239 1239
 	}
1240 1240
 
@@ -1320,8 +1320,8 @@  discard block
 block discarded – undo
1320 1320
 		);
1321 1321
 
1322 1322
 		foreach ( $post_settings as $post_setting ) {
1323
-			if ( isset( $form_options[ $post_setting ] ) ) {
1324
-				$new_action['post_content'][ $post_setting ] = $form_options[ $post_setting ];
1323
+			if ( isset( $form_options[$post_setting] ) ) {
1324
+				$new_action['post_content'][$post_setting] = $form_options[$post_setting];
1325 1325
 			}
1326 1326
 			unset( $post_setting );
1327 1327
 		}
@@ -1391,11 +1391,11 @@  discard block
 block discarded – undo
1391 1391
 		foreach ( $post_content as $key => $setting ) {
1392 1392
 			if ( ! is_array( $setting ) && in_array( $key, $basic_fields ) ) {
1393 1393
 				// Replace old IDs with new IDs
1394
-				$post_content[ $key ] = str_replace( $old, $new, $setting );
1394
+				$post_content[$key] = str_replace( $old, $new, $setting );
1395 1395
 			} elseif ( is_array( $setting ) && in_array( $key, $array_fields ) ) {
1396 1396
 				foreach ( $setting as $k => $val ) {
1397 1397
 					// Replace old IDs with new IDs
1398
-					$post_content[ $key ][ $k ] = str_replace( $old, $new, $val );
1398
+					$post_content[$key][$k] = str_replace( $old, $new, $val );
1399 1399
 				}
1400 1400
 			}
1401 1401
 			unset( $key, $setting );
@@ -1471,8 +1471,8 @@  discard block
 block discarded – undo
1471 1471
 	private static function remove_deprecated_notification_settings( $form_id, $form_options ) {
1472 1472
 		$delete_settings = array( 'notification', 'autoresponder', 'email_to' );
1473 1473
 		foreach ( $delete_settings as $index ) {
1474
-			if ( isset( $form_options[ $index ] ) ) {
1475
-				unset( $form_options[ $index ] );
1474
+			if ( isset( $form_options[$index] ) ) {
1475
+				unset( $form_options[$index] );
1476 1476
 			}
1477 1477
 		}
1478 1478
 		FrmForm::update( $form_id, array( 'options' => $form_options ) );
@@ -1525,12 +1525,12 @@  discard block
 block discarded – undo
1525 1525
 			'reply_to_name' => '',
1526 1526
 		);
1527 1527
 		foreach ( $reply_fields as $f => $val ) {
1528
-			if ( isset( $notification[ $f ] ) ) {
1529
-				$atts[ $f ] = $notification[ $f ];
1530
-				if ( 'custom' == $notification[ $f ] ) {
1531
-					$atts[ $f ] = $notification[ 'cust_' . $f ];
1532
-				} elseif ( is_numeric( $atts[ $f ] ) && ! empty( $atts[ $f ] ) ) {
1533
-					$atts[ $f ] = '[' . $atts[ $f ] . ']';
1528
+			if ( isset( $notification[$f] ) ) {
1529
+				$atts[$f] = $notification[$f];
1530
+				if ( 'custom' == $notification[$f] ) {
1531
+					$atts[$f] = $notification['cust_' . $f];
1532
+				} elseif ( is_numeric( $atts[$f] ) && ! empty( $atts[$f] ) ) {
1533
+					$atts[$f] = '[' . $atts[$f] . ']';
1534 1534
 				}
1535 1535
 			}
1536 1536
 			unset( $f, $val );
@@ -1561,13 +1561,13 @@  discard block
 block discarded – undo
1561 1561
 		foreach ( $atts['email_to'] as $key => $email_field ) {
1562 1562
 
1563 1563
 			if ( is_numeric( $email_field ) ) {
1564
-				$atts['email_to'][ $key ] = '[' . $email_field . ']';
1564
+				$atts['email_to'][$key] = '[' . $email_field . ']';
1565 1565
 			}
1566 1566
 
1567 1567
 			if ( strpos( $email_field, '|' ) ) {
1568 1568
 				$email_opt = explode( '|', $email_field );
1569 1569
 				if ( isset( $email_opt[0] ) ) {
1570
-					$atts['email_to'][ $key ] = '[' . $email_opt[0] . ' show=' . $email_opt[1] . ']';
1570
+					$atts['email_to'][$key] = '[' . $email_opt[0] . ' show=' . $email_opt[1] . ']';
1571 1571
 				}
1572 1572
 				unset( $email_opt );
1573 1573
 			}
@@ -1588,12 +1588,12 @@  discard block
 block discarded – undo
1588 1588
 		// Add more fields to the new notification
1589 1589
 		$add_fields = array( 'email_message', 'email_subject', 'plain_text', 'inc_user_info', 'conditions' );
1590 1590
 		foreach ( $add_fields as $add_field ) {
1591
-			if ( isset( $notification[ $add_field ] ) ) {
1592
-				$new_notification['post_content'][ $add_field ] = $notification[ $add_field ];
1591
+			if ( isset( $notification[$add_field] ) ) {
1592
+				$new_notification['post_content'][$add_field] = $notification[$add_field];
1593 1593
 			} elseif ( in_array( $add_field, array( 'plain_text', 'inc_user_info' ) ) ) {
1594
-				$new_notification['post_content'][ $add_field ] = 0;
1594
+				$new_notification['post_content'][$add_field] = 0;
1595 1595
 			} else {
1596
-				$new_notification['post_content'][ $add_field ] = '';
1596
+				$new_notification['post_content'][$add_field] = '';
1597 1597
 			}
1598 1598
 			unset( $add_field );
1599 1599
 		}
@@ -1617,7 +1617,7 @@  discard block
 block discarded – undo
1617 1617
 		if ( isset( $post_content['conditions'] ) && is_array( $post_content['conditions'] ) ) {
1618 1618
 			foreach ( $post_content['conditions'] as $email_key => $val ) {
1619 1619
 				if ( is_numeric( $email_key ) ) {
1620
-					$post_content['conditions'][ $email_key ] = self::switch_action_field_ids( $val, array( 'hide_field' ) );
1620
+					$post_content['conditions'][$email_key] = self::switch_action_field_ids( $val, array( 'hide_field' ) );
1621 1621
 				}
1622 1622
 				unset( $email_key, $val );
1623 1623
 			}
Please login to merge, or discard this patch.