Completed
Pull Request — master (#659)
by Burhan
53s
created
classes/helpers/FrmCSVExportHelper.php 2 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -122,7 +122,8 @@
 block discarded – undo
122 122
 
123 123
 	private static function field_headings( $col ) {
124 124
 		$field_type_obj = FrmFieldFactory::get_field_factory( $col );
125
-		if ( ! empty( $field_type_obj->is_combo_field ) ) { // This is combo field.
125
+		if ( ! empty( $field_type_obj->is_combo_field ) ) {
126
+// This is combo field.
126 127
 			return $field_type_obj->get_export_headings();
127 128
 		}
128 129
 
Please login to merge, or discard this patch.
Spacing   +50 added lines, -50 removed lines patch added patch discarded remove patch
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
 
124 124
 		unset( $filename );
125 125
 
126
-		$comment_count       = FrmDb::get_count(
126
+		$comment_count = FrmDb::get_count(
127 127
 			'frm_item_metas',
128 128
 			array(
129 129
 				'item_id'         => $atts['entry_ids'],
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
 	private static function prepare_csv_headings() {
207 207
 		$headings = array();
208 208
 		self::csv_headings( $headings );
209
-		$headings       = apply_filters(
209
+		$headings = apply_filters(
210 210
 			'frm_csv_columns',
211 211
 			$headings,
212 212
 			self::$form_id,
@@ -229,10 +229,10 @@  discard block
 block discarded – undo
229 229
 		$field_headings  = array();
230 230
 		$separate_values = array( 'user_id', 'file', 'data', 'date' );
231 231
 		if ( ! empty( $col->field_options['separate_value'] ) && ! in_array( $col->type, $separate_values, true ) ) {
232
-			$field_headings[ $col->id . '_label' ] = strip_tags( $col->name . ' ' . __( '(label)', 'formidable' ) );
232
+			$field_headings[$col->id . '_label'] = strip_tags( $col->name . ' ' . __( '(label)', 'formidable' ) );
233 233
 		}
234 234
 
235
-		$field_headings[ $col->id ] = strip_tags( $col->name );
235
+		$field_headings[$col->id] = strip_tags( $col->name );
236 236
 		$field_headings             = apply_filters(
237 237
 			'frm_csv_field_columns',
238 238
 			$field_headings,
@@ -252,14 +252,14 @@  discard block
 block discarded – undo
252 252
 		foreach ( self::$fields as $col ) {
253 253
 			if ( self::is_the_child_of_a_repeater( $col ) ) {
254 254
 				$repeater_id                           = $col->field_options['in_section'];
255
-				$headings[ 'repeater' . $repeater_id ] = array(); // set a placeholder to maintain order for repeater fields
255
+				$headings['repeater' . $repeater_id] = array(); // set a placeholder to maintain order for repeater fields
256 256
 
257
-				if ( ! isset( $fields_by_repeater_id[ $repeater_id ] ) ) {
258
-					$fields_by_repeater_id[ $repeater_id ] = array();
257
+				if ( ! isset( $fields_by_repeater_id[$repeater_id] ) ) {
258
+					$fields_by_repeater_id[$repeater_id] = array();
259 259
 					$repeater_ids[]                        = $repeater_id;
260 260
 				}
261 261
 
262
-				$fields_by_repeater_id[ $repeater_id ][] = $col;
262
+				$fields_by_repeater_id[$repeater_id][] = $col;
263 263
 
264 264
 				continue;
265 265
 			}
@@ -278,8 +278,8 @@  discard block
 block discarded – undo
278 278
 				$end    = strpos( $row->meta_value, ':{' );
279 279
 				$length = substr( $row->meta_value, $start, $end - $start );
280 280
 
281
-				if ( $length > $max[ $row->field_id ] ) {
282
-					$max[ $row->field_id ] = $length;
281
+				if ( $length > $max[$row->field_id] ) {
282
+					$max[$row->field_id] = $length;
283 283
 				}
284 284
 			}
285 285
 			unset( $start, $end, $length, $row, $repeater_meta, $where );
@@ -290,17 +290,17 @@  discard block
 block discarded – undo
290 290
 					$repeater_id = str_replace( 'repeater', '', $key );
291 291
 
292 292
 					$repeater_headings = array();
293
-					foreach ( $fields_by_repeater_id[ $repeater_id ] as $col ) {
293
+					foreach ( $fields_by_repeater_id[$repeater_id] as $col ) {
294 294
 						$repeater_headings += self::field_headings( $col );
295 295
 					}
296 296
 
297
-					for ( $i = 0; $i < $max[ $repeater_id ]; $i ++ ) {
297
+					for ( $i = 0; $i < $max[$repeater_id]; $i ++ ) {
298 298
 						foreach ( $repeater_headings as $repeater_key => $repeater_name ) {
299
-							$flat[ $repeater_key . '[' . $i . ']' ] = $repeater_name;
299
+							$flat[$repeater_key . '[' . $i . ']'] = $repeater_name;
300 300
 						}
301 301
 					}
302 302
 				} else {
303
-					$flat[ $key ] = $heading;
303
+					$flat[$key] = $heading;
304 304
 				}
305 305
 			}
306 306
 
@@ -314,9 +314,9 @@  discard block
 block discarded – undo
314 314
 
315 315
 		if ( self::$comment_count ) {
316 316
 			for ( $i = 0; $i < self::$comment_count; $i ++ ) {
317
-				$headings[ 'comment' . $i ]            = __( 'Comment', 'formidable' );
318
-				$headings[ 'comment_user_id' . $i ]    = __( 'Comment User', 'formidable' );
319
-				$headings[ 'comment_created_at' . $i ] = __( 'Comment Date', 'formidable' );
317
+				$headings['comment' . $i]            = __( 'Comment', 'formidable' );
318
+				$headings['comment_user_id' . $i]    = __( 'Comment User', 'formidable' );
319
+				$headings['comment_created_at' . $i] = __( 'Comment Date', 'formidable' );
320 320
 			}
321 321
 			unset( $i );
322 322
 		}
@@ -361,7 +361,7 @@  discard block
 block discarded – undo
361 361
 
362 362
 	private static function prepare_next_csv_rows( $next_set ) {
363 363
 		// order by parent_item_id so children will be first
364
-		$where   = array(
364
+		$where = array(
365 365
 			'or'             => 1,
366 366
 			'id'             => $next_set,
367 367
 			'parent_item_id' => $next_set,
@@ -407,32 +407,32 @@  discard block
 block discarded – undo
407 407
 					continue;
408 408
 				}
409 409
 
410
-				if ( ! isset( $entries[ self::$entry->parent_item_id ] ) ) {
411
-					$entries[ self::$entry->parent_item_id ]        = new stdClass();
412
-					$entries[ self::$entry->parent_item_id ]->metas = array();
410
+				if ( ! isset( $entries[self::$entry->parent_item_id] ) ) {
411
+					$entries[self::$entry->parent_item_id]        = new stdClass();
412
+					$entries[self::$entry->parent_item_id]->metas = array();
413 413
 				}
414 414
 
415
-				if ( ! isset( $entries[ self::$entry->parent_item_id ]->metas[ $meta_id ] ) ) {
416
-					$entries[ self::$entry->parent_item_id ]->metas[ $meta_id ] = array();
417
-				} elseif ( ! is_array( $entries[ self::$entry->parent_item_id ]->metas[ $meta_id ] ) ) {
415
+				if ( ! isset( $entries[self::$entry->parent_item_id]->metas[$meta_id] ) ) {
416
+					$entries[self::$entry->parent_item_id]->metas[$meta_id] = array();
417
+				} elseif ( ! is_array( $entries[self::$entry->parent_item_id]->metas[$meta_id] ) ) {
418 418
 					// if the data is here, it should be an array but if this field has collected data
419 419
 					// both while inside and outside of the repeating section, it's possible this is a string
420
-					$entries[ self::$entry->parent_item_id ]->metas[ $meta_id ] = (array) $entries[ self::$entry->parent_item_id ]->metas[ $meta_id ];
420
+					$entries[self::$entry->parent_item_id]->metas[$meta_id] = (array) $entries[self::$entry->parent_item_id]->metas[$meta_id];
421 421
 				}
422 422
 
423 423
 				//add the repeated values
424
-				$entries[ self::$entry->parent_item_id ]->metas[ $meta_id ][] = $meta_value;
424
+				$entries[self::$entry->parent_item_id]->metas[$meta_id][] = $meta_value;
425 425
 			}
426 426
 
427 427
 			self::$entry->metas                              = self::fill_missing_repeater_metas( self::$entry->metas, $entries );
428
-			$entries[ self::$entry->parent_item_id ]->metas += self::$entry->metas;
428
+			$entries[self::$entry->parent_item_id]->metas += self::$entry->metas;
429 429
 		}
430 430
 
431 431
 		// add the embedded form id
432
-		if ( ! isset( $entries[ self::$entry->parent_item_id ]->embedded_fields ) ) {
433
-			$entries[ self::$entry->parent_item_id ]->embedded_fields = array();
432
+		if ( ! isset( $entries[self::$entry->parent_item_id]->embedded_fields ) ) {
433
+			$entries[self::$entry->parent_item_id]->embedded_fields = array();
434 434
 		}
435
-		$entries[ self::$entry->parent_item_id ]->embedded_fields[ self::$entry->id ] = self::$entry->form_id;
435
+		$entries[self::$entry->parent_item_id]->embedded_fields[self::$entry->id] = self::$entry->form_id;
436 436
 	}
437 437
 
438 438
 	/**
@@ -453,14 +453,14 @@  discard block
 block discarded – undo
453 453
 		}
454 454
 
455 455
 		$repeater_id = $field->field_options['in_section'];
456
-		if ( ! isset( self::$fields_by_repeater_id[ $repeater_id ] ) ) {
456
+		if ( ! isset( self::$fields_by_repeater_id[$repeater_id] ) ) {
457 457
 			return $metas;
458 458
 		}
459 459
 
460
-		foreach ( self::$fields_by_repeater_id[ $repeater_id ] as $repeater_child ) {
461
-			if ( ! isset( $metas[ $repeater_child->id ] ) ) {
462
-				$metas[ $repeater_child->id ]                                            = '';
463
-				$entries[ self::$entry->parent_item_id ]->metas[ $repeater_child->id ][] = '';
460
+		foreach ( self::$fields_by_repeater_id[$repeater_id] as $repeater_child ) {
461
+			if ( ! isset( $metas[$repeater_child->id] ) ) {
462
+				$metas[$repeater_child->id]                                            = '';
463
+				$entries[self::$entry->parent_item_id]->metas[$repeater_child->id][] = '';
464 464
 			}
465 465
 		}
466 466
 
@@ -479,7 +479,7 @@  discard block
 block discarded – undo
479 479
 
480 480
 	private static function add_field_values_to_csv( &$row ) {
481 481
 		foreach ( self::$fields as $col ) {
482
-			$field_value = isset( self::$entry->metas[ $col->id ] ) ? self::$entry->metas[ $col->id ] : false;
482
+			$field_value = isset( self::$entry->metas[$col->id] ) ? self::$entry->metas[$col->id] : false;
483 483
 
484 484
 			FrmAppHelper::unserialize_or_decode( $field_value );
485 485
 			self::add_array_values_to_columns( $row, compact( 'col', 'field_value' ) );
@@ -498,17 +498,17 @@  discard block
 block discarded – undo
498 498
 			if ( ! empty( $col->field_options['separate_value'] ) ) {
499 499
 				$label_key = $col->id . '_label';
500 500
 				if ( self::is_the_child_of_a_repeater( $col ) ) {
501
-					$row[ $label_key ] = array();
501
+					$row[$label_key] = array();
502 502
 					foreach ( $field_value as $value ) {
503
-						$row[ $label_key ][] = self::get_separate_value_label( $value, $col );
503
+						$row[$label_key][] = self::get_separate_value_label( $value, $col );
504 504
 					}
505 505
 				} else {
506
-					$row[ $label_key ] = self::get_separate_value_label( $field_value, $col );
506
+					$row[$label_key] = self::get_separate_value_label( $field_value, $col );
507 507
 				}
508 508
 				unset( $label_key );
509 509
 			}
510 510
 
511
-			$row[ $col->id ] = $field_value;
511
+			$row[$col->id] = $field_value;
512 512
 
513 513
 			unset( $col, $field_value );
514 514
 		}
@@ -531,7 +531,7 @@  discard block
 block discarded – undo
531 531
 				'show_icon'         => false,
532 532
 				'entry_id'          => self::$entry->id,
533 533
 				'sep'               => self::$separator,
534
-				'embedded_field_id' => ( isset( self::$entry->embedded_fields ) && isset( self::$entry->embedded_fields[ self::$entry->id ] ) ) ? 'form' . self::$entry->embedded_fields[ self::$entry->id ] : 0,
534
+				'embedded_field_id' => ( isset( self::$entry->embedded_fields ) && isset( self::$entry->embedded_fields[self::$entry->id] ) ) ? 'form' . self::$entry->embedded_fields[self::$entry->id] : 0,
535 535
 			)
536 536
 		);
537 537
 	}
@@ -546,8 +546,8 @@  discard block
 block discarded – undo
546 546
 					// This is combo field inside repeater. The heading key has this format: [86_first[0]].
547 547
 					foreach ( $sub_value as $sub_key => $sub_sub_value ) {
548 548
 						$column_key = $atts['col']->id . '_' . $sub_key . '[' . $key . ']';
549
-						if ( ! is_numeric( $sub_key ) && isset( self::$headings[ $column_key ] ) ) {
550
-							$row[ $column_key ] = $sub_sub_value;
549
+						if ( ! is_numeric( $sub_key ) && isset( self::$headings[$column_key] ) ) {
550
+							$row[$column_key] = $sub_sub_value;
551 551
 						}
552 552
 					}
553 553
 
@@ -555,8 +555,8 @@  discard block
 block discarded – undo
555 555
 				}
556 556
 
557 557
 				$column_key = $atts['col']->id . '_' . $key;
558
-				if ( ! is_numeric( $key ) && isset( self::$headings[ $column_key ] ) ) {
559
-					$row[ $column_key ] = $sub_value;
558
+				if ( ! is_numeric( $key ) && isset( self::$headings[$column_key] ) ) {
559
+					$row[$column_key] = $sub_value;
560 560
 				}
561 561
 			}
562 562
 		}
@@ -581,18 +581,18 @@  discard block
 block discarded – undo
581 581
 		$echo = 'echo' === self::$mode;
582 582
 
583 583
 		foreach ( self::$headings as $k => $heading ) {
584
-			if ( isset( $rows[ $k ] ) ) {
585
-				$row = $rows[ $k ];
584
+			if ( isset( $rows[$k] ) ) {
585
+				$row = $rows[$k];
586 586
 			} else {
587 587
 				$row = '';
588 588
 				// array indexed data is not at $rows[ $k ]
589
-				if ( $k[ strlen( $k ) - 1 ] === ']' ) {
589
+				if ( $k[strlen( $k ) - 1] === ']' ) {
590 590
 					$start = strrpos( $k, '[' );
591 591
 					$key   = substr( $k, 0, $start ++ );
592 592
 					$index = substr( $k, $start, strlen( $k ) - 1 - $start );
593 593
 
594
-					if ( isset( $rows[ $key ] ) && isset( $rows[ $key ][ $index ] ) ) {
595
-						$row = $rows[ $key ][ $index ];
594
+					if ( isset( $rows[$key] ) && isset( $rows[$key][$index] ) ) {
595
+						$row = $rows[$key][$index];
596 596
 					}
597 597
 
598 598
 					unset( $start, $key, $index );
Please login to merge, or discard this patch.
classes/models/FrmAntiSpam.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -213,10 +213,10 @@
 block discarded – undo
213 213
 			return false;
214 214
 		}
215 215
 		$form_params = $frm_vars['form_params'];
216
-		if ( ! isset( $form_params[ $this->form_id ] ) ) {
216
+		if ( ! isset( $form_params[$this->form_id] ) ) {
217 217
 			return false;
218 218
 		}
219
-		$this_form_params = $form_params[ $this->form_id ];
219
+		$this_form_params = $form_params[$this->form_id];
220 220
 		return ! empty( $this_form_params['action'] ) && 'update' === $this_form_params['action'];
221 221
 	}
222 222
 
Please login to merge, or discard this patch.
classes/models/FrmHoneypot.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@
 block discarded – undo
48 48
 	private function check_honeypot_setting() {
49 49
 		$form = $this->get_form();
50 50
 		$key  = $this->get_option_key();
51
-		return $form->options[ $key ];
51
+		return $form->options[$key];
52 52
 	}
53 53
 
54 54
 	/**
Please login to merge, or discard this patch.
classes/models/FrmValidate.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
38 38
 	protected function is_option_on() {
39 39
 		$form = $this->get_form();
40 40
 		$key  = $this->get_option_key();
41
-		return ! empty( $form->options[ $key ] ) && 'off' !== $form->options[ $key ];
41
+		return ! empty( $form->options[$key] ) && 'off' !== $form->options[$key];
42 42
 	}
43 43
 
44 44
 	/**
Please login to merge, or discard this patch.
classes/models/fields/FrmFieldName.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -46,19 +46,19 @@  discard block
 block discarded – undo
46 46
 		$result = array();
47 47
 
48 48
 		foreach ( $names as $name ) {
49
-			if ( empty( $this->sub_fields[ $name ] ) ) {
49
+			if ( empty( $this->sub_fields[$name] ) ) {
50 50
 				continue;
51 51
 			}
52 52
 
53
-			if ( ! isset( $this->sub_fields[ $name ]['wrapper_classes'] ) ) {
54
-				$this->sub_fields[ $name ]['wrapper_classes'] = $col_class;
55
-			} elseif ( is_array( $this->sub_fields[ $name ]['wrapper_classes'] ) ) {
56
-				$this->sub_fields[ $name ]['wrapper_classes'] = implode( ' ', $this->sub_fields[ $name ]['wrapper_classes'] ) . ' ' . $col_class;
53
+			if ( ! isset( $this->sub_fields[$name]['wrapper_classes'] ) ) {
54
+				$this->sub_fields[$name]['wrapper_classes'] = $col_class;
55
+			} elseif ( is_array( $this->sub_fields[$name]['wrapper_classes'] ) ) {
56
+				$this->sub_fields[$name]['wrapper_classes'] = implode( ' ', $this->sub_fields[$name]['wrapper_classes'] ) . ' ' . $col_class;
57 57
 			} else {
58
-				$this->sub_fields[ $name ]['wrapper_classes'] .= ' ' . $col_class;
58
+				$this->sub_fields[$name]['wrapper_classes'] .= ' ' . $col_class;
59 59
 			}
60 60
 
61
-			$result[ $name ] = $this->sub_fields[ $name ];
61
+			$result[$name] = $this->sub_fields[$name];
62 62
 		}
63 63
 
64 64
 		return $result;
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 
90 90
 		// Default desc.
91 91
 		foreach ( $this->sub_fields as $name => $sub_field ) {
92
-			$extra_options[ $name . '_desc' ] = $sub_field['label'];
92
+			$extra_options[$name . '_desc'] = $sub_field['label'];
93 93
 		}
94 94
 
95 95
 		return $extra_options;
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
 		$name_layout = $this->get_name_layout();
126 126
 
127 127
 		if ( ! empty( $atts['show'] ) ) {
128
-			return isset( $value[ $atts['show'] ] ) ? $value[ $atts['show'] ] : '';
128
+			return isset( $value[$atts['show']] ) ? $value[$atts['show']] : '';
129 129
 		}
130 130
 
131 131
 		$value = wp_parse_args(
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
 			$args['sub_fields'] = $this->sub_fields;
199 199
 
200 200
 			foreach ( $hidden_fields as $name => $hidden_field ) {
201
-				$args['sub_fields'][ $name ]['wrapper_classes'] .= ' frm_hidden';
201
+				$args['sub_fields'][$name]['wrapper_classes'] .= ' frm_hidden';
202 202
 			}
203 203
 		}
204 204
 	}
Please login to merge, or discard this patch.
classes/models/FrmPluginSearch.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -75,16 +75,16 @@  discard block
 block discarded – undo
75 75
 			'name'                => sprintf(
76 76
 				/* translators: Formidable addon name */
77 77
 				esc_html_x( 'Formidable %s', 'Formidable Addon Name', 'formidable' ),
78
-				$addon_list[ $matching_addon ]['name']
78
+				$addon_list[$matching_addon]['name']
79 79
 			),
80
-			'addon'               => $addon_list[ $matching_addon ]['slug'],
81
-			'short_description'   => $addon_list[ $matching_addon ]['excerpt'],
80
+			'addon'               => $addon_list[$matching_addon]['slug'],
81
+			'short_description'   => $addon_list[$matching_addon]['excerpt'],
82 82
 			'slug'                => self::$slug,
83
-			'version'             => $addon_list[ $matching_addon ]['version'],
83
+			'version'             => $addon_list[$matching_addon]['version'],
84 84
 		);
85 85
 
86 86
 		// Splice in the base addon data.
87
-		$inject = array_merge( $inject, $addon_list[ $matching_addon ], $overrides );
87
+		$inject = array_merge( $inject, $addon_list[$matching_addon], $overrides );
88 88
 
89 89
 		// Add it to the top of the list.
90 90
 		array_unshift( $result->plugins, $inject );
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
 	 * @return array
137 137
 	 */
138 138
 	private function get_addons() {
139
-		$api    = new FrmFormApi();
139
+		$api = new FrmFormApi();
140 140
 		return $api->get_api_info();
141 141
 	}
142 142
 
@@ -341,7 +341,7 @@  discard block
 block discarded – undo
341 341
 
342 342
 		$all_plugins = get_plugins();
343 343
 
344
-		return isset( $all_plugins[ $plugin ] );
344
+		return isset( $all_plugins[$plugin] );
345 345
 	}
346 346
 
347 347
 	/**
Please login to merge, or discard this patch.
classes/views/frm-forms/form.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
 			$grid_helper     = new FrmFieldGridHelper();
31 31
 			$values['count'] = 0;
32 32
 			foreach ( $values['fields'] as $field ) {
33
-				$values['count']++;
33
+				$values['count'] ++;
34 34
 				$grid_helper->set_field( $field );
35 35
 				$grid_helper->maybe_begin_field_wrapper();
36 36
 				FrmFieldsController::load_single_field( $field, $values );
Please login to merge, or discard this patch.
classes/widgets/FrmElementorWidget.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -86,7 +86,7 @@
 block discarded – undo
86 86
 
87 87
 			foreach ( $forms as $form ) {
88 88
 				$form_title           = '' === $form->name ? __( '(no title)', 'formidable' ) : FrmAppHelper::truncate( $form->name, 50 );
89
-				$options[ $form->id ] = esc_html( $form_title );
89
+				$options[$form->id] = esc_html( $form_title );
90 90
 			}
91 91
 
92 92
 			return $options;
Please login to merge, or discard this patch.
classes/controllers/FrmFieldsController.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 
19 19
 		$_GET['page'] = 'formidable';
20 20
 
21
-		$values     = array(
21
+		$values = array(
22 22
 			'id'         => FrmAppHelper::get_post_param( 'form_id', '', 'absint' ),
23 23
 			'doing_ajax' => true,
24 24
 		);
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 
42 42
 			ob_start();
43 43
 			self::load_single_field( $field, $values );
44
-			$field_html[ absint( $field->id ) ] = ob_get_contents();
44
+			$field_html[absint( $field->id )] = ob_get_contents();
45 45
 			ob_end_clean();
46 46
 		}
47 47
 
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
 			foreach ( $opts as $opt_key => $opt ) {
257 257
 				if ( strpos( $opt, '|' ) !== false ) {
258 258
 					$vals = explode( '|', $opt );
259
-					$opts[ $opt_key ] = array(
259
+					$opts[$opt_key] = array(
260 260
 						'label' => trim( $vals[0] ),
261 261
 						'value' => trim( $vals[1] ),
262 262
 					);
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
 			$other_array = array();
272 272
 			foreach ( $field['options'] as $opt_key => $opt ) {
273 273
 				if ( FrmFieldsHelper::is_other_opt( $opt_key ) ) {
274
-					$other_array[ $opt_key ] = $opt;
274
+					$other_array[$opt_key] = $opt;
275 275
 				}
276 276
 				unset( $opt_key, $opt );
277 277
 			}
@@ -313,18 +313,18 @@  discard block
 block discarded – undo
313 313
 		$disabled_fields     = FrmAppHelper::pro_is_installed() ? array() : $pro_field_selection;
314 314
 		$frm_settings        = FrmAppHelper::get_settings();
315 315
 
316
-		if ( ! isset( $all_field_types[ $field['type'] ] ) ) {
316
+		if ( ! isset( $all_field_types[$field['type']] ) ) {
317 317
 			// Add fallback for an add-on field type that has been deactivated.
318
-			$all_field_types[ $field['type'] ] = array(
318
+			$all_field_types[$field['type']] = array(
319 319
 				'name' => ucfirst( $field['type'] ),
320 320
 				'icon' => 'frm_icon_font frm_pencil_icon',
321 321
 			);
322
-		} elseif ( ! is_array( $all_field_types[ $field['type'] ] ) ) {
322
+		} elseif ( ! is_array( $all_field_types[$field['type']] ) ) {
323 323
 			// Fallback for fields added in a more basic way.
324
-			FrmFormsHelper::prepare_field_type( $all_field_types[ $field['type'] ] );
324
+			FrmFormsHelper::prepare_field_type( $all_field_types[$field['type']] );
325 325
 		}
326 326
 
327
-		$type_name = $all_field_types[ $field['type'] ]['name'];
327
+		$type_name = $all_field_types[$field['type']]['name'];
328 328
 		if ( $field['type'] === 'divider' && FrmField::is_option_true( $field, 'repeat' ) ) {
329 329
 			$type_name = $all_field_types['divider|repeat']['name'];
330 330
 		}
@@ -387,13 +387,13 @@  discard block
 block discarded – undo
387 387
 		$active   = 'default_value';
388 388
 
389 389
 		foreach ( $settings as $type ) {
390
-			if ( ! empty( $field[ $type ] ) ) {
390
+			if ( ! empty( $field[$type] ) ) {
391 391
 				$active = $type;
392 392
 			}
393 393
 		}
394 394
 
395
-		$types[ $active ]['class']  .= ' current';
396
-		$types[ $active ]['current'] = true;
395
+		$types[$active]['class']  .= ' current';
396
+		$types[$active]['current'] = true;
397 397
 
398 398
 		return $types;
399 399
 	}
@@ -407,8 +407,8 @@  discard block
 block discarded – undo
407 407
 			'website' => 'url',
408 408
 			'image'   => 'url',
409 409
 		);
410
-		if ( isset( $type_switch[ $type ] ) ) {
411
-			$type = $type_switch[ $type ];
410
+		if ( isset( $type_switch[$type] ) ) {
411
+			$type = $type_switch[$type];
412 412
 		}
413 413
 
414 414
 		$pro_fields = FrmField::pro_field_selection();
@@ -532,11 +532,11 @@  discard block
 block discarded – undo
532 532
 		// include "col" for valid html
533 533
 		$unit = trim( preg_replace( '/[0-9]+/', '', $field['size'] ) );
534 534
 
535
-		if ( ! isset( $calc[ $unit ] ) ) {
535
+		if ( ! isset( $calc[$unit] ) ) {
536 536
 			return;
537 537
 		}
538 538
 
539
-		$size = (float) str_replace( $unit, '', $field['size'] ) / $calc[ $unit ];
539
+		$size = (float) str_replace( $unit, '', $field['size'] ) / $calc[$unit];
540 540
 
541 541
 		$add_html['cols'] = 'cols="' . absint( $size ) . '"';
542 542
 	}
@@ -729,11 +729,11 @@  discard block
 block discarded – undo
729 729
 	private static function get_form_for_js_validation( $field ) {
730 730
 		global $frm_vars;
731 731
 		if ( ! empty( $frm_vars['js_validate_forms'] ) ) {
732
-			if ( isset( $frm_vars['js_validate_forms'][ $field['form_id'] ] ) ) {
733
-				return $frm_vars['js_validate_forms'][ $field['form_id'] ];
732
+			if ( isset( $frm_vars['js_validate_forms'][$field['form_id']] ) ) {
733
+				return $frm_vars['js_validate_forms'][$field['form_id']];
734 734
 			}
735
-			if ( ! empty( $field['parent_form_id'] ) && isset( $frm_vars['js_validate_forms'][ $field['parent_form_id'] ] ) ) {
736
-				return $frm_vars['js_validate_forms'][ $field['parent_form_id'] ];
735
+			if ( ! empty( $field['parent_form_id'] ) && isset( $frm_vars['js_validate_forms'][$field['parent_form_id']] ) ) {
736
+				return $frm_vars['js_validate_forms'][$field['parent_form_id']];
737 737
 			}
738 738
 		}
739 739
 		return false;
@@ -804,10 +804,10 @@  discard block
 block discarded – undo
804 804
 
805 805
 			if ( is_numeric( $k ) && strpos( $v, '=' ) ) {
806 806
 				$add_html[] = $v;
807
-			} elseif ( ! empty( $k ) && isset( $add_html[ $k ] ) ) {
808
-				$add_html[ $k ] = str_replace( $k . '="', $k . '="' . $v, $add_html[ $k ] );
807
+			} elseif ( ! empty( $k ) && isset( $add_html[$k] ) ) {
808
+				$add_html[$k] = str_replace( $k . '="', $k . '="' . $v, $add_html[$k] );
809 809
 			} else {
810
-				$add_html[ $k ] = $k . '="' . esc_attr( $v ) . '"';
810
+				$add_html[$k] = $k . '="' . esc_attr( $v ) . '"';
811 811
 			}
812 812
 
813 813
 			unset( $k, $v );
Please login to merge, or discard this patch.