Completed
Pull Request — master (#251)
by Stephanie
02:34
created
classes/views/frm-forms/add_field_links.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -49,10 +49,10 @@
 block discarded – undo
49 49
 foreach ( $pro_fields as $field_key => $field_type ) {
50 50
 
51 51
 	if ( isset( $field_type['section'] ) ) {
52
-		if ( ! isset( $field_sections[ $field_type['section'] ] ) ) {
53
-			$field_sections[ $field_type['section'] ] = array();
52
+		if ( ! isset( $field_sections[$field_type['section']] ) ) {
53
+			$field_sections[$field_type['section']] = array();
54 54
 		}
55
-		$field_sections[ $field_type['section'] ][ $field_key ] = $field_type;
55
+		$field_sections[$field_type['section']][$field_key] = $field_type;
56 56
 		continue;
57 57
 	}
58 58
 
Please login to merge, or discard this patch.
classes/helpers/FrmFormsHelper.php 2 patches
Doc Comments   +8 added lines, -4 removed lines patch added patch discarded remove patch
@@ -219,6 +219,7 @@  discard block
 block discarded – undo
219 219
 
220 220
 	/**
221 221
 	 * @since 3.0
222
+	 * @return string
222 223
 	 */
223 224
 	public static function get_field_link_icon( $field_type ) {
224 225
 		if ( is_array( $field_type ) && isset( $field_type['icon'] ) ) {
@@ -698,6 +699,9 @@  discard block
 block discarded – undo
698 699
 		$reset_fields = true;
699 700
 	}
700 701
 
702
+	/**
703
+	 * @return string
704
+	 */
701 705
 	public static function replace_shortcodes( $html, $form, $title = false, $description = false, $values = array() ) {
702 706
 		$codes = array(
703 707
 			'form_name'        => $title,
@@ -858,7 +862,7 @@  discard block
 block discarded – undo
858 862
 	}
859 863
 
860 864
 	/**
861
-	 * @param object|string|boolean $form
865
+	 * @param string|boolean $form
862 866
 	 *
863 867
 	 * @return string
864 868
 	 */
@@ -1389,7 +1393,7 @@  discard block
 block discarded – undo
1389 1393
 	 *
1390 1394
 	 * @param array $values The $_POST array, which contains the values submitted in a form.
1391 1395
 	 *
1392
-	 * @return bool|string A warning message about unsafe params or false.
1396
+	 * @return false|string A warning message about unsafe params or false.
1393 1397
 	 */
1394 1398
 	private static function check_redirect_url_for_unsafe_params( $values ) {
1395 1399
 		if ( ! isset( $values['options'] ) ) {
@@ -1434,7 +1438,7 @@  discard block
 block discarded – undo
1434 1438
 	 *
1435 1439
 	 * @param array $unsafe_params_in_redirect Array of params from the redirect URL whose names are reserved words.
1436 1440
 	 *
1437
-	 * @return bool|string A string with an unsafe param message or false.
1441
+	 * @return false|string A string with an unsafe param message or false.
1438 1442
 	 */
1439 1443
 	private static function create_unsafe_param_warning( $unsafe_params_in_redirect ) {
1440 1444
 		$count                = count( $unsafe_params_in_redirect );
@@ -1465,7 +1469,7 @@  discard block
 block discarded – undo
1465 1469
 	 *
1466 1470
 	 * @since 4.04
1467 1471
 	 *
1468
-	 * @return array Array of WordPress reserved words.
1472
+	 * @return string[] Array of WordPress reserved words.
1469 1473
 	 */
1470 1474
 	public static function reserved_words() {
1471 1475
 		return array(
Please login to merge, or discard this patch.
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 			'class'        => '',
29 29
 			'inc_children' => 'exclude',
30 30
 		);
31
-		$args     = wp_parse_args( $args, $defaults );
31
+		$args = wp_parse_args( $args, $defaults );
32 32
 
33 33
 		if ( ! $args['field_id'] ) {
34 34
 			$args['field_id'] = $field_name;
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 	 */
71 71
 	public static function add_html_attr( $class, $param, &$add_html ) {
72 72
 		if ( ! empty( $class ) ) {
73
-			$add_html[ $param ] = sanitize_title( $param ) . '="' . esc_attr( trim( sanitize_text_field( $class ) ) ) . '"';
73
+			$add_html[$param] = sanitize_title( $param ) . '="' . esc_attr( trim( sanitize_text_field( $class ) ) ) . '"';
74 74
 		}
75 75
 	}
76 76
 
@@ -276,8 +276,8 @@  discard block
 block discarded – undo
276 276
 			'description' => '',
277 277
 		);
278 278
 		foreach ( $defaults as $var => $default ) {
279
-			if ( ! isset( $values[ $var ] ) ) {
280
-				$values[ $var ] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' );
279
+			if ( ! isset( $values[$var] ) ) {
280
+				$values[$var] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' );
281 281
 			}
282 282
 		}
283 283
 
@@ -292,8 +292,8 @@  discard block
 block discarded – undo
292 292
 			'parent_form_id' => 0,
293 293
 		);
294 294
 		foreach ( $defaults as $var => $default ) {
295
-			if ( ! isset( $values[ $var ] ) ) {
296
-				$values[ $var ] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' );
295
+			if ( ! isset( $values[$var] ) ) {
296
+				$values[$var] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' );
297 297
 			}
298 298
 		}
299 299
 		unset( $defaults );
@@ -330,16 +330,16 @@  discard block
 block discarded – undo
330 330
 		$defaults = self::get_default_opts();
331 331
 		foreach ( $defaults as $var => $default ) {
332 332
 			if ( is_array( $default ) ) {
333
-				if ( ! isset( $values[ $var ] ) ) {
334
-					$values[ $var ] = ( $record && isset( $record->options[ $var ] ) ) ? $record->options[ $var ] : array();
333
+				if ( ! isset( $values[$var] ) ) {
334
+					$values[$var] = ( $record && isset( $record->options[$var] ) ) ? $record->options[$var] : array();
335 335
 				}
336 336
 
337 337
 				foreach ( $default as $k => $v ) {
338
-					$values[ $var ][ $k ] = ( $post_values && isset( $post_values[ $var ][ $k ] ) ) ? $post_values[ $var ][ $k ] : ( ( $record && isset( $record->options[ $var ] ) && isset( $record->options[ $var ][ $k ] ) ) ? $record->options[ $var ][ $k ] : $v );
338
+					$values[$var][$k] = ( $post_values && isset( $post_values[$var][$k] ) ) ? $post_values[$var][$k] : ( ( $record && isset( $record->options[$var] ) && isset( $record->options[$var][$k] ) ) ? $record->options[$var][$k] : $v );
339 339
 
340 340
 					if ( is_array( $v ) ) {
341 341
 						foreach ( $v as $k1 => $v1 ) {
342
-							$values[ $var ][ $k ][ $k1 ] = ( $post_values && isset( $post_values[ $var ][ $k ][ $k1 ] ) ) ? $post_values[ $var ][ $k ][ $k1 ] : ( ( $record && isset( $record->options[ $var ] ) && isset( $record->options[ $var ][ $k ] ) && isset( $record->options[ $var ][ $k ][ $k1 ] ) ) ? $record->options[ $var ][ $k ][ $k1 ] : $v1 );
342
+							$values[$var][$k][$k1] = ( $post_values && isset( $post_values[$var][$k][$k1] ) ) ? $post_values[$var][$k][$k1] : ( ( $record && isset( $record->options[$var] ) && isset( $record->options[$var][$k] ) && isset( $record->options[$var][$k][$k1] ) ) ? $record->options[$var][$k][$k1] : $v1 );
343 343
 							unset( $k1, $v1 );
344 344
 						}
345 345
 					}
@@ -347,7 +347,7 @@  discard block
 block discarded – undo
347 347
 					unset( $k, $v );
348 348
 				}
349 349
 			} else {
350
-				$values[ $var ] = ( $post_values && isset( $post_values['options'][ $var ] ) ) ? $post_values['options'][ $var ] : ( ( $record && isset( $record->options[ $var ] ) ) ? $record->options[ $var ] : $default );
350
+				$values[$var] = ( $post_values && isset( $post_values['options'][$var] ) ) ? $post_values['options'][$var] : ( ( $record && isset( $record->options[$var] ) ) ? $record->options[$var] : $default );
351 351
 			}
352 352
 
353 353
 			unset( $var, $default );
@@ -385,7 +385,7 @@  discard block
 block discarded – undo
385 385
 	public static function fill_form_options( &$options, $values ) {
386 386
 		$defaults = self::get_default_opts();
387 387
 		foreach ( $defaults as $var => $default ) {
388
-			$options[ $var ] = isset( $values['options'][ $var ] ) ? $values['options'][ $var ] : $default;
388
+			$options[$var] = isset( $values['options'][$var] ) ? $values['options'][$var] : $default;
389 389
 			unset( $var, $default );
390 390
 		}
391 391
 	}
@@ -541,7 +541,7 @@  discard block
 block discarded – undo
541 541
 	public static function insert_opt_html( $args ) {
542 542
 		$class  = isset( $args['class'] ) ? $args['class'] : '';
543 543
 		$fields = FrmField::all_field_selection();
544
-		$field  = isset( $fields[ $args['type'] ] ) ? $fields[ $args['type'] ] : array();
544
+		$field  = isset( $fields[$args['type']] ) ? $fields[$args['type']] : array();
545 545
 
546 546
 		self::prepare_field_type( $field );
547 547
 
@@ -693,7 +693,7 @@  discard block
 block discarded – undo
693 693
 			FrmField::update( $field->id, array( 'field_order' => $field->field_order + 2 ) );
694 694
 		}
695 695
 
696
-		$add_order    += 2;
696
+		$add_order += 2;
697 697
 		$open         = false;
698 698
 		$reset_fields = true;
699 699
 	}
@@ -1045,10 +1045,10 @@  discard block
 block discarded – undo
1045 1045
 				$link .= ' onclick="return confirm(\'' . esc_attr( $link_details['confirm'] ) . '\')"';
1046 1046
 			}
1047 1047
 
1048
-			$label = ( isset( $link_details[ $length ] ) ? $link_details[ $length ] : $link_details['label'] );
1049
-			if ( $length == 'icon' && isset( $link_details[ $length ] ) ) {
1048
+			$label = ( isset( $link_details[$length] ) ? $link_details[$length] : $link_details['label'] );
1049
+			if ( $length == 'icon' && isset( $link_details[$length] ) ) {
1050 1050
 				$label = '<span class="' . $label . '" title="' . esc_attr( $link_details['label'] ) . '" aria-hidden="true"></span>';
1051
-				$link  .= ' aria-label="' . esc_attr( $link_details['label'] ) . '"';
1051
+				$link .= ' aria-label="' . esc_attr( $link_details['label'] ) . '"';
1052 1052
 			}
1053 1053
 
1054 1054
 			$link .= '>' . $label . '</a>';
@@ -1204,7 +1204,7 @@  discard block
 block discarded – undo
1204 1204
 			$status = 'publish';
1205 1205
 		}
1206 1206
 
1207
-		$name = $nice_names[ $status ];
1207
+		$name = $nice_names[$status];
1208 1208
 
1209 1209
 		return $name;
1210 1210
 	}
@@ -1231,11 +1231,11 @@  discard block
 block discarded – undo
1231 1231
 
1232 1232
 		if ( count( $categories ) === 1 ) {
1233 1233
 			$category = reset( $categories );
1234
-			$icon     = isset( $icons[ $category ] ) ? $icons[ $category ] : $icon;
1234
+			$icon     = isset( $icons[$category] ) ? $icons[$category] : $icon;
1235 1235
 		} elseif ( ! empty( $categories ) ) {
1236 1236
 			foreach ( $icons as $cat => $icon ) {
1237 1237
 				if ( ! in_array( $cat, $categories ) ) {
1238
-					unset( $icons[ $cat ] );
1238
+					unset( $icons[$cat] );
1239 1239
 				}
1240 1240
 			}
1241 1241
 			$icon = reset( $icons );
@@ -1361,7 +1361,7 @@  discard block
 block discarded – undo
1361 1361
 
1362 1362
 		foreach ( $item['categories'] as $k => $category ) {
1363 1363
 			if ( in_array( $category, $plans, true ) ) {
1364
-				unset( $item['categories'][ $k ] );
1364
+				unset( $item['categories'][$k] );
1365 1365
 
1366 1366
 				if ( $category === 'Personal' ) {
1367 1367
 					// Show the current package name.
Please login to merge, or discard this patch.
classes/models/FrmField.php 1 patch
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
 		$new_values['field_key'] = FrmAppHelper::get_unique_key( $key, $wpdb->prefix . 'frm_fields', 'field_key' );
218 218
 
219 219
 		foreach ( array( 'name', 'description', 'type', 'default_value' ) as $col ) {
220
-			$new_values[ $col ] = $values[ $col ];
220
+			$new_values[$col] = $values[$col];
221 221
 		}
222 222
 
223 223
 		$new_values['options'] = $values['options'];
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
 		$new_values['created_at']    = current_time( 'mysql', 1 );
230 230
 
231 231
 		if ( isset( $values['id'] ) ) {
232
-			$frm_duplicate_ids[ $values['field_key'] ] = $new_values['field_key'];
232
+			$frm_duplicate_ids[$values['field_key']] = $new_values['field_key'];
233 233
 			$new_values                                = apply_filters( 'frm_duplicated_field', $new_values );
234 234
 		}
235 235
 
@@ -238,9 +238,9 @@  discard block
 block discarded – undo
238 238
 		foreach ( $new_values as $k => $v ) {
239 239
 			if ( is_array( $v ) ) {
240 240
 				if ( $k === 'default_value' ) {
241
-					$new_values[ $k ] = FrmAppHelper::maybe_json_encode( $v );
241
+					$new_values[$k] = FrmAppHelper::maybe_json_encode( $v );
242 242
 				} else {
243
-					$new_values[ $k ] = serialize( $v );
243
+					$new_values[$k] = serialize( $v );
244 244
 				}
245 245
 			}
246 246
 			unset( $k, $v );
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
 
263 263
 		if ( $query_results ) {
264 264
 			if ( isset( $values['id'] ) ) {
265
-				$frm_duplicate_ids[ $values['id'] ] = $new_id;
265
+				$frm_duplicate_ids[$values['id']] = $new_id;
266 266
 			}
267 267
 
268 268
 			return $new_id;
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
 	public static function duplicate( $old_form_id, $form_id, $copy_keys = false, $blog_id = false ) {
275 275
 		global $frm_duplicate_ids;
276 276
 
277
-		$where  = array(
277
+		$where = array(
278 278
 			array(
279 279
 				'or'                => 1,
280 280
 				'fi.form_id'        => $old_form_id,
@@ -320,8 +320,8 @@  discard block
 block discarded – undo
320 320
 
321 321
 			$values                                 = apply_filters( 'frm_duplicated_field', $values );
322 322
 			$new_id                                 = self::create( $values );
323
-			$frm_duplicate_ids[ $field->id ]        = $new_id;
324
-			$frm_duplicate_ids[ $field->field_key ] = $new_id;
323
+			$frm_duplicate_ids[$field->id]        = $new_id;
324
+			$frm_duplicate_ids[$field->field_key] = $new_id;
325 325
 			unset( $field );
326 326
 		}
327 327
 	}
@@ -352,8 +352,8 @@  discard block
 block discarded – undo
352 352
 
353 353
 		// serialize array values
354 354
 		foreach ( array( 'field_options', 'options' ) as $opt ) {
355
-			if ( isset( $values[ $opt ] ) && is_array( $values[ $opt ] ) ) {
356
-				$values[ $opt ] = serialize( $values[ $opt ] );
355
+			if ( isset( $values[$opt] ) && is_array( $values[$opt] ) ) {
356
+				$values[$opt] = serialize( $values[$opt] );
357 357
 			}
358 358
 		}
359 359
 		if ( isset( $values['default_value'] ) && is_array( $values['default_value'] ) ) {
@@ -505,7 +505,7 @@  discard block
 block discarded – undo
505 505
 				'id'        => $id,
506 506
 				'field_key' => $id,
507 507
 			);
508
-			$type  = FrmDb::get_var( 'frm_fields', $where, $col );
508
+			$type = FrmDb::get_var( 'frm_fields', $where, $col );
509 509
 		}
510 510
 
511 511
 		return $type;
@@ -531,7 +531,7 @@  discard block
 block discarded – undo
531 531
 					continue;
532 532
 				}
533 533
 
534
-				$fields[ $result->id ] = $result;
534
+				$fields[$result->id] = $result;
535 535
 				$count ++;
536 536
 				if ( $limit == 1 ) {
537 537
 					$fields = $result;
@@ -577,7 +577,7 @@  discard block
 block discarded – undo
577 577
 			$count  = 0;
578 578
 			foreach ( $results as $result ) {
579 579
 				$count ++;
580
-				$fields[ $result->id ] = $result;
580
+				$fields[$result->id] = $result;
581 581
 				if ( ! empty( $limit ) && $count >= $limit ) {
582 582
 					break;
583 583
 				}
@@ -646,7 +646,7 @@  discard block
 block discarded – undo
646 646
 			}
647 647
 
648 648
 			if ( ! empty( $sub_fields ) ) {
649
-				$index        = $k + $index_offset;
649
+				$index = $k + $index_offset;
650 650
 				$index_offset += count( $sub_fields );
651 651
 				array_splice( $results, $index, 0, $sub_fields );
652 652
 			}
@@ -691,7 +691,7 @@  discard block
 block discarded – undo
691 691
 		$query_type = ( $limit == ' LIMIT 1' || $limit == 1 ) ? 'row' : 'results';
692 692
 
693 693
 		if ( is_array( $where ) ) {
694
-			$args    = array(
694
+			$args = array(
695 695
 				'order_by' => $order_by,
696 696
 				'limit'    => $limit,
697 697
 			);
@@ -722,9 +722,9 @@  discard block
 block discarded – undo
722 722
 				FrmDb::set_cache( $result->field_key, $result, 'frm_field' );
723 723
 
724 724
 				self::prepare_options( $result );
725
-				$results[ $r_key ]->field_options = $result->field_options;
726
-				$results[ $r_key ]->options       = $result->options;
727
-				$results[ $r_key ]->default_value = $result->default_value;
725
+				$results[$r_key]->field_options = $result->field_options;
726
+				$results[$r_key]->options       = $result->options;
727
+				$results[$r_key]->default_value = $result->default_value;
728 728
 
729 729
 				unset( $r_key, $result );
730 730
 			}
@@ -926,23 +926,23 @@  discard block
 block discarded – undo
926 926
 	}
927 927
 
928 928
 	public static function is_option_true_in_array( $field, $option ) {
929
-		return isset( $field[ $option ] ) && $field[ $option ];
929
+		return isset( $field[$option] ) && $field[$option];
930 930
 	}
931 931
 
932 932
 	public static function is_option_true_in_object( $field, $option ) {
933
-		return isset( $field->field_options[ $option ] ) && $field->field_options[ $option ];
933
+		return isset( $field->field_options[$option] ) && $field->field_options[$option];
934 934
 	}
935 935
 
936 936
 	public static function is_option_empty_in_array( $field, $option ) {
937
-		return ! isset( $field[ $option ] ) || empty( $field[ $option ] );
937
+		return ! isset( $field[$option] ) || empty( $field[$option] );
938 938
 	}
939 939
 
940 940
 	public static function is_option_empty_in_object( $field, $option ) {
941
-		return ! isset( $field->field_options[ $option ] ) || empty( $field->field_options[ $option ] );
941
+		return ! isset( $field->field_options[$option] ) || empty( $field->field_options[$option] );
942 942
 	}
943 943
 
944 944
 	public static function is_option_value_in_object( $field, $option ) {
945
-		return isset( $field->field_options[ $option ] ) && $field->field_options[ $option ] != '';
945
+		return isset( $field->field_options[$option] ) && $field->field_options[$option] != '';
946 946
 	}
947 947
 
948 948
 	/**
@@ -960,10 +960,10 @@  discard block
 block discarded – undo
960 960
 
961 961
 	public static function get_option_in_array( $field, $option ) {
962 962
 
963
-		if ( isset( $field[ $option ] ) ) {
964
-			$this_option = $field[ $option ];
965
-		} elseif ( isset( $field['field_options'] ) && is_array( $field['field_options'] ) && isset( $field['field_options'][ $option ] ) ) {
966
-			$this_option = $field['field_options'][ $option ];
963
+		if ( isset( $field[$option] ) ) {
964
+			$this_option = $field[$option];
965
+		} elseif ( isset( $field['field_options'] ) && is_array( $field['field_options'] ) && isset( $field['field_options'][$option] ) ) {
966
+			$this_option = $field['field_options'][$option];
967 967
 		} else {
968 968
 			$this_option = '';
969 969
 		}
@@ -972,7 +972,7 @@  discard block
 block discarded – undo
972 972
 	}
973 973
 
974 974
 	public static function get_option_in_object( $field, $option ) {
975
-		return isset( $field->field_options[ $option ] ) ? $field->field_options[ $option ] : '';
975
+		return isset( $field->field_options[$option] ) ? $field->field_options[$option] : '';
976 976
 	}
977 977
 
978 978
 	/**
Please login to merge, or discard this patch.
classes/models/FrmFormMigrator.php 2 patches
Doc Comments   +10 added lines patch added patch discarded remove patch
@@ -172,6 +172,9 @@  discard block
 block discarded – undo
172 172
 		return $response;
173 173
 	}
174 174
 
175
+	/**
176
+	 * @param string $source_form_name
177
+	 */
175 178
 	protected function prepare_new_form( $source_id, $source_form_name ) {
176 179
 		return array(
177 180
 			'import_form_id' => $source_id,
@@ -307,6 +310,7 @@  discard block
 block discarded – undo
307 310
 	 * This switches the name field to individual fields.
308 311
 	 *
309 312
 	 * @since 4.04.03
313
+	 * @param integer $remove
310 314
 	 */
311 315
 	protected function insert_fields_in_array( $subs, $start, $remove, &$fields ) {
312 316
 		array_splice( $fields, $start, $remove, $subs );
@@ -476,6 +480,9 @@  discard block
 block discarded – undo
476 480
 		return array();
477 481
 	}
478 482
 
483
+	/**
484
+	 * @param string $type
485
+	 */
479 486
 	private function is_unsupported_field( $type ) {
480 487
 		$fields = $this->unsupported_field_types();
481 488
 
@@ -491,6 +498,9 @@  discard block
 block discarded – undo
491 498
 		return array();
492 499
 	}
493 500
 
501
+	/**
502
+	 * @param string $type
503
+	 */
494 504
 	protected function should_skip_field( $type ) {
495 505
 		$skip_pro_fields = $this->skip_pro_fields();
496 506
 
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -396,7 +396,7 @@  discard block
 block discarded – undo
396 396
 	protected function create_fields( $form_id, &$form ) {
397 397
 		foreach ( $form['fields'] as $key => $new_field ) {
398 398
 			$new_field['form_id']         = $form_id;
399
-			$form['fields'][ $key ]['id'] = FrmField::create( $new_field );
399
+			$form['fields'][$key]['id'] = FrmField::create( $new_field );
400 400
 		}
401 401
 	}
402 402
 
@@ -426,9 +426,9 @@  discard block
 block discarded – undo
426 426
 			} elseif ( $key === 'the_post_title' ) {
427 427
 				$new_action->post_content['post_title'] = $value;
428 428
 			} elseif ( is_string( $value ) ) {
429
-				$new_action->post_content[ $key ] = $this->replace_smart_tags( $value, $form['fields'] );
429
+				$new_action->post_content[$key] = $this->replace_smart_tags( $value, $form['fields'] );
430 430
 			} else {
431
-				$new_action->post_content[ $key ] = $value;
431
+				$new_action->post_content[$key] = $value;
432 432
 			}
433 433
 		}
434 434
 
@@ -447,7 +447,7 @@  discard block
 block discarded – undo
447 447
 
448 448
 		$imported = $this->get_tracked_import();
449 449
 
450
-		$imported[ $this->slug ][ $new_form_id ] = $source_id;
450
+		$imported[$this->slug][$new_form_id] = $source_id;
451 451
 
452 452
 		update_option( $this->tracking, $imported, false );
453 453
 	}
@@ -467,11 +467,11 @@  discard block
 block discarded – undo
467 467
 	private function is_imported( $source_id ) {
468 468
 		$imported    = $this->get_tracked_import();
469 469
 		$new_form_id = 0;
470
-		if ( ! isset( $imported[ $this->slug ] ) || ! in_array( $source_id, $imported[ $this->slug ] ) ) {
470
+		if ( ! isset( $imported[$this->slug] ) || ! in_array( $source_id, $imported[$this->slug] ) ) {
471 471
 			return $new_form_id;
472 472
 		}
473 473
 
474
-		$new_form_id = array_search( $source_id, array_reverse( $imported[ $this->slug ], true ) );
474
+		$new_form_id = array_search( $source_id, array_reverse( $imported[$this->slug], true ) );
475 475
 		if ( ! empty( $new_form_id ) && empty( FrmForm::get_key_by_id( $new_form_id ) ) ) {
476 476
 			// Allow reimport if the form was deleted.
477 477
 			$new_form_id = 0;
Please login to merge, or discard this patch.
classes/controllers/FrmSMTPController.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
 	 *
280 280
 	 * @since 4.04.04
281 281
 	 *
282
-	 * @return array Step data.
282
+	 * @return string Step data.
283 283
 	 */
284 284
 	protected function get_data_step_install() {
285 285
 
@@ -326,7 +326,7 @@  discard block
 block discarded – undo
326 326
 	 *
327 327
 	 * @since 4.04.04
328 328
 	 *
329
-	 * @return array Step data.
329
+	 * @return string Step data.
330 330
 	 */
331 331
 	protected function get_data_step_setup() {
332 332
 
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -235,7 +235,7 @@
 block discarded – undo
235 235
 		if ( is_array( $upsell ) ) {
236 236
 			foreach ( $upsell as $k => $plugin ) {
237 237
 				if ( strpos( $plugin['slug'], 'wpforms' ) !== false ) {
238
-					unset( $upsell[ $k ] );
238
+					unset( $upsell[$k] );
239 239
 				}
240 240
 			}
241 241
 		}
Please login to merge, or discard this patch.
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.