Completed
Pull Request — master (#1258)
by Stephanie
27s
created
classes/views/frm-fields/back-end/combo-field/sub-field-options.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -51,13 +51,13 @@  discard block
 block discarded – undo
51 51
 							type="text"
52 52
 							name="<?php echo esc_attr( $input_name ); ?>"
53 53
 							id="<?php echo esc_attr( $input_id ); ?>"
54
-							value="<?php echo esc_attr( isset( $default_value[ $sub_field['name'] ] ) ? $default_value[ $sub_field['name'] ] : '' ); ?>"
54
+							value="<?php echo esc_attr( isset( $default_value[$sub_field['name']] ) ? $default_value[$sub_field['name']] : '' ); ?>"
55 55
 							data-changeme="field_<?php echo esc_attr( $field_key . '_' . $sub_field['name'] ); ?>"
56 56
 							data-changeatt="value"
57 57
 						/>
58 58
 					</span>
59 59
 					<label class="frm_description" for="<?php echo esc_attr( $input_id ); ?>">
60
-						<?php echo esc_html( $labels[ $option ] ); ?>
60
+						<?php echo esc_html( $labels[$option] ); ?>
61 61
 					</label>
62 62
 				</p>
63 63
 				<?php
@@ -74,12 +74,12 @@  discard block
 block discarded – undo
74 74
 						type="text"
75 75
 						name="<?php echo esc_attr( $input_name ); ?>"
76 76
 						id="<?php echo esc_attr( $input_id ); ?>"
77
-						value="<?php echo esc_attr( isset( $input_value[ $sub_field['name'] ] ) ? $input_value[ $sub_field['name'] ] : '' ); ?>"
77
+						value="<?php echo esc_attr( isset( $input_value[$sub_field['name']] ) ? $input_value[$sub_field['name']] : '' ); ?>"
78 78
 						data-changeme="field_<?php echo esc_attr( $field_key . '_' . $sub_field['name'] ); ?>"
79 79
 						data-changeatt="<?php echo esc_attr( $option ); ?>"
80 80
 					/>
81 81
 					<label class="frm_description" for="<?php echo esc_attr( $input_id ); ?>">
82
-						<?php echo esc_html( $labels[ $option ] ); ?>
82
+						<?php echo esc_html( $labels[$option] ); ?>
83 83
 					</label>
84 84
 				</p>
85 85
 				<?php
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 						data-changeme="frm_field_<?php echo esc_attr( $field_id . '_' . $sub_field['name'] ); ?>_desc"
101 101
 					/>
102 102
 					<label class="frm_description" for="<?php echo esc_attr( $input_id ); ?>">
103
-						<?php echo esc_html( $labels[ $option ] ); ?>
103
+						<?php echo esc_html( $labels[$option] ); ?>
104 104
 					</label>
105 105
 				</p>
106 106
 				<?php
Please login to merge, or discard this patch.
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   +52 added lines, -52 removed lines patch added patch discarded remove patch
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
 
130 130
 		unset( $filename );
131 131
 
132
-		$comment_count       = FrmDb::get_count(
132
+		$comment_count = FrmDb::get_count(
133 133
 			'frm_item_metas',
134 134
 			array(
135 135
 				'item_id'         => $atts['entry_ids'],
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
 	private static function prepare_csv_headings() {
225 225
 		$headings = array();
226 226
 		self::csv_headings( $headings );
227
-		$headings       = apply_filters(
227
+		$headings = apply_filters(
228 228
 			'frm_csv_columns',
229 229
 			$headings,
230 230
 			self::$form_id,
@@ -247,10 +247,10 @@  discard block
 block discarded – undo
247 247
 		$field_headings  = array();
248 248
 		$separate_values = array( 'user_id', 'file', 'data', 'date' );
249 249
 		if ( ! empty( $col->field_options['separate_value'] ) && ! in_array( $col->type, $separate_values, true ) ) {
250
-			$field_headings[ $col->id . '_label' ] = strip_tags( $col->name . ' ' . __( '(label)', 'formidable' ) );
250
+			$field_headings[$col->id . '_label'] = strip_tags( $col->name . ' ' . __( '(label)', 'formidable' ) );
251 251
 		}
252 252
 
253
-		$field_headings[ $col->id ] = strip_tags( $col->name );
253
+		$field_headings[$col->id] = strip_tags( $col->name );
254 254
 		$field_headings             = apply_filters(
255 255
 			'frm_csv_field_columns',
256 256
 			$field_headings,
@@ -270,14 +270,14 @@  discard block
 block discarded – undo
270 270
 		foreach ( self::$fields as $col ) {
271 271
 			if ( self::is_the_child_of_a_repeater( $col ) ) {
272 272
 				$repeater_id                           = $col->field_options['in_section'];
273
-				$headings[ 'repeater' . $repeater_id ] = array(); // set a placeholder to maintain order for repeater fields
273
+				$headings['repeater' . $repeater_id] = array(); // set a placeholder to maintain order for repeater fields
274 274
 
275
-				if ( ! isset( $fields_by_repeater_id[ $repeater_id ] ) ) {
276
-					$fields_by_repeater_id[ $repeater_id ] = array();
275
+				if ( ! isset( $fields_by_repeater_id[$repeater_id] ) ) {
276
+					$fields_by_repeater_id[$repeater_id] = array();
277 277
 					$repeater_ids[]                        = $repeater_id;
278 278
 				}
279 279
 
280
-				$fields_by_repeater_id[ $repeater_id ][] = $col;
280
+				$fields_by_repeater_id[$repeater_id][] = $col;
281 281
 
282 282
 				continue;
283 283
 			}
@@ -296,8 +296,8 @@  discard block
 block discarded – undo
296 296
 				$end    = strpos( $row->meta_value, ':{' );
297 297
 				$length = substr( $row->meta_value, $start, $end - $start );
298 298
 
299
-				if ( $length > $max[ $row->field_id ] ) {
300
-					$max[ $row->field_id ] = $length;
299
+				if ( $length > $max[$row->field_id] ) {
300
+					$max[$row->field_id] = $length;
301 301
 				}
302 302
 			}
303 303
 			unset( $start, $end, $length, $row, $repeater_meta, $where );
@@ -308,17 +308,17 @@  discard block
 block discarded – undo
308 308
 					$repeater_id = str_replace( 'repeater', '', $key );
309 309
 
310 310
 					$repeater_headings = array();
311
-					foreach ( $fields_by_repeater_id[ $repeater_id ] as $col ) {
311
+					foreach ( $fields_by_repeater_id[$repeater_id] as $col ) {
312 312
 						$repeater_headings += self::field_headings( $col );
313 313
 					}
314 314
 
315
-					for ( $i = 0; $i < $max[ $repeater_id ]; $i ++ ) {
315
+					for ( $i = 0; $i < $max[$repeater_id]; $i ++ ) {
316 316
 						foreach ( $repeater_headings as $repeater_key => $repeater_name ) {
317
-							$flat[ $repeater_key . '[' . $i . ']' ] = $repeater_name;
317
+							$flat[$repeater_key . '[' . $i . ']'] = $repeater_name;
318 318
 						}
319 319
 					}
320 320
 				} else {
321
-					$flat[ $key ] = $heading;
321
+					$flat[$key] = $heading;
322 322
 				}
323 323
 			}
324 324
 
@@ -332,9 +332,9 @@  discard block
 block discarded – undo
332 332
 
333 333
 		if ( self::$comment_count ) {
334 334
 			for ( $i = 0; $i < self::$comment_count; $i ++ ) {
335
-				$headings[ 'comment' . $i ]            = __( 'Comment', 'formidable' );
336
-				$headings[ 'comment_user_id' . $i ]    = __( 'Comment User', 'formidable' );
337
-				$headings[ 'comment_created_at' . $i ] = __( 'Comment Date', 'formidable' );
335
+				$headings['comment' . $i]            = __( 'Comment', 'formidable' );
336
+				$headings['comment_user_id' . $i]    = __( 'Comment User', 'formidable' );
337
+				$headings['comment_created_at' . $i] = __( 'Comment Date', 'formidable' );
338 338
 			}
339 339
 			unset( $i );
340 340
 		}
@@ -379,7 +379,7 @@  discard block
 block discarded – undo
379 379
 
380 380
 	private static function prepare_next_csv_rows( $next_set ) {
381 381
 		// order by parent_item_id so children will be first
382
-		$where   = array(
382
+		$where = array(
383 383
 			'or'             => 1,
384 384
 			'id'             => $next_set,
385 385
 			'parent_item_id' => $next_set,
@@ -425,32 +425,32 @@  discard block
 block discarded – undo
425 425
 					continue;
426 426
 				}
427 427
 
428
-				if ( ! isset( $entries[ self::$entry->parent_item_id ] ) ) {
429
-					$entries[ self::$entry->parent_item_id ]        = new stdClass();
430
-					$entries[ self::$entry->parent_item_id ]->metas = array();
428
+				if ( ! isset( $entries[self::$entry->parent_item_id] ) ) {
429
+					$entries[self::$entry->parent_item_id]        = new stdClass();
430
+					$entries[self::$entry->parent_item_id]->metas = array();
431 431
 				}
432 432
 
433
-				if ( ! isset( $entries[ self::$entry->parent_item_id ]->metas[ $meta_id ] ) ) {
434
-					$entries[ self::$entry->parent_item_id ]->metas[ $meta_id ] = array();
435
-				} elseif ( ! is_array( $entries[ self::$entry->parent_item_id ]->metas[ $meta_id ] ) ) {
433
+				if ( ! isset( $entries[self::$entry->parent_item_id]->metas[$meta_id] ) ) {
434
+					$entries[self::$entry->parent_item_id]->metas[$meta_id] = array();
435
+				} elseif ( ! is_array( $entries[self::$entry->parent_item_id]->metas[$meta_id] ) ) {
436 436
 					// if the data is here, it should be an array but if this field has collected data
437 437
 					// both while inside and outside of the repeating section, it's possible this is a string
438
-					$entries[ self::$entry->parent_item_id ]->metas[ $meta_id ] = (array) $entries[ self::$entry->parent_item_id ]->metas[ $meta_id ];
438
+					$entries[self::$entry->parent_item_id]->metas[$meta_id] = (array) $entries[self::$entry->parent_item_id]->metas[$meta_id];
439 439
 				}
440 440
 
441 441
 				//add the repeated values
442
-				$entries[ self::$entry->parent_item_id ]->metas[ $meta_id ][] = $meta_value;
442
+				$entries[self::$entry->parent_item_id]->metas[$meta_id][] = $meta_value;
443 443
 			}
444 444
 
445 445
 			self::$entry->metas                              = self::fill_missing_repeater_metas( self::$entry->metas, $entries );
446
-			$entries[ self::$entry->parent_item_id ]->metas += self::$entry->metas;
446
+			$entries[self::$entry->parent_item_id]->metas += self::$entry->metas;
447 447
 		}
448 448
 
449 449
 		// add the embedded form id
450
-		if ( ! isset( $entries[ self::$entry->parent_item_id ]->embedded_fields ) ) {
451
-			$entries[ self::$entry->parent_item_id ]->embedded_fields = array();
450
+		if ( ! isset( $entries[self::$entry->parent_item_id]->embedded_fields ) ) {
451
+			$entries[self::$entry->parent_item_id]->embedded_fields = array();
452 452
 		}
453
-		$entries[ self::$entry->parent_item_id ]->embedded_fields[ self::$entry->id ] = self::$entry->form_id;
453
+		$entries[self::$entry->parent_item_id]->embedded_fields[self::$entry->id] = self::$entry->form_id;
454 454
 	}
455 455
 
456 456
 	/**
@@ -471,19 +471,19 @@  discard block
 block discarded – undo
471 471
 		}
472 472
 
473 473
 		$repeater_id = $field->field_options['in_section'];
474
-		if ( ! isset( self::$fields_by_repeater_id[ $repeater_id ] ) ) {
474
+		if ( ! isset( self::$fields_by_repeater_id[$repeater_id] ) ) {
475 475
 			return $metas;
476 476
 		}
477 477
 
478
-		foreach ( self::$fields_by_repeater_id[ $repeater_id ] as $repeater_child ) {
479
-			if ( ! isset( $metas[ $repeater_child->id ] ) ) {
480
-				$metas[ $repeater_child->id ] = '';
478
+		foreach ( self::$fields_by_repeater_id[$repeater_id] as $repeater_child ) {
479
+			if ( ! isset( $metas[$repeater_child->id] ) ) {
480
+				$metas[$repeater_child->id] = '';
481 481
 
482
-				if ( ! isset( $entries[ self::$entry->parent_item_id ]->metas[ $repeater_child->id ] ) || ! is_array( $entries[ self::$entry->parent_item_id ]->metas[ $repeater_child->id ] ) ) {
483
-					$entries[ self::$entry->parent_item_id ]->metas[ $repeater_child->id ] = array();
482
+				if ( ! isset( $entries[self::$entry->parent_item_id]->metas[$repeater_child->id] ) || ! is_array( $entries[self::$entry->parent_item_id]->metas[$repeater_child->id] ) ) {
483
+					$entries[self::$entry->parent_item_id]->metas[$repeater_child->id] = array();
484 484
 				}
485 485
 
486
-				$entries[ self::$entry->parent_item_id ]->metas[ $repeater_child->id ][] = '';
486
+				$entries[self::$entry->parent_item_id]->metas[$repeater_child->id][] = '';
487 487
 			}
488 488
 		}
489 489
 
@@ -502,7 +502,7 @@  discard block
 block discarded – undo
502 502
 
503 503
 	private static function add_field_values_to_csv( &$row ) {
504 504
 		foreach ( self::$fields as $col ) {
505
-			$field_value = isset( self::$entry->metas[ $col->id ] ) ? self::$entry->metas[ $col->id ] : false;
505
+			$field_value = isset( self::$entry->metas[$col->id] ) ? self::$entry->metas[$col->id] : false;
506 506
 
507 507
 			FrmFieldsHelper::prepare_field_value( $field_value, $col->type );
508 508
 			self::add_array_values_to_columns( $row, compact( 'col', 'field_value' ) );
@@ -521,20 +521,20 @@  discard block
 block discarded – undo
521 521
 			if ( ! empty( $col->field_options['separate_value'] ) ) {
522 522
 				$label_key = $col->id . '_label';
523 523
 				if ( self::is_the_child_of_a_repeater( $col ) ) {
524
-					$row[ $label_key ] = array();
524
+					$row[$label_key] = array();
525 525
 
526 526
 					if ( is_array( $field_value ) ) {
527 527
 						foreach ( $field_value as $value ) {
528
-							$row[ $label_key ][] = self::get_separate_value_label( $value, $col );
528
+							$row[$label_key][] = self::get_separate_value_label( $value, $col );
529 529
 						}
530 530
 					}
531 531
 				} else {
532
-					$row[ $label_key ] = self::get_separate_value_label( $field_value, $col );
532
+					$row[$label_key] = self::get_separate_value_label( $field_value, $col );
533 533
 				}
534 534
 				unset( $label_key );
535 535
 			}
536 536
 
537
-			$row[ $col->id ] = $field_value;
537
+			$row[$col->id] = $field_value;
538 538
 
539 539
 			unset( $col, $field_value );
540 540
 		}
@@ -557,7 +557,7 @@  discard block
 block discarded – undo
557 557
 				'show_icon'         => false,
558 558
 				'entry_id'          => self::$entry->id,
559 559
 				'sep'               => self::$separator,
560
-				'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,
560
+				'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,
561 561
 			)
562 562
 		);
563 563
 	}
@@ -572,8 +572,8 @@  discard block
 block discarded – undo
572 572
 					// This is combo field inside repeater. The heading key has this format: [86_first[0]].
573 573
 					foreach ( $sub_value as $sub_key => $sub_sub_value ) {
574 574
 						$column_key = $atts['col']->id . '_' . $sub_key . '[' . $key . ']';
575
-						if ( ! is_numeric( $sub_key ) && isset( self::$headings[ $column_key ] ) ) {
576
-							$row[ $column_key ] = $sub_sub_value;
575
+						if ( ! is_numeric( $sub_key ) && isset( self::$headings[$column_key] ) ) {
576
+							$row[$column_key] = $sub_sub_value;
577 577
 						}
578 578
 					}
579 579
 
@@ -581,8 +581,8 @@  discard block
 block discarded – undo
581 581
 				}
582 582
 
583 583
 				$column_key = $atts['col']->id . '_' . $key;
584
-				if ( ! is_numeric( $key ) && isset( self::$headings[ $column_key ] ) ) {
585
-					$row[ $column_key ] = $sub_value;
584
+				if ( ! is_numeric( $key ) && isset( self::$headings[$column_key] ) ) {
585
+					$row[$column_key] = $sub_value;
586 586
 				}
587 587
 			}
588 588
 		}
@@ -607,18 +607,18 @@  discard block
 block discarded – undo
607 607
 		$echo = 'echo' === self::$mode;
608 608
 
609 609
 		foreach ( self::$headings as $k => $heading ) {
610
-			if ( isset( $rows[ $k ] ) ) {
611
-				$row = $rows[ $k ];
610
+			if ( isset( $rows[$k] ) ) {
611
+				$row = $rows[$k];
612 612
 			} else {
613 613
 				$row = '';
614 614
 				// array indexed data is not at $rows[ $k ]
615
-				if ( $k[ strlen( $k ) - 1 ] === ']' ) {
615
+				if ( $k[strlen( $k ) - 1] === ']' ) {
616 616
 					$start = strrpos( $k, '[' );
617 617
 					$key   = substr( $k, 0, $start ++ );
618 618
 					$index = substr( $k, $start, strlen( $k ) - 1 - $start );
619 619
 
620
-					if ( isset( $rows[ $key ] ) && isset( $rows[ $key ][ $index ] ) ) {
621
-						$row = $rows[ $key ][ $index ];
620
+					if ( isset( $rows[$key] ) && isset( $rows[$key][$index] ) ) {
621
+						$row = $rows[$key][$index];
622 622
 					}
623 623
 
624 624
 					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/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.