Completed
Pull Request — master (#2670)
by
unknown
40s
created
classes/models/FrmAddon.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 	 * @return array
140 140
 	 */
141 141
 	public function insert_installed_addon( $plugins ) {
142
-		$plugins[ $this->plugin_slug ] = $this;
142
+		$plugins[$this->plugin_slug] = $this;
143 143
 
144 144
 		return $plugins;
145 145
 	}
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
 	public static function get_addon( $plugin_slug ) {
153 153
 		$plugins = apply_filters( 'frm_installed_addons', array() );
154 154
 
155
-		return $plugins[ $plugin_slug ] ?? false;
155
+		return $plugins[$plugin_slug] ?? false;
156 156
 	}
157 157
 
158 158
 	/**
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
 		} else {
215 215
 			$api     = new FrmFormApi( $this->license );
216 216
 			$plugins = $api->get_api_info();
217
-			$_data   = $plugins[ $item_id ];
217
+			$_data   = $plugins[$item_id];
218 218
 		}
219 219
 
220 220
 		$_data['sections'] = array(
@@ -515,19 +515,19 @@  discard block
 block discarded – undo
515 515
 
516 516
 		if ( $this->is_current_version( $transient ) ) {
517 517
 			// Make sure it doesn't show there is an update if plugin is up-to-date.
518
-			if ( isset( $transient->response[ $this->plugin_folder ] ) ) {
519
-				unset( $transient->response[ $this->plugin_folder ] );
518
+			if ( isset( $transient->response[$this->plugin_folder] ) ) {
519
+				unset( $transient->response[$this->plugin_folder] );
520 520
 			}
521
-		} elseif ( isset( $transient->response ) && isset( $transient->response[ $this->plugin_folder ] ) ) {
522
-			$this->prepare_update_details( $transient->response[ $this->plugin_folder ] );
521
+		} elseif ( isset( $transient->response ) && isset( $transient->response[$this->plugin_folder] ) ) {
522
+			$this->prepare_update_details( $transient->response[$this->plugin_folder] );
523 523
 
524 524
 			// if the transient has expired, clear the update and trigger it again
525
-			if ( $transient->response[ $this->plugin_folder ] === false ) {
525
+			if ( $transient->response[$this->plugin_folder] === false ) {
526 526
 				if ( ! $this->has_been_cleared() ) {
527 527
 					$this->cleared_plugins();
528 528
 					$this->manually_queue_update();
529 529
 				}
530
-				unset( $transient->response[ $this->plugin_folder ] );
530
+				unset( $transient->response[$this->plugin_folder] );
531 531
 			}
532 532
 		}
533 533
 
@@ -640,7 +640,7 @@  discard block
 block discarded – undo
640 640
 	 * @return bool
641 641
 	 */
642 642
 	private function is_current_version( $transient ) {
643
-		if ( empty( $transient->checked ) || ! isset( $transient->checked[ $this->plugin_folder ] ) ) {
643
+		if ( empty( $transient->checked ) || ! isset( $transient->checked[$this->plugin_folder] ) ) {
644 644
 			return false;
645 645
 		}
646 646
 
@@ -650,7 +650,7 @@  discard block
 block discarded – undo
650 650
 			return true;
651 651
 		}
652 652
 
653
-		return isset( $transient->response ) && isset( $transient->response[ $this->plugin_folder ] ) && $transient->checked[ $this->plugin_folder ] === $transient->response[ $this->plugin_folder ]->new_version;
653
+		return isset( $transient->response ) && isset( $transient->response[$this->plugin_folder] ) && $transient->checked[$this->plugin_folder] === $transient->response[$this->plugin_folder]->new_version;
654 654
 	}
655 655
 
656 656
 	/**
@@ -818,8 +818,8 @@  discard block
 block discarded – undo
818 818
 		} else {
819 819
 			$messages = $this->get_messages();
820 820
 
821
-			if ( is_string( $response['status'] ) && isset( $messages[ $response['status'] ] ) ) {
822
-				$response['message'] = $messages[ $response['status'] ];
821
+			if ( is_string( $response['status'] ) && isset( $messages[$response['status']] ) ) {
822
+				$response['message'] = $messages[$response['status']];
823 823
 			} else {
824 824
 				$response['message'] = FrmAppHelper::kses( $response['status'], array( 'a' ) );
825 825
 			}
@@ -1002,7 +1002,7 @@  discard block
 block discarded – undo
1002 1002
 			'user-agent' => $this->plugin_slug . '/' . $this->version . '; ' . get_bloginfo( 'url' ),
1003 1003
 		);
1004 1004
 
1005
-		$resp              = wp_remote_post(
1005
+		$resp = wp_remote_post(
1006 1006
 			$this->store_url . '?l=' . urlencode( base64_encode( $this->license ) ),
1007 1007
 			$arg_array
1008 1008
 		);
Please login to merge, or discard this patch.
classes/helpers/FrmAppHelper.php 1 patch
Spacing   +87 added lines, -87 removed lines patch added patch discarded remove patch
@@ -330,7 +330,7 @@  discard block
 block discarded – undo
330 330
 			'fill'   => '#4d4d4d',
331 331
 			'orange' => '#f05a24',
332 332
 		);
333
-		$atts     = array_merge( $defaults, $atts );
333
+		$atts = array_merge( $defaults, $atts );
334 334
 
335 335
 		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'] ) . '">
336 336
 			<path fill="' . esc_attr( $atts['orange'] ) . '" d="M289.6 384h140v76h-140z"/>
@@ -435,7 +435,7 @@  discard block
 block discarded – undo
435 435
 	 * @return bool
436 436
 	 */
437 437
 	public static function is_formidable_admin() {
438
-		$page          = self::simple_get( 'page', 'sanitize_title' );
438
+		$page = self::simple_get( 'page', 'sanitize_title' );
439 439
 
440 440
 		if ( empty( $page ) ) {
441 441
 			return self::is_view_builder_page();
@@ -628,7 +628,7 @@  discard block
 block discarded – undo
628 628
 	 * @return string
629 629
 	 */
630 630
 	public static function get_server_value( $value ) {
631
-		return isset( $_SERVER[ $value ] ) ? wp_strip_all_tags( wp_unslash( $_SERVER[ $value ] ) ) : '';
631
+		return isset( $_SERVER[$value] ) ? wp_strip_all_tags( wp_unslash( $_SERVER[$value] ) ) : '';
632 632
 	}
633 633
 
634 634
 	/**
@@ -662,7 +662,7 @@  discard block
 block discarded – undo
662 662
 		$ip         = '';
663 663
 
664 664
 		foreach ( $ip_options as $key ) {
665
-			if ( ! isset( $_SERVER[ $key ] ) ) {
665
+			if ( ! isset( $_SERVER[$key] ) ) {
666 666
 				continue;
667 667
 			}
668 668
 
@@ -740,11 +740,11 @@  discard block
 block discarded – undo
740 740
 		}
741 741
 
742 742
 		if ( $src === 'get' ) {
743
-			$value = isset( $_POST[ $param ] ) ? wp_unslash( $_POST[ $param ] ) : ( isset( $_GET[ $param ] ) ? wp_unslash( $_GET[ $param ] ) : $default ); // phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
743
+			$value = isset( $_POST[$param] ) ? wp_unslash( $_POST[$param] ) : ( isset( $_GET[$param] ) ? wp_unslash( $_GET[$param] ) : $default ); // phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
744 744
 
745
-			if ( ! isset( $_POST[ $param ] ) && isset( $_GET[ $param ] ) && ! is_array( $value ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
745
+			if ( ! isset( $_POST[$param] ) && isset( $_GET[$param] ) && ! is_array( $value ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
746 746
 				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
747
-				$value = htmlspecialchars_decode( wp_unslash( $_GET[ $param ] ) );
747
+				$value = htmlspecialchars_decode( wp_unslash( $_GET[$param] ) );
748 748
 			}
749 749
 			self::sanitize_value( $sanitize, $value );
750 750
 		} else {
@@ -765,7 +765,7 @@  discard block
 block discarded – undo
765 765
 				}
766 766
 
767 767
 				$p     = trim( $p, ']' );
768
-				$value = $value[ $p ] ?? $default;
768
+				$value = $value[$p] ?? $default;
769 769
 			}
770 770
 		}
771 771
 
@@ -831,28 +831,28 @@  discard block
 block discarded – undo
831 831
 			'sanitize'   => 'sanitize_text_field',
832 832
 			'serialized' => false,
833 833
 		);
834
-		$args     = wp_parse_args( $args, $defaults );
834
+		$args = wp_parse_args( $args, $defaults );
835 835
 
836 836
 		$value = $args['default'];
837 837
 
838 838
 		if ( $args['type'] === 'get' ) {
839
-			if ( $_GET && isset( $_GET[ $args['param'] ] ) ) {
839
+			if ( $_GET && isset( $_GET[$args['param']] ) ) {
840 840
 				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
841
-				$value = wp_unslash( $_GET[ $args['param'] ] );
841
+				$value = wp_unslash( $_GET[$args['param']] );
842 842
 			}
843 843
 		} elseif ( $args['type'] === 'post' ) {
844
-			if ( isset( $_POST[ $args['param'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
844
+			if ( isset( $_POST[$args['param']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
845 845
 				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
846
-				$value = wp_unslash( $_POST[ $args['param'] ] );
846
+				$value = wp_unslash( $_POST[$args['param']] );
847 847
 
848 848
 				if ( $args['serialized'] === true && is_serialized_string( $value ) && is_serialized( $value ) ) {
849 849
 					self::unserialize_or_decode( $value );
850 850
 				}
851 851
 			}
852
-		} elseif ( isset( $_REQUEST[ $args['param'] ] ) ) {
852
+		} elseif ( isset( $_REQUEST[$args['param']] ) ) {
853 853
 			// phpcs:ignore WordPress.Security.NonceVerification.Missing
854 854
 				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
855
-				$value = wp_unslash( $_REQUEST[ $args['param'] ] );
855
+				$value = wp_unslash( $_REQUEST[$args['param']] );
856 856
 		}
857 857
 
858 858
 		self::sanitize_value( $args['sanitize'], $value );
@@ -901,7 +901,7 @@  discard block
 block discarded – undo
901 901
 			$temp_values = $value;
902 902
 
903 903
 			foreach ( $temp_values as $k => $v ) {
904
-				self::sanitize_value( $sanitize, $value[ $k ] );
904
+				self::sanitize_value( $sanitize, $value[$k] );
905 905
 			}
906 906
 			return;
907 907
 		}
@@ -919,8 +919,8 @@  discard block
 block discarded – undo
919 919
 		$temp_values = $values;
920 920
 
921 921
 		foreach ( $temp_values as $k => $val ) {
922
-			if ( isset( $sanitize_method[ $k ] ) ) {
923
-				$values[ $k ] = call_user_func( $sanitize_method[ $k ], $val );
922
+			if ( isset( $sanitize_method[$k] ) ) {
923
+				$values[$k] = call_user_func( $sanitize_method[$k], $val );
924 924
 			}
925 925
 		}
926 926
 	}
@@ -984,7 +984,7 @@  discard block
 block discarded – undo
984 984
 			$temp_values = $value;
985 985
 
986 986
 			foreach ( $temp_values as $k => $v ) {
987
-				self::decode_specialchars( $value[ $k ] );
987
+				self::decode_specialchars( $value[$k] );
988 988
 			}
989 989
 		} else {
990 990
 			self::decode_amp( $value );
@@ -1126,7 +1126,7 @@  discard block
 block discarded – undo
1126 1126
 	 * @return array
1127 1127
 	 */
1128 1128
 	public static function add_allowed_submit_button_tags( $allowed_html ) {
1129
-		$allowed_html['input']                    = array(
1129
+		$allowed_html['input'] = array(
1130 1130
 			'type'           => true,
1131 1131
 			'value'          => true,
1132 1132
 			'formnovalidate' => true,
@@ -1154,7 +1154,7 @@  discard block
 block discarded – undo
1154 1154
 			$allowed_html = $html;
1155 1155
 		} elseif ( ! empty( $allowed ) ) {
1156 1156
 			foreach ( (array) $allowed as $a ) {
1157
-				$allowed_html[ $a ] = $html[ $a ] ?? array();
1157
+				$allowed_html[$a] = $html[$a] ?? array();
1158 1158
 			}
1159 1159
 		}
1160 1160
 
@@ -1345,8 +1345,8 @@  discard block
 block discarded – undo
1345 1345
 
1346 1346
 		global $wp_query;
1347 1347
 
1348
-		if ( isset( $wp_query->query_vars[ $param ] ) ) {
1349
-			$value = $wp_query->query_vars[ $param ];
1348
+		if ( isset( $wp_query->query_vars[$param] ) ) {
1349
+			$value = $wp_query->query_vars[$param];
1350 1350
 		}
1351 1351
 
1352 1352
 		return $value;
@@ -1380,9 +1380,9 @@  discard block
 block discarded – undo
1380 1380
 			'frm_keyalt_solid_icon' => 'frm_key_solid_icon',
1381 1381
 		);
1382 1382
 
1383
-		if ( isset( $deprecated[ $icon ] ) ) {
1384
-			$icon  = $deprecated[ $icon ];
1385
-			$class = str_replace( $icon, $deprecated[ $icon ], $class );
1383
+		if ( isset( $deprecated[$icon] ) ) {
1384
+			$icon  = $deprecated[$icon];
1385
+			$class = str_replace( $icon, $deprecated[$icon], $class );
1386 1386
 		}
1387 1387
 
1388 1388
 		if ( $icon === $class ) {
@@ -1515,7 +1515,7 @@  discard block
 block discarded – undo
1515 1515
 	 * @return string|void
1516 1516
 	 */
1517 1517
 	public static function array_to_html_params( $atts, $echo = false ) {
1518
-		$callback = function () use ( $atts ) {
1518
+		$callback = function() use ( $atts ) {
1519 1519
 			if ( $atts ) {
1520 1520
 				foreach ( $atts as $key => $value ) {
1521 1521
 					echo ' ' . esc_attr( $key ) . '="' . esc_attr( $value ) . '"';
@@ -1704,7 +1704,7 @@  discard block
 block discarded – undo
1704 1704
 			'value'       => false,
1705 1705
 			'class'       => '',
1706 1706
 		);
1707
-		$atts     = array_merge( $defaults, $atts );
1707
+		$atts = array_merge( $defaults, $atts );
1708 1708
 
1709 1709
 		if ( $atts['input_id'] === 'template' && empty( $atts['tosearch'] ) ) {
1710 1710
 			$atts['tosearch'] = 'frm-card';
@@ -1784,7 +1784,7 @@  discard block
 block discarded – undo
1784 1784
 				'new_file_path' => self::plugin_path() . '/js',
1785 1785
 			)
1786 1786
 		);
1787
-		$new_file  = new FrmCreateFile( $file_atts );
1787
+		$new_file = new FrmCreateFile( $file_atts );
1788 1788
 
1789 1789
 		$files = array(
1790 1790
 			self::plugin_path() . '/js/formidable.min.js',
@@ -2004,8 +2004,8 @@  discard block
 block discarded – undo
2004 2004
 	 */
2005 2005
 	private static function get_dropdown_value_and_label_from_option( $option, $key, $args ) {
2006 2006
 		if ( is_array( $option ) ) {
2007
-			$value = $option[ $args['value_key'] ] ?? '';
2008
-			$label = $option[ $args['label_key'] ] ?? '';
2007
+			$value = $option[$args['value_key']] ?? '';
2008
+			$label = $option[$args['label_key']] ?? '';
2009 2009
 		} else {
2010 2010
 			$value = $key;
2011 2011
 			$label = $option;
@@ -2413,9 +2413,9 @@  discard block
 block discarded – undo
2413 2413
 			return $error;
2414 2414
 		}
2415 2415
 
2416
-		$nonce_value = $_REQUEST && isset( $_REQUEST[ $nonce_name ] ) ? sanitize_text_field( wp_unslash( $_REQUEST[ $nonce_name ] ) ) : '';
2416
+		$nonce_value = $_REQUEST && isset( $_REQUEST[$nonce_name] ) ? sanitize_text_field( wp_unslash( $_REQUEST[$nonce_name] ) ) : '';
2417 2417
 
2418
-		if ( $_REQUEST && ( ! isset( $_REQUEST[ $nonce_name ] ) || ! wp_verify_nonce( $nonce_value, $nonce ) ) ) {
2418
+		if ( $_REQUEST && ( ! isset( $_REQUEST[$nonce_name] ) || ! wp_verify_nonce( $nonce_value, $nonce ) ) ) {
2419 2419
 			$frm_settings = self::get_settings();
2420 2420
 			$error        = $frm_settings->admin_permission;
2421 2421
 		}
@@ -2467,7 +2467,7 @@  discard block
 block discarded – undo
2467 2467
 			} else {
2468 2468
 				foreach ( $value as $k => $v ) {
2469 2469
 					if ( ! is_array( $v ) ) {
2470
-						$value[ $k ] = call_user_func( $original_function, $v );
2470
+						$value[$k] = call_user_func( $original_function, $v );
2471 2471
 					}
2472 2472
 				}
2473 2473
 			}
@@ -2521,7 +2521,7 @@  discard block
 block discarded – undo
2521 2521
 			if ( is_array( $value ) ) {
2522 2522
 				$return = array_merge( $return, self::array_flatten( $value, $keys ) );
2523 2523
 			} elseif ( $keys === 'keep' ) {
2524
-					$return[ $key ] = $value;
2524
+					$return[$key] = $value;
2525 2525
 			} else {
2526 2526
 				$return[] = $value;
2527 2527
 			}
@@ -2616,11 +2616,11 @@  discard block
 block discarded – undo
2616 2616
 
2617 2617
 		$ver = $default;
2618 2618
 
2619
-		if ( ! isset( $wp_scripts->registered[ $handle ] ) ) {
2619
+		if ( ! isset( $wp_scripts->registered[$handle] ) ) {
2620 2620
 			return $ver;
2621 2621
 		}
2622 2622
 
2623
-		$query = $wp_scripts->registered[ $handle ];
2623
+		$query = $wp_scripts->registered[$handle];
2624 2624
 
2625 2625
 		if ( is_object( $query ) && ! empty( $query->ver ) ) {
2626 2626
 			$ver = $query->ver;
@@ -2638,7 +2638,7 @@  discard block
 block discarded – undo
2638 2638
 	 * @return string|null
2639 2639
 	 */
2640 2640
 	public static function js_redirect( $url, $echo = false ) {
2641
-		$callback = function () use ( $url ) {
2641
+		$callback = function() use ( $url ) {
2642 2642
 			echo '<script type="text/javascript">window.location="' . esc_url_raw( $url ) . '"</script>';
2643 2643
 		};
2644 2644
 		return self::clip( $callback, $echo );
@@ -2737,7 +2737,7 @@  discard block
 block discarded – undo
2737 2737
 			$suffix = 2;
2738 2738
 			do {
2739 2739
 				$key_check = $key . $separator . $suffix;
2740
-				++$suffix;
2740
+				++ $suffix;
2741 2741
 			} while ( in_array( $key_check, $similar_keys, true ) );
2742 2742
 
2743 2743
 			$key = $key_check;
@@ -2854,7 +2854,7 @@  discard block
 block discarded – undo
2854 2854
 
2855 2855
 		foreach ( array( 'name', 'description' ) as $var ) {
2856 2856
 			$default_val    = $record->{$var} ?? '';
2857
-			$values[ $var ] = self::get_param( $var, $default_val, 'get', 'wp_kses_post' );
2857
+			$values[$var] = self::get_param( $var, $default_val, 'get', 'wp_kses_post' );
2858 2858
 			unset( $var, $default_val );
2859 2859
 		}
2860 2860
 
@@ -2927,10 +2927,10 @@  discard block
 block discarded – undo
2927 2927
 			$meta_value = FrmEntryMeta::get_meta_value( $record, $field->id );
2928 2928
 		}//end if
2929 2929
 
2930
-		$field_type = $post_values['field_options'][ 'type_' . $field->id ] ?? $field->type;
2930
+		$field_type = $post_values['field_options']['type_' . $field->id] ?? $field->type;
2931 2931
 
2932
-		if ( isset( $post_values['item_meta'][ $field->id ] ) ) {
2933
-			$new_value = $post_values['item_meta'][ $field->id ];
2932
+		if ( isset( $post_values['item_meta'][$field->id] ) ) {
2933
+			$new_value = $post_values['item_meta'][$field->id];
2934 2934
 			self::unserialize_or_decode( $new_value );
2935 2935
 		} else {
2936 2936
 			$new_value = $meta_value;
@@ -2951,7 +2951,7 @@  discard block
 block discarded – undo
2951 2951
 
2952 2952
 		$field_array = array_merge( (array) $field->field_options, $field_array );
2953 2953
 
2954
-		$values['fields'][ $field->id ] = $field_array;
2954
+		$values['fields'][$field->id] = $field_array;
2955 2955
 	}
2956 2956
 
2957 2957
 	/**
@@ -3001,11 +3001,11 @@  discard block
 block discarded – undo
3001 3001
 		}
3002 3002
 
3003 3003
 		foreach ( $form->options as $opt => $value ) {
3004
-			if ( isset( $post_values[ $opt ] ) ) {
3005
-				$values[ $opt ] = $post_values[ $opt ];
3006
-				self::unserialize_or_decode( $values[ $opt ] );
3004
+			if ( isset( $post_values[$opt] ) ) {
3005
+				$values[$opt] = $post_values[$opt];
3006
+				self::unserialize_or_decode( $values[$opt] );
3007 3007
 			} else {
3008
-				$values[ $opt ] = $value;
3008
+				$values[$opt] = $value;
3009 3009
 			}
3010 3010
 		}
3011 3011
 
@@ -3024,8 +3024,8 @@  discard block
 block discarded – undo
3024 3024
 		$form_defaults = FrmFormsHelper::get_default_opts();
3025 3025
 
3026 3026
 		foreach ( $form_defaults as $opt => $default ) {
3027
-			if ( ! isset( $values[ $opt ] ) || $values[ $opt ] == '' ) {
3028
-				$values[ $opt ] = $post_values && isset( $post_values['options'][ $opt ] ) ? $post_values['options'][ $opt ] : $default;
3027
+			if ( ! isset( $values[$opt] ) || $values[$opt] == '' ) {
3028
+				$values[$opt] = $post_values && isset( $post_values['options'][$opt] ) ? $post_values['options'][$opt] : $default;
3029 3029
 			}
3030 3030
 
3031 3031
 			unset( $opt, $default );
@@ -3036,8 +3036,8 @@  discard block
 block discarded – undo
3036 3036
 		}
3037 3037
 
3038 3038
 		foreach ( array( 'before', 'after', 'submit' ) as $h ) {
3039
-			if ( ! isset( $values[ $h . '_html' ] ) ) {
3040
-				$values[ $h . '_html' ] = ( $post_values['options'][ $h . '_html' ] ?? FrmFormsHelper::get_default_html( $h ) );
3039
+			if ( ! isset( $values[$h . '_html'] ) ) {
3040
+				$values[$h . '_html'] = ( $post_values['options'][$h . '_html'] ?? FrmFormsHelper::get_default_html( $h ) );
3041 3041
 			}
3042 3042
 			unset( $h );
3043 3043
 		}
@@ -3256,12 +3256,12 @@  discard block
 block discarded – undo
3256 3256
 			// Show time in specified unit.
3257 3257
 			$levels = self::get_unit( $levels );
3258 3258
 
3259
-			if ( isset( $time_strings[ $levels ] ) ) {
3259
+			if ( isset( $time_strings[$levels] ) ) {
3260 3260
 				$diff         = array(
3261 3261
 					$levels => self::time_format( $levels, $diff ),
3262 3262
 				);
3263 3263
 				$time_strings = array(
3264
-					$levels => $time_strings[ $levels ],
3264
+					$levels => $time_strings[$levels],
3265 3265
 				);
3266 3266
 			}
3267 3267
 
@@ -3269,13 +3269,13 @@  discard block
 block discarded – undo
3269 3269
 		}
3270 3270
 
3271 3271
 		foreach ( $time_strings as $k => $v ) {
3272
-			if ( isset( $diff[ $k ] ) && $diff[ $k ] ) {
3273
-				$time_strings[ $k ] = $diff[ $k ] . ' ' . ( $diff[ $k ] > 1 ? $v[1] : $v[0] );
3274
-			} elseif ( isset( $diff[ $k ] ) && count( $time_strings ) === 1 ) {
3272
+			if ( isset( $diff[$k] ) && $diff[$k] ) {
3273
+				$time_strings[$k] = $diff[$k] . ' ' . ( $diff[$k] > 1 ? $v[1] : $v[0] );
3274
+			} elseif ( isset( $diff[$k] ) && count( $time_strings ) === 1 ) {
3275 3275
 				// Account for 0.
3276
-				$time_strings[ $k ] = $diff[ $k ] . ' ' . $v[1];
3276
+				$time_strings[$k] = $diff[$k] . ' ' . $v[1];
3277 3277
 			} else {
3278
-				unset( $time_strings[ $k ] );
3278
+				unset( $time_strings[$k] );
3279 3279
 			}
3280 3280
 		}
3281 3281
 
@@ -3299,8 +3299,8 @@  discard block
 block discarded – undo
3299 3299
 			'd' => 'days',
3300 3300
 		);
3301 3301
 
3302
-		if ( isset( $return[ $unit ] ) ) {
3303
-			return $diff[ $return[ $unit ] ];
3302
+		if ( isset( $return[$unit] ) ) {
3303
+			return $diff[$return[$unit]];
3304 3304
 		}
3305 3305
 
3306 3306
 		$total = $diff['days'] * self::convert_time( 'd', $unit );
@@ -3308,11 +3308,11 @@  discard block
 block discarded – undo
3308 3308
 		$times = array( 'h', 'i', 's' );
3309 3309
 
3310 3310
 		foreach ( $times as $time ) {
3311
-			if ( ! isset( $diff[ $time ] ) ) {
3311
+			if ( ! isset( $diff[$time] ) ) {
3312 3312
 				continue;
3313 3313
 			}
3314 3314
 
3315
-			$total += $diff[ $time ] * self::convert_time( $time, $unit );
3315
+			$total += $diff[$time] * self::convert_time( $time, $unit );
3316 3316
 		}
3317 3317
 
3318 3318
 		return floor( $total );
@@ -3337,7 +3337,7 @@  discard block
 block discarded – undo
3337 3337
 			'y' => DAY_IN_SECONDS * 365.25,
3338 3338
 		);
3339 3339
 
3340
-		return $convert[ $from ] / $convert[ $to ];
3340
+		return $convert[$from] / $convert[$to];
3341 3341
 	}
3342 3342
 
3343 3343
 	/**
@@ -3350,7 +3350,7 @@  discard block
 block discarded – undo
3350 3350
 	private static function get_unit( $unit ) {
3351 3351
 		$units = self::get_time_strings();
3352 3352
 
3353
-		if ( isset( $units[ $unit ] ) || is_numeric( $unit ) ) {
3353
+		if ( isset( $units[$unit] ) || is_numeric( $unit ) ) {
3354 3354
 			return $unit;
3355 3355
 		}
3356 3356
 
@@ -3474,17 +3474,17 @@  discard block
 block discarded – undo
3474 3474
 
3475 3475
 					case 1:
3476 3476
 						$l2 = $name;
3477
-						self::add_value_to_array( $name, $l2, $this_val, $vars[ $l1 ] );
3477
+						self::add_value_to_array( $name, $l2, $this_val, $vars[$l1] );
3478 3478
 						break;
3479 3479
 
3480 3480
 					case 2:
3481 3481
 						$l3 = $name;
3482
-						self::add_value_to_array( $name, $l3, $this_val, $vars[ $l1 ][ $l2 ] );
3482
+						self::add_value_to_array( $name, $l3, $this_val, $vars[$l1][$l2] );
3483 3483
 						break;
3484 3484
 
3485 3485
 					case 3:
3486 3486
 						$l4 = $name;
3487
-						self::add_value_to_array( $name, $l4, $this_val, $vars[ $l1 ][ $l2 ][ $l3 ] );
3487
+						self::add_value_to_array( $name, $l4, $this_val, $vars[$l1][$l2][$l3] );
3488 3488
 				}
3489 3489
 
3490 3490
 				unset( $this_val, $n );
@@ -3507,8 +3507,8 @@  discard block
 block discarded – undo
3507 3507
 	public static function add_value_to_array( $name, $l1, $val, &$vars ) {
3508 3508
 		if ( $name == '' ) {
3509 3509
 			$vars[] = $val;
3510
-		} elseif ( ! isset( $vars[ $l1 ] ) ) {
3511
-			$vars[ $l1 ] = $val;
3510
+		} elseif ( ! isset( $vars[$l1] ) ) {
3511
+			$vars[$l1] = $val;
3512 3512
 		}
3513 3513
 	}
3514 3514
 
@@ -3532,7 +3532,7 @@  discard block
 block discarded – undo
3532 3532
 			'new_tab'       => __( 'This option will open the link in a new browser tab. Please note that some popup blockers may prevent this from happening, in which case the link will be displayed.', 'formidable' ),
3533 3533
 		);
3534 3534
 
3535
-		if ( ! isset( $tooltips[ $name ] ) ) {
3535
+		if ( ! isset( $tooltips[$name] ) ) {
3536 3536
 			return;
3537 3537
 		}
3538 3538
 
@@ -3542,7 +3542,7 @@  discard block
 block discarded – undo
3542 3542
 			echo ' class="frm_help"';
3543 3543
 		}
3544 3544
 
3545
-		echo ' title="' . esc_attr( $tooltips[ $name ] );
3545
+		echo ' title="' . esc_attr( $tooltips[$name] );
3546 3546
 
3547 3547
 		if ( 'open' != $class ) {
3548 3548
 			echo '"';
@@ -3615,13 +3615,13 @@  discard block
 block discarded – undo
3615 3615
 	 * @return void
3616 3616
 	 */
3617 3617
 	private static function prepare_action_slashes( $val, $key, &$post_content ) {
3618
-		if ( ! isset( $post_content[ $key ] ) || is_numeric( $val ) ) {
3618
+		if ( ! isset( $post_content[$key] ) || is_numeric( $val ) ) {
3619 3619
 			return;
3620 3620
 		}
3621 3621
 
3622 3622
 		if ( is_array( $val ) ) {
3623 3623
 			foreach ( $val as $k1 => $v1 ) {
3624
-				self::prepare_action_slashes( $v1, $k1, $post_content[ $key ] );
3624
+				self::prepare_action_slashes( $v1, $k1, $post_content[$key] );
3625 3625
 				unset( $k1, $v1 );
3626 3626
 			}
3627 3627
 		} else {
@@ -3629,7 +3629,7 @@  discard block
 block discarded – undo
3629 3629
 			$val = stripslashes( $val );
3630 3630
 
3631 3631
 			// Add backslashes before double quotes and forward slashes only
3632
-			$post_content[ $key ] = addcslashes( $val, '"\\/' );
3632
+			$post_content[$key] = addcslashes( $val, '"\\/' );
3633 3633
 		}
3634 3634
 	}
3635 3635
 
@@ -3761,14 +3761,14 @@  discard block
 block discarded – undo
3761 3761
 
3762 3762
 			$key = $input['name'];
3763 3763
 
3764
-			if ( isset( $formatted[ $key ] ) ) {
3765
-				if ( is_array( $formatted[ $key ] ) ) {
3766
-					$formatted[ $key ][] = $input['value'];
3764
+			if ( isset( $formatted[$key] ) ) {
3765
+				if ( is_array( $formatted[$key] ) ) {
3766
+					$formatted[$key][] = $input['value'];
3767 3767
 				} else {
3768
-					$formatted[ $key ] = array( $formatted[ $key ], $input['value'] );
3768
+					$formatted[$key] = array( $formatted[$key], $input['value'] );
3769 3769
 				}
3770 3770
 			} else {
3771
-				$formatted[ $key ] = $input['value'];
3771
+				$formatted[$key] = $input['value'];
3772 3772
 			}
3773 3773
 		}
3774 3774
 
@@ -4499,8 +4499,8 @@  discard block
 block discarded – undo
4499 4499
 		}
4500 4500
 
4501 4501
 		foreach ( $keys as $key ) {
4502
-			if ( isset( $values[ $key ] ) ) {
4503
-				$values[ $key ] = self::kses( $values[ $key ], 'all' );
4502
+			if ( isset( $values[$key] ) ) {
4503
+				$values[$key] = self::kses( $values[$key], 'all' );
4504 4504
 			}
4505 4505
 		}
4506 4506
 
@@ -4567,7 +4567,7 @@  discard block
 block discarded – undo
4567 4567
 				'role',
4568 4568
 				'style',
4569 4569
 			);
4570
-			$safe      = in_array( $key, $safe_keys, true );
4570
+			$safe = in_array( $key, $safe_keys, true );
4571 4571
 		}//end if
4572 4572
 
4573 4573
 		/**
@@ -4715,7 +4715,7 @@  discard block
 block discarded – undo
4715 4715
 			return 0;
4716 4716
 		}
4717 4717
 
4718
-		return strlen( $parts[ count( $parts ) - 1 ] );
4718
+		return strlen( $parts[count( $parts ) - 1] );
4719 4719
 	}
4720 4720
 
4721 4721
 	/**
@@ -4735,7 +4735,7 @@  discard block
 block discarded – undo
4735 4735
 
4736 4736
 		add_filter(
4737 4737
 			'option_gmt_offset',
4738
-			function ( $offset ) {
4738
+			function( $offset ) {
4739 4739
 				if ( ! is_string( $offset ) || is_numeric( $offset ) ) {
4740 4740
 					// Leave a valid value alone.
4741 4741
 					return $offset;
@@ -4832,7 +4832,7 @@  discard block
 block discarded – undo
4832 4832
 			return;
4833 4833
 		}
4834 4834
 
4835
-		$ajax_callback = function () use ( $option ) {
4835
+		$ajax_callback = function() use ( $option ) {
4836 4836
 			self::dismiss_warning_message( $option );
4837 4837
 		};
4838 4838
 
@@ -4842,7 +4842,7 @@  discard block
 block discarded – undo
4842 4842
 
4843 4843
 		add_filter(
4844 4844
 			'frm_message_list',
4845
-			function ( $show_messages ) use ( $message, $option ) {
4845
+			function( $show_messages ) use ( $message, $option ) {
4846 4846
 				if ( get_option( $option, false ) ) {
4847 4847
 					return $show_messages;
4848 4848
 				}
Please login to merge, or discard this patch.