Completed
Pull Request — master (#2609)
by
unknown
47s
created
classes/models/FrmFormState.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 	 * @return void
60 60
 	 */
61 61
 	public function set( $key, $value ) {
62
-		$this->state[ $key ] = $value;
62
+		$this->state[$key] = $value;
63 63
 	}
64 64
 
65 65
 	/**
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 	 * @return mixed
82 82
 	 */
83 83
 	public function get( $key, $default ) {
84
-		return $this->state[ $key ] ?? $default;
84
+		return $this->state[$key] ?? $default;
85 85
 	}
86 86
 
87 87
 	/**
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
 	private function compressed_state() {
193 193
 		$compressed = array();
194 194
 		foreach ( $this->state as $key => $value ) {
195
-			$compressed[ self::compressed_key( $key ) ] = $value;
195
+			$compressed[self::compressed_key( $key )] = $value;
196 196
 		}
197 197
 		return $compressed;
198 198
 	}
Please login to merge, or discard this patch.
classes/controllers/FrmXMLController.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
 			return;
170 170
 		}
171 171
 
172
-		$selected_xml = isset( $form['xml'] ) && isset( $form['xml'][ $selected_form ] ) ? $form['xml'][ $selected_form ] : '';
172
+		$selected_xml = isset( $form['xml'] ) && isset( $form['xml'][$selected_form] ) ? $form['xml'][$selected_form] : '';
173 173
 		if ( empty( $selected_xml ) || strpos( $selected_xml, 'http' ) !== 0 ) {
174 174
 			return;
175 175
 		}
@@ -186,8 +186,8 @@  discard block
 block discarded – undo
186 186
 	 * @return string
187 187
 	 */
188 188
 	private static function get_selected_in_form( $form, $value = 'form' ) {
189
-		if ( ! empty( $form ) && ! empty( $form[ $value ] ) ) {
190
-			return $form[ $value ];
189
+		if ( ! empty( $form ) && ! empty( $form[$value] ) ) {
190
+			return $form[$value];
191 191
 		}
192 192
 
193 193
 		return '';
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
 			}
216 216
 
217 217
 			if ( $for === 'view' ) {
218
-				$item_key  = is_array( $view_keys ) ? $view_keys[ $form_key ] : $view_keys;
218
+				$item_key  = is_array( $view_keys ) ? $view_keys[$form_key] : $view_keys;
219 219
 				$shortcode = '[display-frm-data id=%1$s filter=limited]';
220 220
 			} elseif ( $for === 'form' ) {
221 221
 				$item_key  = $form_key;
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
 				continue;
231 231
 			}
232 232
 
233
-			$page_ids[ $for ] = wp_insert_post(
233
+			$page_ids[$for] = wp_insert_post(
234 234
 				array(
235 235
 					'post_title'   => $name,
236 236
 					'post_type'    => 'page',
@@ -383,7 +383,7 @@  discard block
 block discarded – undo
383 383
 		// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.NonceVerification.Missing
384 384
 		$file_type = sanitize_option( 'upload_path', $_FILES['frm_import_file']['name'] );
385 385
 		$file_type = strtolower( pathinfo( $file_type, PATHINFO_EXTENSION ) );
386
-		if ( 'xml' !== $file_type && isset( $export_format[ $file_type ] ) ) {
386
+		if ( 'xml' !== $file_type && isset( $export_format[$file_type] ) ) {
387 387
 			// allow other file types to be imported
388 388
 			do_action( 'frm_before_import_' . $file_type );
389 389
 
@@ -477,7 +477,7 @@  discard block
 block discarded – undo
477 477
 		foreach ( $type as $tb_type ) {
478 478
 			$where = array();
479 479
 			$join  = '';
480
-			$table = $tables[ $tb_type ];
480
+			$table = $tables[$tb_type];
481 481
 
482 482
 			$select     = $table . '.id';
483 483
 			$query_vars = array();
@@ -492,7 +492,7 @@  discard block
 block discarded – undo
492 492
 							$table . '.parent_form_id' => $args['ids'],
493 493
 						);
494 494
 					} else {
495
-						$where[ $table . '.status !' ] = 'draft';
495
+						$where[$table . '.status !'] = 'draft';
496 496
 					}
497 497
 					break;
498 498
 				case 'actions':
@@ -505,7 +505,7 @@  discard block
 block discarded – undo
505 505
 				case 'items':
506 506
 					// $join = "INNER JOIN {$wpdb->prefix}frm_item_metas im ON ($table.id = im.item_id)";
507 507
 					if ( $args['ids'] ) {
508
-						$where[ $table . '.form_id' ] = $args['ids'];
508
+						$where[$table . '.form_id'] = $args['ids'];
509 509
 					}
510 510
 					break;
511 511
 				case 'styles':
@@ -546,7 +546,7 @@  discard block
 block discarded – undo
546 546
 					}
547 547
 			}//end switch
548 548
 
549
-			$records[ $tb_type ] = FrmDb::get_col( $table . $join, $where, $select );
549
+			$records[$tb_type] = FrmDb::get_col( $table . $join, $where, $select );
550 550
 			unset( $tb_type );
551 551
 		}//end foreach
552 552
 
@@ -745,7 +745,7 @@  discard block
 block discarded – undo
745 745
 		$no_export_fields = FrmField::no_save_fields();
746 746
 		foreach ( $csv_fields as $k => $f ) {
747 747
 			if ( in_array( $f->type, $no_export_fields, true ) ) {
748
-				unset( $csv_fields[ $k ] );
748
+				unset( $csv_fields[$k] );
749 749
 			}
750 750
 		}
751 751
 
Please login to merge, or discard this patch.
classes/helpers/FrmCSVExportHelper.php 1 patch
Spacing   +57 added lines, -57 removed lines patch added patch discarded remove patch
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
 
155 155
 		unset( $filename );
156 156
 
157
-		$comment_count       = FrmDb::get_count(
157
+		$comment_count = FrmDb::get_count(
158 158
 			'frm_item_metas',
159 159
 			array(
160 160
 				'item_id'         => $atts['entry_ids'],
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
 	private static function prepare_csv_headings() {
317 317
 		$headings = array();
318 318
 		self::csv_headings( $headings );
319
-		$headings       = apply_filters(
319
+		$headings = apply_filters(
320 320
 			'frm_csv_columns',
321 321
 			$headings,
322 322
 			self::$form_id,
@@ -345,15 +345,15 @@  discard block
 block discarded – undo
345 345
 		$field_headings  = array();
346 346
 		$separate_values = array( 'user_id', 'file', 'data', 'date' );
347 347
 		if ( ! empty( $col->field_options['separate_value'] ) && ! in_array( $col->type, $separate_values, true ) ) {
348
-			$field_headings[ $col->id . '_label' ] = strip_tags( $col->name . ' ' . __( '(label)', 'formidable' ) );
348
+			$field_headings[$col->id . '_label'] = strip_tags( $col->name . ' ' . __( '(label)', 'formidable' ) );
349 349
 		}
350 350
 
351
-		if ( ! empty( $field_headings[ $col->id . '_label' ] ) ) {
352
-			$field_headings[ $col->id ] = strip_tags( $col->name . ' ' . __( '(value)', 'formidable' ) );
351
+		if ( ! empty( $field_headings[$col->id . '_label'] ) ) {
352
+			$field_headings[$col->id] = strip_tags( $col->name . ' ' . __( '(value)', 'formidable' ) );
353 353
 		} else {
354
-			$field_headings[ $col->id ] = strip_tags( $col->name );
354
+			$field_headings[$col->id] = strip_tags( $col->name );
355 355
 		}
356
-		$field_headings             = apply_filters(
356
+		$field_headings = apply_filters(
357 357
 			'frm_csv_field_columns',
358 358
 			$field_headings,
359 359
 			array_merge(
@@ -378,14 +378,14 @@  discard block
 block discarded – undo
378 378
 			if ( self::is_the_child_of_a_repeater( $col ) ) {
379 379
 				$repeater_id = $col->field_options['in_section'];
380 380
 				// Set a placeholder to maintain order for repeater fields.
381
-				$headings[ 'repeater' . $repeater_id ] = array();
381
+				$headings['repeater' . $repeater_id] = array();
382 382
 
383
-				if ( ! isset( $fields_by_repeater_id[ $repeater_id ] ) ) {
384
-					$fields_by_repeater_id[ $repeater_id ] = array();
383
+				if ( ! isset( $fields_by_repeater_id[$repeater_id] ) ) {
384
+					$fields_by_repeater_id[$repeater_id] = array();
385 385
 					$repeater_ids[]                        = $repeater_id;
386 386
 				}
387 387
 
388
-				$fields_by_repeater_id[ $repeater_id ][] = $col;
388
+				$fields_by_repeater_id[$repeater_id][] = $col;
389 389
 
390 390
 				continue;
391 391
 			}
@@ -404,8 +404,8 @@  discard block
 block discarded – undo
404 404
 				$end    = strpos( $row->meta_value, ':{' );
405 405
 				$length = substr( $row->meta_value, $start, $end - $start );
406 406
 
407
-				if ( $length > $max[ $row->field_id ] ) {
408
-					$max[ $row->field_id ] = $length;
407
+				if ( $length > $max[$row->field_id] ) {
408
+					$max[$row->field_id] = $length;
409 409
 				}
410 410
 			}
411 411
 			unset( $start, $end, $length, $row, $repeater_meta, $where );
@@ -416,17 +416,17 @@  discard block
 block discarded – undo
416 416
 					$repeater_id = str_replace( 'repeater', '', $key );
417 417
 
418 418
 					$repeater_headings = array();
419
-					foreach ( $fields_by_repeater_id[ $repeater_id ] as $col ) {
419
+					foreach ( $fields_by_repeater_id[$repeater_id] as $col ) {
420 420
 						$repeater_headings += self::field_headings( $col );
421 421
 					}
422 422
 
423
-					for ( $i = 0; $i < $max[ $repeater_id ]; $i++ ) {
423
+					for ( $i = 0; $i < $max[$repeater_id]; $i ++ ) {
424 424
 						foreach ( $repeater_headings as $repeater_key => $repeater_name ) {
425
-							$flat[ $repeater_key . '[' . $i . ']' ] = $repeater_name;
425
+							$flat[$repeater_key . '[' . $i . ']'] = $repeater_name;
426 426
 						}
427 427
 					}
428 428
 				} else {
429
-					$flat[ $key ] = $heading;
429
+					$flat[$key] = $heading;
430 430
 				}
431 431
 			}
432 432
 
@@ -439,10 +439,10 @@  discard block
 block discarded – undo
439 439
 		}//end if
440 440
 
441 441
 		if ( self::$comment_count ) {
442
-			for ( $i = 0; $i < self::$comment_count; $i++ ) {
443
-				$headings[ 'comment' . $i ]            = __( 'Comment', 'formidable' );
444
-				$headings[ 'comment_user_id' . $i ]    = __( 'Comment User', 'formidable' );
445
-				$headings[ 'comment_created_at' . $i ] = __( 'Comment Date', 'formidable' );
442
+			for ( $i = 0; $i < self::$comment_count; $i ++ ) {
443
+				$headings['comment' . $i]            = __( 'Comment', 'formidable' );
444
+				$headings['comment_user_id' . $i]    = __( 'Comment User', 'formidable' );
445
+				$headings['comment_created_at' . $i] = __( 'Comment Date', 'formidable' );
446 446
 			}
447 447
 			unset( $i );
448 448
 		}
@@ -495,7 +495,7 @@  discard block
 block discarded – undo
495 495
 	 */
496 496
 	private static function prepare_next_csv_rows( $next_set ) {
497 497
 		if ( FrmAppHelper::pro_is_installed() ) {
498
-			$where    = array(
498
+			$where = array(
499 499
 				'or'             => 1,
500 500
 				'id'             => $next_set,
501 501
 				'parent_item_id' => $next_set,
@@ -560,32 +560,32 @@  discard block
 block discarded – undo
560 560
 					continue;
561 561
 				}
562 562
 
563
-				if ( ! isset( $entries[ self::$entry->parent_item_id ] ) ) {
564
-					$entries[ self::$entry->parent_item_id ]        = new stdClass();
565
-					$entries[ self::$entry->parent_item_id ]->metas = array();
563
+				if ( ! isset( $entries[self::$entry->parent_item_id] ) ) {
564
+					$entries[self::$entry->parent_item_id]        = new stdClass();
565
+					$entries[self::$entry->parent_item_id]->metas = array();
566 566
 				}
567 567
 
568
-				if ( ! isset( $entries[ self::$entry->parent_item_id ]->metas[ $meta_id ] ) ) {
569
-					$entries[ self::$entry->parent_item_id ]->metas[ $meta_id ] = array();
570
-				} elseif ( ! is_array( $entries[ self::$entry->parent_item_id ]->metas[ $meta_id ] ) ) {
568
+				if ( ! isset( $entries[self::$entry->parent_item_id]->metas[$meta_id] ) ) {
569
+					$entries[self::$entry->parent_item_id]->metas[$meta_id] = array();
570
+				} elseif ( ! is_array( $entries[self::$entry->parent_item_id]->metas[$meta_id] ) ) {
571 571
 					// if the data is here, it should be an array but if this field has collected data
572 572
 					// both while inside and outside of the repeating section, it's possible this is a string.
573
-					$entries[ self::$entry->parent_item_id ]->metas[ $meta_id ] = (array) $entries[ self::$entry->parent_item_id ]->metas[ $meta_id ];
573
+					$entries[self::$entry->parent_item_id]->metas[$meta_id] = (array) $entries[self::$entry->parent_item_id]->metas[$meta_id];
574 574
 				}
575 575
 
576 576
 				// Add the repeated values.
577
-				$entries[ self::$entry->parent_item_id ]->metas[ $meta_id ][] = $meta_value;
577
+				$entries[self::$entry->parent_item_id]->metas[$meta_id][] = $meta_value;
578 578
 			}//end foreach
579 579
 
580 580
 			self::$entry->metas                              = self::fill_missing_repeater_metas( self::$entry->metas, $entries );
581
-			$entries[ self::$entry->parent_item_id ]->metas += self::$entry->metas;
581
+			$entries[self::$entry->parent_item_id]->metas += self::$entry->metas;
582 582
 		}//end if
583 583
 
584 584
 		// add the embedded form id
585
-		if ( ! isset( $entries[ self::$entry->parent_item_id ]->embedded_fields ) ) {
586
-			$entries[ self::$entry->parent_item_id ]->embedded_fields = array();
585
+		if ( ! isset( $entries[self::$entry->parent_item_id]->embedded_fields ) ) {
586
+			$entries[self::$entry->parent_item_id]->embedded_fields = array();
587 587
 		}
588
-		$entries[ self::$entry->parent_item_id ]->embedded_fields[ self::$entry->id ] = self::$entry->form_id;
588
+		$entries[self::$entry->parent_item_id]->embedded_fields[self::$entry->id] = self::$entry->form_id;
589 589
 	}
590 590
 
591 591
 	/**
@@ -606,19 +606,19 @@  discard block
 block discarded – undo
606 606
 		}
607 607
 
608 608
 		$repeater_id = $field->field_options['in_section'];
609
-		if ( ! isset( self::$fields_by_repeater_id[ $repeater_id ] ) ) {
609
+		if ( ! isset( self::$fields_by_repeater_id[$repeater_id] ) ) {
610 610
 			return $metas;
611 611
 		}
612 612
 
613
-		foreach ( self::$fields_by_repeater_id[ $repeater_id ] as $repeater_child ) {
614
-			if ( ! isset( $metas[ $repeater_child->id ] ) ) {
615
-				$metas[ $repeater_child->id ] = '';
613
+		foreach ( self::$fields_by_repeater_id[$repeater_id] as $repeater_child ) {
614
+			if ( ! isset( $metas[$repeater_child->id] ) ) {
615
+				$metas[$repeater_child->id] = '';
616 616
 
617
-				if ( ! isset( $entries[ self::$entry->parent_item_id ]->metas[ $repeater_child->id ] ) || ! is_array( $entries[ self::$entry->parent_item_id ]->metas[ $repeater_child->id ] ) ) {
618
-					$entries[ self::$entry->parent_item_id ]->metas[ $repeater_child->id ] = array();
617
+				if ( ! isset( $entries[self::$entry->parent_item_id]->metas[$repeater_child->id] ) || ! is_array( $entries[self::$entry->parent_item_id]->metas[$repeater_child->id] ) ) {
618
+					$entries[self::$entry->parent_item_id]->metas[$repeater_child->id] = array();
619 619
 				}
620 620
 
621
-				$entries[ self::$entry->parent_item_id ]->metas[ $repeater_child->id ][] = '';
621
+				$entries[self::$entry->parent_item_id]->metas[$repeater_child->id][] = '';
622 622
 			}
623 623
 		}
624 624
 
@@ -647,7 +647,7 @@  discard block
 block discarded – undo
647 647
 	 */
648 648
 	private static function add_field_values_to_csv( &$row ) {
649 649
 		foreach ( self::$fields as $col ) {
650
-			$field_value = self::$entry->metas[ $col->id ] ?? false;
650
+			$field_value = self::$entry->metas[$col->id] ?? false;
651 651
 
652 652
 			FrmFieldsHelper::prepare_field_value( $field_value, $col->type );
653 653
 			self::add_array_values_to_columns( $row, compact( 'col', 'field_value' ) );
@@ -666,20 +666,20 @@  discard block
 block discarded – undo
666 666
 			if ( ! empty( $col->field_options['separate_value'] ) ) {
667 667
 				$label_key = $col->id . '_label';
668 668
 				if ( self::is_the_child_of_a_repeater( $col ) ) {
669
-					$row[ $label_key ] = array();
669
+					$row[$label_key] = array();
670 670
 
671 671
 					if ( is_array( $field_value ) ) {
672 672
 						foreach ( $field_value as $value ) {
673
-							$row[ $label_key ][] = self::get_separate_value_label( $value, $col );
673
+							$row[$label_key][] = self::get_separate_value_label( $value, $col );
674 674
 						}
675 675
 					}
676 676
 				} else {
677
-					$row[ $label_key ] = self::get_separate_value_label( $field_value, $col );
677
+					$row[$label_key] = self::get_separate_value_label( $field_value, $col );
678 678
 				}
679 679
 				unset( $label_key );
680 680
 			}
681 681
 
682
-			$row[ $col->id ] = $field_value;
682
+			$row[$col->id] = $field_value;
683 683
 
684 684
 			unset( $col, $field_value );
685 685
 		}//end foreach
@@ -702,7 +702,7 @@  discard block
 block discarded – undo
702 702
 				'show_icon'         => false,
703 703
 				'entry_id'          => self::$entry->id,
704 704
 				'sep'               => self::$separator,
705
-				'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,
705
+				'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,
706 706
 			)
707 707
 		);
708 708
 	}
@@ -721,8 +721,8 @@  discard block
 block discarded – undo
721 721
 					// This is combo field inside repeater. The heading key has this format: [86_first[0]].
722 722
 					foreach ( $sub_value as $sub_key => $sub_sub_value ) {
723 723
 						$column_key = $atts['col']->id . '_' . $sub_key . '[' . $key . ']';
724
-						if ( ! is_numeric( $sub_key ) && isset( self::$headings[ $column_key ] ) ) {
725
-							$row[ $column_key ] = $sub_sub_value;
724
+						if ( ! is_numeric( $sub_key ) && isset( self::$headings[$column_key] ) ) {
725
+							$row[$column_key] = $sub_sub_value;
726 726
 						}
727 727
 					}
728 728
 
@@ -730,8 +730,8 @@  discard block
 block discarded – undo
730 730
 				}
731 731
 
732 732
 				$column_key = $atts['col']->id . '_' . $key;
733
-				if ( ! is_numeric( $key ) && isset( self::$headings[ $column_key ] ) ) {
734
-					$row[ $column_key ] = $sub_value;
733
+				if ( ! is_numeric( $key ) && isset( self::$headings[$column_key] ) ) {
734
+					$row[$column_key] = $sub_value;
735 735
 				}
736 736
 			}
737 737
 		}
@@ -766,18 +766,18 @@  discard block
 block discarded – undo
766 766
 		$echo = 'echo' === self::$mode;
767 767
 
768 768
 		foreach ( self::$headings as $k => $heading ) {
769
-			if ( isset( $rows[ $k ] ) ) {
770
-				$row = $rows[ $k ];
769
+			if ( isset( $rows[$k] ) ) {
770
+				$row = $rows[$k];
771 771
 			} else {
772 772
 				$row = '';
773 773
 				// array indexed data is not at $rows[ $k ]
774
-				if ( $k[ strlen( $k ) - 1 ] === ']' ) {
774
+				if ( $k[strlen( $k ) - 1] === ']' ) {
775 775
 					$start = strrpos( $k, '[' );
776
-					$key   = substr( $k, 0, $start++ );
776
+					$key   = substr( $k, 0, $start ++ );
777 777
 					$index = substr( $k, $start, strlen( $k ) - 1 - $start );
778 778
 
779
-					if ( isset( $rows[ $key ] ) && isset( $rows[ $key ][ $index ] ) ) {
780
-						$row = $rows[ $key ][ $index ];
779
+					if ( isset( $rows[$key] ) && isset( $rows[$key][$index] ) ) {
780
+						$row = $rows[$key][$index];
781 781
 					}
782 782
 
783 783
 					unset( $start, $key, $index );
Please login to merge, or discard this patch.
classes/models/FrmEntry.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -56,8 +56,8 @@  discard block
 block discarded – undo
56 56
 	 * @return void
57 57
 	 */
58 58
 	private static function flag_new_unique_key( $unique_id ) {
59
-		if ( ! isset( self::$unique_id_match_checks[ $unique_id ] ) ) {
60
-			self::$unique_id_match_checks[ $unique_id ] = false;
59
+		if ( ! isset( self::$unique_id_match_checks[$unique_id] ) ) {
60
+			self::$unique_id_match_checks[$unique_id] = false;
61 61
 		}
62 62
 	}
63 63
 
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 				if ( 0 === (int) $meta->field_id ) {
113 113
 					continue;
114 114
 				}
115
-				$field_metas[ $meta->field_id ] = $meta->meta_value;
115
+				$field_metas[$meta->field_id] = $meta->meta_value;
116 116
 			}
117 117
 
118 118
 			$filtered_vals = array_filter( $values['item_meta'] );
@@ -177,8 +177,8 @@  discard block
 block discarded – undo
177 177
 			return false;
178 178
 		}
179 179
 
180
-		if ( isset( self::$unique_id_match_checks[ $unique_id ] ) ) {
181
-			return self::$unique_id_match_checks[ $unique_id ];
180
+		if ( isset( self::$unique_id_match_checks[$unique_id] ) ) {
181
+			return self::$unique_id_match_checks[$unique_id];
182 182
 		}
183 183
 
184 184
 		$timestamp = strtotime( $created_at );
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
 			$timestamp = time();
187 187
 		}
188 188
 
189
-		self::$unique_id_match_checks[ $unique_id ] = (bool) FrmDb::get_var(
189
+		self::$unique_id_match_checks[$unique_id] = (bool) FrmDb::get_var(
190 190
 			'frm_item_metas',
191 191
 			array(
192 192
 				'field_id'     => 0,
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
 			'id'
197 197
 		);
198 198
 
199
-		return self::$unique_id_match_checks[ $unique_id ];
199
+		return self::$unique_id_match_checks[$unique_id];
200 200
 	}
201 201
 
202 202
 	/**
@@ -226,10 +226,10 @@  discard block
 block discarded – undo
226 226
 		$reduced = array();
227 227
 		foreach ( $filter_vals as $field_id => $value ) {
228 228
 			$field                = FrmFieldFactory::get_field_object( $field_id );
229
-			$reduced[ $field_id ] = $field->get_value_to_save( $value, array( 'entry_id' => $entry_id ) );
230
-			$reduced[ $field_id ] = $field->set_value_before_save( $reduced[ $field_id ] );
231
-			if ( '' === $reduced[ $field_id ] || ( is_array( $reduced[ $field_id ] ) && 0 === count( $reduced[ $field_id ] ) ) ) {
232
-				unset( $reduced[ $field_id ] );
229
+			$reduced[$field_id] = $field->get_value_to_save( $value, array( 'entry_id' => $entry_id ) );
230
+			$reduced[$field_id] = $field->set_value_before_save( $reduced[$field_id] );
231
+			if ( '' === $reduced[$field_id] || ( is_array( $reduced[$field_id] ) && 0 === count( $reduced[$field_id] ) ) ) {
232
+				unset( $reduced[$field_id] );
233 233
 			}
234 234
 		}
235 235
 		return $reduced;
@@ -515,7 +515,7 @@  discard block
 block discarded – undo
515 515
 	private static function prepare_entries( &$entries ) {
516 516
 		foreach ( $entries as $k => $entry ) {
517 517
 			self::prepare_entry( $entry );
518
-			$entries[ $k ] = $entry;
518
+			$entries[$k] = $entry;
519 519
 		}
520 520
 	}
521 521
 
@@ -546,19 +546,19 @@  discard block
 block discarded – undo
546 546
 			FrmFieldsHelper::prepare_field_value( $meta_val->meta_value, $meta_val->type );
547 547
 
548 548
 			if ( $meta_val->item_id == $entry->id ) {
549
-				$entry->metas[ $meta_val->field_id ] = $meta_val->meta_value;
549
+				$entry->metas[$meta_val->field_id] = $meta_val->meta_value;
550 550
 				if ( $include_key ) {
551
-					$entry->metas[ $meta_val->field_key ] = $entry->metas[ $meta_val->field_id ];
551
+					$entry->metas[$meta_val->field_key] = $entry->metas[$meta_val->field_id];
552 552
 				}
553 553
 				continue;
554 554
 			}
555 555
 
556 556
 			// include sub entries in an array
557
-			if ( ! isset( $entry->metas[ $meta_val->field_id ] ) ) {
558
-				$entry->metas[ $meta_val->field_id ] = array();
557
+			if ( ! isset( $entry->metas[$meta_val->field_id] ) ) {
558
+				$entry->metas[$meta_val->field_id] = array();
559 559
 			}
560 560
 
561
-			$entry->metas[ $meta_val->field_id ][] = $meta_val->meta_value;
561
+			$entry->metas[$meta_val->field_id][] = $meta_val->meta_value;
562 562
 
563 563
 			unset( $meta_val );
564 564
 		}
@@ -662,16 +662,16 @@  discard block
 block discarded – undo
662 662
 		}
663 663
 
664 664
 		foreach ( $metas as $m_key => $meta_val ) {
665
-			if ( ! isset( $entries[ $meta_val->item_id ] ) ) {
665
+			if ( ! isset( $entries[$meta_val->item_id] ) ) {
666 666
 				continue;
667 667
 			}
668 668
 
669
-			if ( ! isset( $entries[ $meta_val->item_id ]->metas ) ) {
670
-				$entries[ $meta_val->item_id ]->metas = array();
669
+			if ( ! isset( $entries[$meta_val->item_id]->metas ) ) {
670
+				$entries[$meta_val->item_id]->metas = array();
671 671
 			}
672 672
 
673 673
 			FrmFieldsHelper::prepare_field_value( $meta_val->meta_value, $meta_val->type );
674
-			$entries[ $meta_val->item_id ]->metas[ $meta_val->field_id ] = $meta_val->meta_value;
674
+			$entries[$meta_val->item_id]->metas[$meta_val->field_id] = $meta_val->meta_value;
675 675
 			unset( $m_key, $meta_val );
676 676
 		}
677 677
 
@@ -863,7 +863,7 @@  discard block
 block discarded – undo
863 863
 	 * @return mixed
864 864
 	 */
865 865
 	private static function get_entry_value( $values, $name, $default ) {
866
-		return $values[ $name ] ?? $default;
866
+		return $values[$name] ?? $default;
867 867
 	}
868 868
 
869 869
 	/**
@@ -1070,7 +1070,7 @@  discard block
 block discarded – undo
1070 1070
 	private static function maybe_add_captcha_meta( $form_id, $entry_id ) {
1071 1071
 		global $frm_vars;
1072 1072
 		if ( array_key_exists( 'captcha_scores', $frm_vars ) && array_key_exists( $form_id, $frm_vars['captcha_scores'] ) ) {
1073
-			$captcha_score_meta = array( 'captcha_score' => $frm_vars['captcha_scores'][ $form_id ] );
1073
+			$captcha_score_meta = array( 'captcha_score' => $frm_vars['captcha_scores'][$form_id] );
1074 1074
 			FrmEntryMeta::add_entry_meta( $entry_id, 0, '', maybe_serialize( $captcha_score_meta ) );
1075 1075
 		}
1076 1076
 	}
Please login to merge, or discard this patch.
classes/controllers/FrmFormActionsController.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -133,19 +133,19 @@  discard block
 block discarded – undo
133 133
 		}
134 134
 
135 135
 		foreach ( $action_controls as $action ) {
136
-			if ( isset( $groups[ $action->id_base ] ) || in_array( $action->id_base, $grouped ) ) {
136
+			if ( isset( $groups[$action->id_base] ) || in_array( $action->id_base, $grouped ) ) {
137 137
 				continue;
138 138
 			}
139 139
 
140 140
 			$this_group = $action->action_options['group'];
141
-			if ( ! isset( $groups[ $this_group ] ) ) {
141
+			if ( ! isset( $groups[$this_group] ) ) {
142 142
 				$this_group = 'misc';
143 143
 			}
144 144
 
145
-			if ( ! isset( $groups[ $this_group ]['actions'] ) ) {
146
-				$groups[ $this_group ]['actions'] = array();
145
+			if ( ! isset( $groups[$this_group]['actions'] ) ) {
146
+				$groups[$this_group]['actions'] = array();
147 147
 			}
148
-			$groups[ $this_group ]['actions'][] = $action->id_base;
148
+			$groups[$this_group]['actions'][] = $action->id_base;
149 149
 
150 150
 			unset( $action );
151 151
 		}
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
 				return $a;
320 320
 			}
321 321
 
322
-			$actions[ $a->id_base ] = $a;
322
+			$actions[$a->id_base] = $a;
323 323
 		}
324 324
 
325 325
 		return $actions;
@@ -358,18 +358,18 @@  discard block
 block discarded – undo
358 358
 		$action_map = array();
359 359
 
360 360
 		foreach ( $action_controls as $key => $control ) {
361
-			$action_map[ $control->id_base ] = $key;
361
+			$action_map[$control->id_base] = $key;
362 362
 		}
363 363
 
364 364
 		self::maybe_show_limit_warning( $form->id, $form_actions );
365 365
 
366 366
 		foreach ( $form_actions as $action ) {
367
-			if ( ! isset( $action_map[ $action->post_excerpt ] ) ) {
367
+			if ( ! isset( $action_map[$action->post_excerpt] ) ) {
368 368
 				// don't try and show settings if action no longer exists
369 369
 				continue;
370 370
 			}
371 371
 
372
-			self::action_control( $action, $form, $action->ID, $action_controls[ $action_map[ $action->post_excerpt ] ], $values );
372
+			self::action_control( $action, $form, $action->ID, $action_controls[$action_map[$action->post_excerpt]], $values );
373 373
 		}
374 374
 	}
375 375
 
@@ -681,8 +681,8 @@  discard block
 block discarded – undo
681 681
 			}
682 682
 
683 683
 			// Store actions so they can be triggered with the correct priority.
684
-			$stored_actions[ $action->ID ]  = $action;
685
-			$action_priority[ $action->ID ] = $link_settings[ $action->post_excerpt ]->action_options['priority'];
684
+			$stored_actions[$action->ID]  = $action;
685
+			$action_priority[$action->ID] = $link_settings[$action->post_excerpt]->action_options['priority'];
686 686
 
687 687
 			unset( $action );
688 688
 		}//end foreach
@@ -694,7 +694,7 @@  discard block
 block discarded – undo
694 694
 			new FrmNotification();
695 695
 
696 696
 			foreach ( $action_priority as $action_id => $priority ) {
697
-				$action = $stored_actions[ $action_id ];
697
+				$action = $stored_actions[$action_id];
698 698
 
699 699
 				/**
700 700
 				 * Allows custom form action trigger.
@@ -791,7 +791,7 @@  discard block
 block discarded – undo
791 791
 	 * @return void
792 792
 	 */
793 793
 	public function register( $action_class ) {
794
-		$this->actions[ $action_class ] = new $action_class();
794
+		$this->actions[$action_class] = new $action_class();
795 795
 	}
796 796
 
797 797
 	/**
@@ -800,8 +800,8 @@  discard block
 block discarded – undo
800 800
 	 * @return void
801 801
 	 */
802 802
 	public function unregister( $action_class ) {
803
-		if ( isset( $this->actions[ $action_class ] ) ) {
804
-			unset( $this->actions[ $action_class ] );
803
+		if ( isset( $this->actions[$action_class] ) ) {
804
+			unset( $this->actions[$action_class] );
805 805
 		}
806 806
 	}
807 807
 
@@ -810,8 +810,8 @@  discard block
 block discarded – undo
810 810
 
811 811
 		foreach ( $keys as $key ) {
812 812
 			// don't register new action if old action with the same id is already registered
813
-			if ( ! isset( $this->actions[ $key ] ) ) {
814
-				$this->actions[ $key ]->_register();
813
+			if ( ! isset( $this->actions[$key] ) ) {
814
+				$this->actions[$key]->_register();
815 815
 			}
816 816
 		}
817 817
 	}
Please login to merge, or discard this patch.
classes/helpers/FrmEntriesHelper.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -145,10 +145,10 @@  discard block
 block discarded – undo
145 145
 		if ( $_POST ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
146 146
 			$repeating = isset( $args['repeating'] ) && $args['repeating'];
147 147
 			if ( $repeating ) {
148
-				if ( isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
148
+				if ( isset( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']][$field->id] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
149 149
 					$value_is_posted = true;
150 150
 				}
151
-			} elseif ( isset( $_POST['item_meta'][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
151
+			} elseif ( isset( $_POST['item_meta'][$field->id] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
152 152
 				$value_is_posted = true;
153 153
 			}
154 154
 		}
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
 		preg_match_all( "/\[(default-message|default_message)\b(.*?)(?:(\/))?\]/s", $message, $shortcodes, PREG_PATTERN_ORDER );
193 193
 
194 194
 		foreach ( $shortcodes[0] as $short_key => $tag ) {
195
-			$add_atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[2][ $short_key ] );
195
+			$add_atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[2][$short_key] );
196 196
 			if ( ! empty( $add_atts ) ) {
197 197
 				$this_atts = array_merge( $atts, $add_atts );
198 198
 			} else {
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
 			$default = FrmEntriesController::show_entry_shortcode( $this_atts );
203 203
 
204 204
 			// Add the default message.
205
-			$message = str_replace( $shortcodes[0][ $short_key ], $default, $message );
205
+			$message = str_replace( $shortcodes[0][$short_key], $default, $message );
206 206
 		}
207 207
 
208 208
 		return $message;
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
 	 * @return string
216 216
 	 */
217 217
 	public static function prepare_display_value( $entry, $field, $atts ) {
218
-		$field_value = $entry->metas[ $field->id ] ?? false;
218
+		$field_value = $entry->metas[$field->id] ?? false;
219 219
 
220 220
 		if ( FrmAppHelper::pro_is_installed() ) {
221 221
 			$empty = empty( $field_value );
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
 			$child_entries = FrmEntry::getAll( array( 'it.parent_item_id' => $entry->id ), '', '', true );
244 244
 		} else {
245 245
 			// Get all values for this field.
246
-			$child_values = $entry->metas[ $atts['embedded_field_id'] ] ?? false;
246
+			$child_values = $entry->metas[$atts['embedded_field_id']] ?? false;
247 247
 
248 248
 			if ( $child_values ) {
249 249
 				$child_entries = FrmEntry::getAll( array( 'it.id' => (array) $child_values ) );
@@ -372,7 +372,7 @@  discard block
 block discarded – undo
372 372
 			$value = $args['temp_value'];
373 373
 		}
374 374
 		if ( empty( $args['parent_field_id'] ) ) {
375
-			$_POST['item_meta'][ $field->id ] = $value;
375
+			$_POST['item_meta'][$field->id] = $value;
376 376
 		} else {
377 377
 			self::set_parent_field_posted_value( $field, $value, $args );
378 378
 		}
@@ -390,17 +390,17 @@  discard block
 block discarded – undo
390 390
 	 * @return void
391 391
 	 */
392 392
 	private static function set_parent_field_posted_value( $field, $value, $args ) {
393
-		if ( isset( $_POST['item_meta'][ $args['parent_field_id'] ] ) && is_array( $_POST['item_meta'][ $args['parent_field_id'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
394
-			if ( ! isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] ) || ! is_array( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
395
-				$_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing
393
+		if ( isset( $_POST['item_meta'][$args['parent_field_id']] ) && is_array( $_POST['item_meta'][$args['parent_field_id']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
394
+			if ( ! isset( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']] ) || ! is_array( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
395
+				$_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing
396 396
 			}
397 397
 		} else {
398 398
 			// All of the section was probably removed.
399
-			$_POST['item_meta'][ $args['parent_field_id'] ]                         = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing
400
-			$_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing
399
+			$_POST['item_meta'][$args['parent_field_id']]                         = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing
400
+			$_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing
401 401
 		}
402 402
 
403
-		$_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field->id ] = $value; // phpcs:ignore WordPress.Security.NonceVerification.Missing
403
+		$_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']][$field->id] = $value; // phpcs:ignore WordPress.Security.NonceVerification.Missing
404 404
 	}
405 405
 
406 406
 	/**
@@ -447,9 +447,9 @@  discard block
 block discarded – undo
447 447
 	private static function get_posted_meta( $field_id, $args ) {
448 448
 		if ( empty( $args['parent_field_id'] ) ) {
449 449
 			// Sanitizing is done next.
450
-			$value = isset( $_POST['item_meta'][ $field_id ] ) ? wp_unslash( $_POST['item_meta'][ $field_id ] ) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
450
+			$value = isset( $_POST['item_meta'][$field_id] ) ? wp_unslash( $_POST['item_meta'][$field_id] ) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
451 451
 		} else {
452
-			$value = isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field_id ] ) ? wp_unslash( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field_id ] ) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
452
+			$value = isset( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']][$field_id] ) ? wp_unslash( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']][$field_id] ) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
453 453
 		}
454 454
 		return $value;
455 455
 	}
@@ -480,14 +480,14 @@  discard block
 block discarded – undo
480 480
 		self::set_other_repeating_vals( $field, $value, $args );
481 481
 
482 482
 		// Check if there are any posted "Other" values.
483
-		if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta']['other'][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
483
+		if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta']['other'][$field->id] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
484 484
 
485 485
 			// Save original value.
486 486
 			$args['temp_value'] = $value;
487 487
 			$args['other']      = true;
488 488
 
489 489
 			// Sanitizing is done next.
490
-			$other_vals = wp_unslash( $_POST['item_meta']['other'][ $field->id ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
490
+			$other_vals = wp_unslash( $_POST['item_meta']['other'][$field->id] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
491 491
 			FrmAppHelper::sanitize_value( 'sanitize_text_field', $other_vals );
492 492
 
493 493
 			// Set the validation value now
@@ -510,12 +510,12 @@  discard block
 block discarded – undo
510 510
 		}
511 511
 
512 512
 		// Check if there are any other posted "other" values for this field.
513
-		if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ]['other'][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
513
+		if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']]['other'][$field->id] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
514 514
 			// Save original value
515 515
 			$args['temp_value'] = $value;
516 516
 			$args['other']      = true;
517 517
 
518
-			$other_vals = wp_unslash( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ]['other'][ $field->id ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
518
+			$other_vals = wp_unslash( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']]['other'][$field->id] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
519 519
 			FrmAppHelper::sanitize_value( 'sanitize_text_field', $other_vals );
520 520
 
521 521
 			// Set the validation value now.
@@ -542,7 +542,7 @@  discard block
 block discarded – undo
542 542
 		if ( is_array( $value ) && $field->type === 'checkbox' ) {
543 543
 			// Combine "Other" values with checked values. "Other" values will override checked box values.
544 544
 			foreach ( $other_vals as $k => $v ) {
545
-				if ( isset( $value[ $k ] ) && trim( $v ) === '' ) {
545
+				if ( isset( $value[$k] ) && trim( $v ) === '' ) {
546 546
 					// If the other box is checked, but doesn't have a value.
547 547
 					$value = '';
548 548
 					break;
@@ -559,25 +559,25 @@  discard block
 block discarded – undo
559 559
 
560 560
 			// Multi-select dropdown.
561 561
 			if ( is_array( $value ) ) {
562
-				$o_key = array_search( $field->options[ $other_key ], $value );
562
+				$o_key = array_search( $field->options[$other_key], $value );
563 563
 
564 564
 				if ( $o_key !== false ) {
565 565
 					// Modify the original value so other key will be preserved.
566
-					$value[ $other_key ] = $value[ $o_key ];
566
+					$value[$other_key] = $value[$o_key];
567 567
 
568 568
 					// By default, the array keys will be numeric for multi-select dropdowns.
569 569
 					// If going backwards and forwards between pages, the array key will match the other key.
570 570
 					if ( $o_key !== $other_key ) {
571
-						unset( $value[ $o_key ] );
571
+						unset( $value[$o_key] );
572 572
 					}
573 573
 
574 574
 					$args['temp_value']  = $value;
575
-					$value[ $other_key ] = reset( $other_vals );
576
-					if ( FrmAppHelper::is_empty_value( $value[ $other_key ] ) ) {
577
-						unset( $value[ $other_key ] );
575
+					$value[$other_key] = reset( $other_vals );
576
+					if ( FrmAppHelper::is_empty_value( $value[$other_key] ) ) {
577
+						unset( $value[$other_key] );
578 578
 					}
579 579
 				}
580
-			} elseif ( $field->options[ $other_key ] == $value ) {
580
+			} elseif ( $field->options[$other_key] == $value ) {
581 581
 				$value = $other_vals;
582 582
 			}//end if
583 583
 		}//end if
@@ -831,7 +831,7 @@  discard block
 block discarded – undo
831 831
 	 * @return void
832 832
 	 */
833 833
 	public static function maybe_render_captcha_score( $entry_id ) {
834
-		$query                 = array(
834
+		$query = array(
835 835
 			'item_id'  => (int) $entry_id,
836 836
 			'field_id' => 0,
837 837
 		);
@@ -885,7 +885,7 @@  discard block
 block discarded – undo
885 885
 	public static function get_entry_status_label( $status ) {
886 886
 		$statuses = self::get_entry_statuses();
887 887
 
888
-		return $statuses[ self::get_entry_status( $status ) ];
888
+		return $statuses[self::get_entry_status( $status )];
889 889
 	}
890 890
 
891 891
 	/**
Please login to merge, or discard this patch.
classes/models/FrmEntryValidate.php 1 patch
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 			return $errors;
28 28
 		}
29 29
 
30
-		if ( FrmAppHelper::is_admin() && is_user_logged_in() && ( ! isset( $values[ 'frm_submit_entry_' . $values['form_id'] ] ) || ! wp_verify_nonce( $values[ 'frm_submit_entry_' . $values['form_id'] ], 'frm_submit_entry_nonce' ) ) ) {
30
+		if ( FrmAppHelper::is_admin() && is_user_logged_in() && ( ! isset( $values['frm_submit_entry_' . $values['form_id']] ) || ! wp_verify_nonce( $values['frm_submit_entry_' . $values['form_id']], 'frm_submit_entry_nonce' ) ) ) {
31 31
 			$frm_settings   = FrmAppHelper::get_settings();
32 32
 			$errors['form'] = $frm_settings->admin_permission;
33 33
 		}
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 		$args = wp_parse_args( $args, $defaults );
150 150
 
151 151
 		if ( empty( $args['parent_field_id'] ) ) {
152
-			$value = $values['item_meta'][ $args['id'] ] ?? '';
152
+			$value = $values['item_meta'][$args['id']] ?? '';
153 153
 		} else {
154 154
 			// value is from a nested form
155 155
 			$value = $values;
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
 		}
171 171
 
172 172
 		if ( $posted_field->required == '1' && FrmAppHelper::is_empty_value( $value ) ) {
173
-			$errors[ 'field' . $args['id'] ] = FrmFieldsHelper::get_error_msg( $posted_field, 'blank' );
173
+			$errors['field' . $args['id']] = FrmFieldsHelper::get_error_msg( $posted_field, 'blank' );
174 174
 		} elseif ( ! isset( $_POST['item_name'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
175 175
 			self::maybe_add_item_name( $value, $posted_field );
176 176
 		}
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
 		$option_is_valid = (bool) apply_filters( 'frm_option_is_valid', $option_is_valid, $value, $posted_field );
224 224
 
225 225
 		if ( ! $option_is_valid ) {
226
-			$errors[ 'field' . $args['id'] ] = FrmFieldsHelper::get_error_msg( $posted_field, 'invalid' );
226
+			$errors['field' . $args['id']] = FrmFieldsHelper::get_error_msg( $posted_field, 'invalid' );
227 227
 		}
228 228
 	}
229 229
 
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
 		FrmFieldsHelper::prepare_new_front_field( $values, $field_object );
351 351
 
352 352
 		$separate_value = FrmField::get_option( $field_object, 'separate_value' );
353
-		$map_callback   = function ( $option ) use ( $separate_value ) {
353
+		$map_callback   = function( $option ) use ( $separate_value ) {
354 354
 			if ( is_array( $option ) ) {
355 355
 				$option_value = $separate_value ? $option['value'] : $option['label'];
356 356
 			} else {
@@ -440,7 +440,7 @@  discard block
 block discarded – undo
440 440
 			$pattern = self::phone_format( $field );
441 441
 
442 442
 			if ( ! preg_match( $pattern, $value ) ) {
443
-				$errors[ 'field' . $args['id'] ] = FrmFieldsHelper::get_error_msg( $field, 'invalid' );
443
+				$errors['field' . $args['id']] = FrmFieldsHelper::get_error_msg( $field, 'invalid' );
444 444
 			}
445 445
 		}
446 446
 	}
@@ -567,7 +567,7 @@  discard block
 block discarded – undo
567 567
 	 */
568 568
 	private static function form_is_in_progress( $values ) {
569 569
 		return FrmAppHelper::pro_is_installed() &&
570
-			( isset( $values[ 'frm_page_order_' . $values['form_id'] ] ) || FrmAppHelper::get_post_param( 'frm_next_page' ) ) &&
570
+			( isset( $values['frm_page_order_' . $values['form_id']] ) || FrmAppHelper::get_post_param( 'frm_next_page' ) ) &&
571 571
 			FrmField::get_all_types_in_form( $values['form_id'], 'break' );
572 572
 	}
573 573
 
@@ -793,9 +793,9 @@  discard block
 block discarded – undo
793 793
 			foreach ( $datas['missing_keys'] as $key_index => $key ) {
794 794
 				$found = self::is_akismet_guest_info_value( $key, $value, $field_id, $datas['name_field_ids'], $values );
795 795
 				if ( $found ) {
796
-					$datas[ $key ]             = $value;
796
+					$datas[$key]             = $value;
797 797
 					$datas['frm_duplicated'][] = $field_id;
798
-					unset( $datas['missing_keys'][ $key_index ] );
798
+					unset( $datas['missing_keys'][$key_index] );
799 799
 				}
800 800
 			}
801 801
 		}//end foreach
@@ -838,11 +838,11 @@  discard block
 block discarded – undo
838 838
 					if ( 'Name' !== $field->name ) {
839 839
 						continue;
840 840
 					}
841
-					if ( isset( $fields[ $index + 1 ] ) && 'Last' === $fields[ $index + 1 ]->name ) {
842
-						if ( empty( $values[ absint( $fields[ $index + 1 ]->id ) ] ) ) {
841
+					if ( isset( $fields[$index + 1] ) && 'Last' === $fields[$index + 1]->name ) {
842
+						if ( empty( $values[absint( $fields[$index + 1]->id )] ) ) {
843 843
 							continue;
844 844
 						}
845
-						$value .= ' ' . $values[ $fields[ $index + 1 ]->id ];
845
+						$value .= ' ' . $values[$fields[$index + 1]->id];
846 846
 						return true;
847 847
 					}
848 848
 				}
@@ -861,13 +861,13 @@  discard block
 block discarded – undo
861 861
 	 */
862 862
 	private static function get_name_text_fields( $form_id ) {
863 863
 		$name_text_fields_is_initialized = is_array( self::$name_text_fields );
864
-		if ( $name_text_fields_is_initialized && isset( self::$name_text_fields[ $form_id ] ) ) {
865
-			return self::$name_text_fields[ $form_id ];
864
+		if ( $name_text_fields_is_initialized && isset( self::$name_text_fields[$form_id] ) ) {
865
+			return self::$name_text_fields[$form_id];
866 866
 		}
867 867
 		if ( ! $name_text_fields_is_initialized ) {
868 868
 			self::$name_text_fields = array();
869 869
 		}
870
-		self::$name_text_fields[ $form_id ] = FrmDb::get_results(
870
+		self::$name_text_fields[$form_id] = FrmDb::get_results(
871 871
 			'frm_fields',
872 872
 			array(
873 873
 				'form_id' => $form_id,
@@ -878,7 +878,7 @@  discard block
 block discarded – undo
878 878
 			array( 'order_by' => 'field_order ASC' )
879 879
 		);
880 880
 
881
-		return self::$name_text_fields[ $form_id ];
881
+		return self::$name_text_fields[$form_id];
882 882
 	}
883 883
 
884 884
 	/**
@@ -892,7 +892,7 @@  discard block
 block discarded – undo
892 892
 
893 893
 			// Send any potentially useful $_SERVER vars, but avoid sending junk we don't need.
894 894
 			if ( $include_value ) {
895
-				$datas[ $key ] = $value;
895
+				$datas[$key] = $value;
896 896
 			}
897 897
 			unset( $key, $value );
898 898
 		}
@@ -909,10 +909,10 @@  discard block
 block discarded – undo
909 909
 	private static function add_comment_content_to_akismet( &$datas, $values ) {
910 910
 		if ( isset( $datas['frm_duplicated'] ) ) {
911 911
 			foreach ( $datas['frm_duplicated'] as $index ) {
912
-				if ( isset( $values['item_meta'][ $index ] ) ) {
913
-					unset( $values['item_meta'][ $index ] );
912
+				if ( isset( $values['item_meta'][$index] ) ) {
913
+					unset( $values['item_meta'][$index] );
914 914
 				} else {
915
-					unset( $values[ $index ] );
915
+					unset( $values[$index] );
916 916
 				}
917 917
 			}
918 918
 			unset( $datas['frm_duplicated'] );
@@ -931,14 +931,14 @@  discard block
 block discarded – undo
931 931
 	private static function skip_adding_values_to_akismet( &$values ) {
932 932
 		$skipped_fields = self::get_akismet_skipped_field_ids( $values );
933 933
 		foreach ( $skipped_fields as $skipped_field ) {
934
-			if ( ! isset( $values['item_meta'][ $skipped_field->id ] ) ) {
934
+			if ( ! isset( $values['item_meta'][$skipped_field->id] ) ) {
935 935
 				continue;
936 936
 			}
937 937
 
938 938
 			if ( self::should_really_skip_field( $skipped_field, $values ) ) {
939
-				unset( $values['item_meta'][ $skipped_field->id ] );
940
-				if ( isset( $values['item_meta']['other'][ $skipped_field->id ] ) ) {
941
-					unset( $values['item_meta']['other'][ $skipped_field->id ] );
939
+				unset( $values['item_meta'][$skipped_field->id] );
940
+				if ( isset( $values['item_meta']['other'][$skipped_field->id] ) ) {
941
+					unset( $values['item_meta']['other'][$skipped_field->id] );
942 942
 				}
943 943
 			}
944 944
 		}
@@ -974,14 +974,14 @@  discard block
 block discarded – undo
974 974
 		}
975 975
 
976 976
 		// If a choice field has Other option, but Other is not selected.
977
-		if ( empty( $values['item_meta']['other'][ $field_data->id ] ) ) {
977
+		if ( empty( $values['item_meta']['other'][$field_data->id] ) ) {
978 978
 			return true;
979 979
 		}
980 980
 
981 981
 		// Check if submitted value is same as one of field option.
982 982
 		foreach ( $field_data->options as $option ) {
983 983
 			$option_value = ! is_array( $option ) ? $option : ( $option['value'] ?? '' );
984
-			if ( $values['item_meta']['other'][ $field_data->id ] === $option_value ) {
984
+			if ( $values['item_meta']['other'][$field_data->id] === $option_value ) {
985 985
 				return true;
986 986
 			}
987 987
 		}
@@ -1053,7 +1053,7 @@  discard block
 block discarded – undo
1053 1053
 
1054 1054
 			// Convert name array to string.
1055 1055
 			if ( isset( $value['first'] ) && isset( $value['last'] ) ) {
1056
-				$values['item_meta'][ $field_id ] = trim( implode( ' ', $value ) );
1056
+				$values['item_meta'][$field_id] = trim( implode( ' ', $value ) );
1057 1057
 				$values['name_field_ids'][]       = $field_id;
1058 1058
 				continue;
1059 1059
 			}
@@ -1074,8 +1074,8 @@  discard block
 block discarded – undo
1074 1074
 						continue;
1075 1075
 					}
1076 1076
 
1077
-					if ( ! isset( $values['item_meta'][ $subsubindex ] ) ) {
1078
-						$values['item_meta'][ $subsubindex ] = array();
1077
+					if ( ! isset( $values['item_meta'][$subsubindex] ) ) {
1078
+						$values['item_meta'][$subsubindex] = array();
1079 1079
 					}
1080 1080
 
1081 1081
 					// Convert name array to string.
@@ -1085,13 +1085,13 @@  discard block
 block discarded – undo
1085 1085
 						$values['name_field_ids'][] = $subsubindex;
1086 1086
 					}
1087 1087
 
1088
-					if ( is_array( $values['item_meta'][ $subsubindex ] ) ) {
1089
-						$values['item_meta'][ $subsubindex ][] = $subsubvalue;
1088
+					if ( is_array( $values['item_meta'][$subsubindex] ) ) {
1089
+						$values['item_meta'][$subsubindex][] = $subsubvalue;
1090 1090
 					}
1091 1091
 				}
1092 1092
 			}//end foreach
1093 1093
 
1094
-			unset( $values['item_meta'][ $field_id ] );
1094
+			unset( $values['item_meta'][$field_id] );
1095 1095
 		}//end foreach
1096 1096
 
1097 1097
 		return $form_ids;
Please login to merge, or discard this patch.
classes/models/FrmAddon.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 	 * @return array
76 76
 	 */
77 77
 	public function insert_installed_addon( $plugins ) {
78
-		$plugins[ $this->plugin_slug ] = $this;
78
+		$plugins[$this->plugin_slug] = $this;
79 79
 
80 80
 		return $plugins;
81 81
 	}
@@ -88,8 +88,8 @@  discard block
 block discarded – undo
88 88
 	public static function get_addon( $plugin_slug ) {
89 89
 		$plugins = apply_filters( 'frm_installed_addons', array() );
90 90
 		$plugin  = false;
91
-		if ( isset( $plugins[ $plugin_slug ] ) ) {
92
-			$plugin = $plugins[ $plugin_slug ];
91
+		if ( isset( $plugins[$plugin_slug] ) ) {
92
+			$plugin = $plugins[$plugin_slug];
93 93
 		}
94 94
 
95 95
 		return $plugin;
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 		} else {
150 150
 			$api     = new FrmFormApi( $this->license );
151 151
 			$plugins = $api->get_api_info();
152
-			$_data   = $plugins[ $item_id ];
152
+			$_data   = $plugins[$item_id];
153 153
 		}
154 154
 
155 155
 		$_data['sections'] = array(
@@ -417,19 +417,19 @@  discard block
 block discarded – undo
417 417
 
418 418
 		if ( $this->is_current_version( $transient ) ) {
419 419
 			// Make sure it doesn't show there is an update if plugin is up-to-date.
420
-			if ( isset( $transient->response[ $this->plugin_folder ] ) ) {
421
-				unset( $transient->response[ $this->plugin_folder ] );
420
+			if ( isset( $transient->response[$this->plugin_folder] ) ) {
421
+				unset( $transient->response[$this->plugin_folder] );
422 422
 			}
423
-		} elseif ( isset( $transient->response ) && isset( $transient->response[ $this->plugin_folder ] ) ) {
424
-			$this->prepare_update_details( $transient->response[ $this->plugin_folder ] );
423
+		} elseif ( isset( $transient->response ) && isset( $transient->response[$this->plugin_folder] ) ) {
424
+			$this->prepare_update_details( $transient->response[$this->plugin_folder] );
425 425
 
426 426
 			// if the transient has expired, clear the update and trigger it again
427
-			if ( $transient->response[ $this->plugin_folder ] === false ) {
427
+			if ( $transient->response[$this->plugin_folder] === false ) {
428 428
 				if ( ! $this->has_been_cleared() ) {
429 429
 					$this->cleared_plugins();
430 430
 					$this->manually_queue_update();
431 431
 				}
432
-				unset( $transient->response[ $this->plugin_folder ] );
432
+				unset( $transient->response[$this->plugin_folder] );
433 433
 			}
434 434
 		}
435 435
 
@@ -533,7 +533,7 @@  discard block
 block discarded – undo
533 533
 	 * @return bool
534 534
 	 */
535 535
 	private function is_current_version( $transient ) {
536
-		if ( empty( $transient->checked ) || ! isset( $transient->checked[ $this->plugin_folder ] ) ) {
536
+		if ( empty( $transient->checked ) || ! isset( $transient->checked[$this->plugin_folder] ) ) {
537 537
 			return false;
538 538
 		}
539 539
 
@@ -542,7 +542,7 @@  discard block
 block discarded – undo
542 542
 			return true;
543 543
 		}
544 544
 
545
-		return isset( $transient->response ) && isset( $transient->response[ $this->plugin_folder ] ) && $transient->checked[ $this->plugin_folder ] === $transient->response[ $this->plugin_folder ]->new_version;
545
+		return isset( $transient->response ) && isset( $transient->response[$this->plugin_folder] ) && $transient->checked[$this->plugin_folder] === $transient->response[$this->plugin_folder]->new_version;
546 546
 	}
547 547
 
548 548
 	/**
@@ -694,8 +694,8 @@  discard block
 block discarded – undo
694 694
 			$response['message'] = $response['status'];
695 695
 		} else {
696 696
 			$messages = $this->get_messages();
697
-			if ( is_string( $response['status'] ) && isset( $messages[ $response['status'] ] ) ) {
698
-				$response['message'] = $messages[ $response['status'] ];
697
+			if ( is_string( $response['status'] ) && isset( $messages[$response['status']] ) ) {
698
+				$response['message'] = $messages[$response['status']];
699 699
 			} else {
700 700
 				$response['message'] = FrmAppHelper::kses( $response['status'], array( 'a' ) );
701 701
 			}
@@ -859,7 +859,7 @@  discard block
 block discarded – undo
859 859
 			'user-agent' => $this->plugin_slug . '/' . $this->version . '; ' . get_bloginfo( 'url' ),
860 860
 		);
861 861
 
862
-		$resp              = wp_remote_post(
862
+		$resp = wp_remote_post(
863 863
 			$this->store_url . '?l=' . urlencode( base64_encode( $this->license ) ),
864 864
 			$arg_array
865 865
 		);
Please login to merge, or discard this patch.
classes/helpers/FrmXMLHelper.php 1 patch
Spacing   +101 added lines, -101 removed lines patch added patch discarded remove patch
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 				$content_before_channel_tag,
103 103
 				1
104 104
 			);
105
-			$xml_string                 = $content_before_channel_tag . substr( $xml_string, $channel_start_position );
105
+			$xml_string = $content_before_channel_tag . substr( $xml_string, $channel_start_position );
106 106
 		}
107 107
 	}
108 108
 
@@ -191,8 +191,8 @@  discard block
 block discarded – undo
191 191
 			);
192 192
 
193 193
 			if ( $term && is_array( $term ) ) {
194
-				++$imported['imported']['terms'];
195
-				$imported['terms'][ (int) $t->term_id ] = $term['term_id'];
194
+				++ $imported['imported']['terms'];
195
+				$imported['terms'][(int) $t->term_id] = $term['term_id'];
196 196
 			}
197 197
 
198 198
 			unset( $term, $t );
@@ -252,11 +252,11 @@  discard block
 block discarded – undo
252 252
 				if ( $form_id ) {
253 253
 					if ( empty( $form['parent_form_id'] ) ) {
254 254
 						// Don't include the repeater form in the imported count.
255
-						++$imported['imported']['forms'];
255
+						++ $imported['imported']['forms'];
256 256
 					}
257 257
 
258 258
 					// Keep track of whether this specific form was updated or not.
259
-					$imported['form_status'][ $form_id ] = 'imported';
259
+					$imported['form_status'][$form_id] = 'imported';
260 260
 				}
261 261
 			}
262 262
 
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
 			// Update field ids/keys to new ones.
272 272
 			do_action( 'frm_after_duplicate_form', $form_id, $form, array( 'old_id' => $old_id ) );
273 273
 
274
-			$imported['forms'][ (int) $item->id ] = $form_id;
274
+			$imported['forms'][(int) $item->id] = $form_id;
275 275
 
276 276
 			// Send pre 2.0 form options through function that creates actions.
277 277
 			self::migrate_form_settings_to_actions( $form['options'], $form_id, $imported, true );
@@ -358,11 +358,11 @@  discard block
 block discarded – undo
358 358
 		FrmForm::update( $form_id, $form );
359 359
 		if ( empty( $form['parent_form_id'] ) ) {
360 360
 			// Don't include the repeater form in the updated count.
361
-			++$imported['updated']['forms'];
361
+			++ $imported['updated']['forms'];
362 362
 		}
363 363
 
364 364
 		// Keep track of whether this specific form was updated or not
365
-		$imported['form_status'][ $form_id ] = 'updated';
365
+		$imported['form_status'][$form_id] = 'updated';
366 366
 	}
367 367
 
368 368
 	/**
@@ -374,8 +374,8 @@  discard block
 block discarded – undo
374 374
 		$form_fields = FrmField::get_all_for_form( $form_id, '', 'exclude', 'exclude' );
375 375
 		$old_fields  = array();
376 376
 		foreach ( $form_fields as $f ) {
377
-			$old_fields[ $f->id ]        = $f;
378
-			$old_fields[ $f->field_key ] = $f->id;
377
+			$old_fields[$f->id]        = $f;
378
+			$old_fields[$f->field_key] = $f->id;
379 379
 			unset( $f );
380 380
 		}
381 381
 		$form_fields = $old_fields;
@@ -435,7 +435,7 @@  discard block
 block discarded – undo
435 435
 	 */
436 436
 	private static function track_imported_child_forms( $form_id, $parent_form_id, &$child_forms ) {
437 437
 		if ( $parent_form_id ) {
438
-			$child_forms[ $form_id ] = $parent_form_id;
438
+			$child_forms[$form_id] = $parent_form_id;
439 439
 		}
440 440
 	}
441 441
 
@@ -450,9 +450,9 @@  discard block
 block discarded – undo
450 450
 	 */
451 451
 	private static function maybe_update_child_form_parent_id( $imported_forms, $child_forms ) {
452 452
 		foreach ( $child_forms as $child_form_id => $old_parent_form_id ) {
453
-			if ( isset( $imported_forms[ $old_parent_form_id ] ) && (int) $imported_forms[ $old_parent_form_id ] !== (int) $old_parent_form_id ) {
453
+			if ( isset( $imported_forms[$old_parent_form_id] ) && (int) $imported_forms[$old_parent_form_id] !== (int) $old_parent_form_id ) {
454 454
 				// Update all children with this old parent_form_id
455
-				$new_parent_form_id = (int) $imported_forms[ $old_parent_form_id ];
455
+				$new_parent_form_id = (int) $imported_forms[$old_parent_form_id];
456 456
 				FrmForm::update( $child_form_id, array( 'parent_form_id' => $new_parent_form_id ) );
457 457
 				do_action( 'frm_update_child_form_parent_id', $child_form_id, $new_parent_form_id );
458 458
 			}
@@ -488,34 +488,34 @@  discard block
 block discarded – undo
488 488
 
489 489
 			if ( ! empty( $this_form ) ) {
490 490
 				// check for field to edit by field id
491
-				if ( isset( $form_fields[ $f['id'] ] ) ) {
491
+				if ( isset( $form_fields[$f['id']] ) ) {
492 492
 					FrmField::update( $f['id'], $f );
493
-					++$imported['updated']['fields'];
493
+					++ $imported['updated']['fields'];
494 494
 
495
-					unset( $form_fields[ $f['id'] ] );
495
+					unset( $form_fields[$f['id']] );
496 496
 
497 497
 					// Unset old field key.
498
-					if ( isset( $form_fields[ $f['field_key'] ] ) ) {
499
-						unset( $form_fields[ $f['field_key'] ] );
498
+					if ( isset( $form_fields[$f['field_key']] ) ) {
499
+						unset( $form_fields[$f['field_key']] );
500 500
 					}
501
-				} elseif ( isset( $form_fields[ $f['field_key'] ] ) ) {
502
-					$keys_by_original_field_id[ $f['id'] ] = $f['field_key'];
501
+				} elseif ( isset( $form_fields[$f['field_key']] ) ) {
502
+					$keys_by_original_field_id[$f['id']] = $f['field_key'];
503 503
 
504 504
 					$old_field_id = $f['id'];
505 505
 
506 506
 					// check for field to edit by field key
507 507
 					unset( $f['id'] );
508 508
 
509
-					FrmField::update( $form_fields[ $f['field_key'] ], $f );
510
-					++$imported['updated']['fields'];
509
+					FrmField::update( $form_fields[$f['field_key']], $f );
510
+					++ $imported['updated']['fields'];
511 511
 
512 512
 					self::do_after_field_imported_action( $f, $form_fields, $old_field_id );
513 513
 
514 514
 					// Unset old field id.
515
-					unset( $form_fields[ $form_fields[ $f['field_key'] ] ] );
515
+					unset( $form_fields[$form_fields[$f['field_key']]] );
516 516
 
517 517
 					// Unset old field key.
518
-					unset( $form_fields[ $f['field_key'] ] );
518
+					unset( $form_fields[$f['field_key']] );
519 519
 				} else {
520 520
 					// If no matching field id or key in this form, create the field.
521 521
 					self::create_imported_field( $f, $imported );
@@ -555,7 +555,7 @@  discard block
 block discarded – undo
555 555
 	 */
556 556
 	private static function do_after_field_imported_action( $field_array, $form_fields, $old_field_id ) {
557 557
 		// Assign field array the update field's ID.
558
-		$field_array['id'] = $form_fields[ $field_array['field_key'] ];
558
+		$field_array['id'] = $form_fields[$field_array['field_key']];
559 559
 
560 560
 		/**
561 561
 		 * Fires when an existing field is imported.
@@ -566,7 +566,7 @@  discard block
 block discarded – undo
566 566
 		 * @param int   $field_id
567 567
 		 * @param int   $old_field_id
568 568
 		 */
569
-		do_action( 'frm_after_existing_field_is_imported', $field_array, $form_fields[ $field_array['field_key'] ], $old_field_id );
569
+		do_action( 'frm_after_existing_field_is_imported', $field_array, $form_fields[$field_array['field_key']], $old_field_id );
570 570
 	}
571 571
 
572 572
 	/**
@@ -675,8 +675,8 @@  discard block
 block discarded – undo
675 675
 		if ( $f['type'] === 'form' || ( $f['type'] === 'divider' && FrmField::is_option_true( $f['field_options'], 'repeat' ) ) ) {
676 676
 			if ( FrmField::is_option_true( $f['field_options'], 'form_select' ) ) {
677 677
 				$form_select = (int) $f['field_options']['form_select'];
678
-				if ( isset( $imported['forms'][ $form_select ] ) ) {
679
-					$f['field_options']['form_select'] = $imported['forms'][ $form_select ];
678
+				if ( isset( $imported['forms'][$form_select] ) ) {
679
+					$f['field_options']['form_select'] = $imported['forms'][$form_select];
680 680
 				}
681 681
 			}
682 682
 		}
@@ -698,8 +698,8 @@  discard block
 block discarded – undo
698 698
 
699 699
 		if ( FrmField::is_option_true_in_array( $f['field_options'], 'get_values_form' ) ) {
700 700
 			$old_form = $f['field_options']['get_values_form'];
701
-			if ( isset( $imported['forms'][ $old_form ] ) ) {
702
-				$f['field_options']['get_values_form'] = $imported['forms'][ $old_form ];
701
+			if ( isset( $imported['forms'][$old_form] ) ) {
702
+				$f['field_options']['get_values_form'] = $imported['forms'][$old_form];
703 703
 			}
704 704
 		}
705 705
 	}
@@ -726,12 +726,12 @@  discard block
 block discarded – undo
726 726
 	private static function migrate_placeholders( &$f ) {
727 727
 		$update_values = self::migrate_field_placeholder( $f, 'clear_on_focus' );
728 728
 		foreach ( $update_values as $k => $v ) {
729
-			$f[ $k ] = $v;
729
+			$f[$k] = $v;
730 730
 		}
731 731
 
732 732
 		$update_values = self::migrate_field_placeholder( $f, 'default_blank' );
733 733
 		foreach ( $update_values as $k => $v ) {
734
-			$f[ $k ] = $v;
734
+			$f[$k] = $v;
735 735
 		}
736 736
 	}
737 737
 
@@ -749,7 +749,7 @@  discard block
 block discarded – undo
749 749
 	public static function migrate_field_placeholder( $field, $type ) {
750 750
 		$field         = (array) $field;
751 751
 		$field_options = $field['field_options'];
752
-		if ( empty( $field_options[ $type ] ) || empty( $field['default_value'] ) ) {
752
+		if ( empty( $field_options[$type] ) || empty( $field['default_value'] ) ) {
753 753
 			return array();
754 754
 		}
755 755
 
@@ -775,7 +775,7 @@  discard block
 block discarded – undo
775 775
 				}
776 776
 
777 777
 				if ( $opt == $default_value ) {
778
-					unset( $options[ $opt_key ] );
778
+					unset( $options[$opt_key] );
779 779
 					break;
780 780
 				}
781 781
 			}
@@ -803,7 +803,7 @@  discard block
 block discarded – undo
803 803
 
804 804
 		$new_id = FrmField::create( $f );
805 805
 		if ( $new_id != false ) {
806
-			++$imported['imported']['fields'];
806
+			++ $imported['imported']['fields'];
807 807
 			do_action( 'frm_after_field_is_imported', $f, $new_id );
808 808
 		}
809 809
 	}
@@ -832,10 +832,10 @@  discard block
 block discarded – undo
832 832
 
833 833
 			$image_id = FrmProFileImport::import_attachment( $option['src'], $field_object );
834 834
 			// Remove the src from options as it isn't required after import.
835
-			unset( $field['options'][ $key ]['src'] );
835
+			unset( $field['options'][$key]['src'] );
836 836
 
837 837
 			if ( is_numeric( $image_id ) ) {
838
-				$field['options'][ $key ]['image'] = $image_id;
838
+				$field['options'][$key]['image'] = $image_id;
839 839
 			}
840 840
 		}
841 841
 
@@ -1022,8 +1022,8 @@  discard block
 block discarded – undo
1022 1022
 			} else {
1023 1023
 				if ( $post['post_type'] === 'frm_display' ) {
1024 1024
 					$post['post_content'] = self::maybe_prepare_json_view_content( $post['post_content'] );
1025
-				} elseif ( 'page' === $post['post_type'] && isset( $imported['posts'][ $post['post_parent'] ] ) ) {
1026
-					$post['post_parent'] = $imported['posts'][ $post['post_parent'] ];
1025
+				} elseif ( 'page' === $post['post_type'] && isset( $imported['posts'][$post['post_parent']] ) ) {
1026
+					$post['post_parent'] = $imported['posts'][$post['post_parent']];
1027 1027
 				}
1028 1028
 				// Create/update post now
1029 1029
 				$post_id = wp_insert_post( $post );
@@ -1034,27 +1034,27 @@  discard block
 block discarded – undo
1034 1034
 			}
1035 1035
 
1036 1036
 			if ( false !== strpos( $post['post_content'], '[display-frm-data' ) || false !== strpos( $post['post_content'], '[formidable' ) ) {
1037
-				$posts_with_shortcodes[ $post_id ] = $post;
1037
+				$posts_with_shortcodes[$post_id] = $post;
1038 1038
 			}
1039 1039
 
1040 1040
 			self::update_postmeta( $post, $post_id );
1041 1041
 			self::update_layout( $post, $post_id );
1042 1042
 
1043 1043
 			$this_type = 'posts';
1044
-			if ( isset( $post_types[ $post['post_type'] ] ) ) {
1045
-				$this_type = $post_types[ $post['post_type'] ];
1044
+			if ( isset( $post_types[$post['post_type']] ) ) {
1045
+				$this_type = $post_types[$post['post_type']];
1046 1046
 			}
1047 1047
 
1048 1048
 			if ( isset( $post['ID'] ) && $post_id == $post['ID'] ) {
1049
-				++$imported['updated'][ $this_type ];
1049
+				++ $imported['updated'][$this_type];
1050 1050
 			} else {
1051
-				++$imported['imported'][ $this_type ];
1051
+				++ $imported['imported'][$this_type];
1052 1052
 			}
1053 1053
 
1054
-			$imported['posts'][ $old_id ] = $post_id;
1054
+			$imported['posts'][$old_id] = $post_id;
1055 1055
 
1056 1056
 			if ( $post['post_type'] === 'frm_display' ) {
1057
-				$view_ids[ $old_id ] = $post_id;
1057
+				$view_ids[$old_id] = $post_id;
1058 1058
 			}
1059 1059
 
1060 1060
 			do_action( 'frm_after_import_view', $post_id, $post );
@@ -1223,9 +1223,9 @@  discard block
 block discarded – undo
1223 1223
 			$post['attachment_url'] = (string) $item->attachment_url;
1224 1224
 		}
1225 1225
 
1226
-		if ( $post['post_type'] == FrmFormActionsController::$action_post_type && isset( $imported['forms'][ (int) $post['menu_order'] ] ) ) {
1226
+		if ( $post['post_type'] == FrmFormActionsController::$action_post_type && isset( $imported['forms'][(int) $post['menu_order']] ) ) {
1227 1227
 			// update to new form id
1228
-			$post['menu_order'] = $imported['forms'][ (int) $post['menu_order'] ];
1228
+			$post['menu_order'] = $imported['forms'][(int) $post['menu_order']];
1229 1229
 		}
1230 1230
 
1231 1231
 		// Don't allow default styles to take over a site's default style
@@ -1262,8 +1262,8 @@  discard block
 block discarded – undo
1262 1262
 		);
1263 1263
 
1264 1264
 		// Switch old form and field ids to new ones.
1265
-		if ( 'frm_form_id' === $m['key'] && isset( $imported['forms'][ (int) $m['value'] ] ) ) {
1266
-			$m['value'] = $imported['forms'][ (int) $m['value'] ];
1265
+		if ( 'frm_form_id' === $m['key'] && isset( $imported['forms'][(int) $m['value']] ) ) {
1266
+			$m['value'] = $imported['forms'][(int) $m['value']];
1267 1267
 		} else {
1268 1268
 			$m['value'] = FrmAppHelper::maybe_json_decode( $m['value'] );
1269 1269
 
@@ -1274,23 +1274,23 @@  discard block
 block discarded – undo
1274 1274
 				} elseif ( 'frm_options' === $m['key'] ) {
1275 1275
 
1276 1276
 					foreach ( array( 'date_field_id', 'edate_field_id' ) as $setting_name ) {
1277
-						if ( isset( $m['value'][ $setting_name ] ) && is_numeric( $m['value'][ $setting_name ] ) && isset( $frm_duplicate_ids[ $m['value'][ $setting_name ] ] ) ) {
1278
-							$m['value'][ $setting_name ] = $frm_duplicate_ids[ $m['value'][ $setting_name ] ];
1277
+						if ( isset( $m['value'][$setting_name] ) && is_numeric( $m['value'][$setting_name] ) && isset( $frm_duplicate_ids[$m['value'][$setting_name]] ) ) {
1278
+							$m['value'][$setting_name] = $frm_duplicate_ids[$m['value'][$setting_name]];
1279 1279
 						}
1280 1280
 					}
1281 1281
 
1282 1282
 					if ( ! empty( $m['value']['map_address_fields'] ) ) {
1283 1283
 						foreach ( $m['value']['map_address_fields'] as $address_field_key => $address_field_id ) {
1284
-							if ( isset( $frm_duplicate_ids[ $address_field_id ] ) ) {
1285
-								$m['value']['map_address_fields'][ $address_field_key ] = $frm_duplicate_ids[ $address_field_id ];
1284
+							if ( isset( $frm_duplicate_ids[$address_field_id] ) ) {
1285
+								$m['value']['map_address_fields'][$address_field_key] = $frm_duplicate_ids[$address_field_id];
1286 1286
 							}
1287 1287
 						}
1288 1288
 					}
1289 1289
 
1290 1290
 					if ( ! empty( $m['value']['calendar_options'] ) ) {
1291 1291
 						foreach ( $m['value']['calendar_options'] as $calendar_option_group_key => $calendar_option ) {
1292
-							if ( isset( $frm_duplicate_ids[ $calendar_option['value'] ] ) ) {
1293
-								$m['value']['calendar_options'][ $calendar_option_group_key ]['value'] = $frm_duplicate_ids[ $calendar_option['value'] ];
1292
+							if ( isset( $frm_duplicate_ids[$calendar_option['value']] ) ) {
1293
+								$m['value']['calendar_options'][$calendar_option_group_key]['value'] = $frm_duplicate_ids[$calendar_option['value']];
1294 1294
 							}
1295 1295
 						}
1296 1296
 					}
@@ -1298,8 +1298,8 @@  discard block
 block discarded – undo
1298 1298
 					if ( ! empty( $m['value']['timeline_options'] ) ) {
1299 1299
 						foreach ( $m['value']['timeline_options'] as $timeline_option_group_key => $timeline_group_option ) {
1300 1300
 							foreach ( $timeline_group_option as $timeline_option_key => $timeline_option ) {
1301
-								if ( isset( $frm_duplicate_ids[ $timeline_option ] ) ) {
1302
-									$m['value']['timeline_options'][ $timeline_option_group_key ][ $timeline_option_key ] = $frm_duplicate_ids[ $timeline_option ];
1301
+								if ( isset( $frm_duplicate_ids[$timeline_option] ) ) {
1302
+									$m['value']['timeline_options'][$timeline_option_group_key][$timeline_option_key] = $frm_duplicate_ids[$timeline_option];
1303 1303
 								}
1304 1304
 							}
1305 1305
 						}
@@ -1307,8 +1307,8 @@  discard block
 block discarded – undo
1307 1307
 
1308 1308
 					$check_dup_array = array();
1309 1309
 					if ( ! empty( $m['value']['order_by'] ) ) {
1310
-						if ( is_numeric( $m['value']['order_by'] ) && isset( $frm_duplicate_ids[ $m['value']['order_by'] ] ) ) {
1311
-							$m['value']['order_by'] = $frm_duplicate_ids[ $m['value']['order_by'] ];
1310
+						if ( is_numeric( $m['value']['order_by'] ) && isset( $frm_duplicate_ids[$m['value']['order_by']] ) ) {
1311
+							$m['value']['order_by'] = $frm_duplicate_ids[$m['value']['order_by']];
1312 1312
 						} elseif ( is_array( $m['value']['order_by'] ) ) {
1313 1313
 							$check_dup_array[] = 'order_by';
1314 1314
 						}
@@ -1319,9 +1319,9 @@  discard block
 block discarded – undo
1319 1319
 					}
1320 1320
 
1321 1321
 					foreach ( $check_dup_array as $check_k ) {
1322
-						foreach ( (array) $m['value'][ $check_k ] as $mk => $mv ) {
1323
-							if ( isset( $frm_duplicate_ids[ $mv ] ) ) {
1324
-								$m['value'][ $check_k ][ $mk ] = $frm_duplicate_ids[ $mv ];
1322
+						foreach ( (array) $m['value'][$check_k] as $mk => $mv ) {
1323
+							if ( isset( $frm_duplicate_ids[$mv] ) ) {
1324
+								$m['value'][$check_k][$mk] = $frm_duplicate_ids[$mv];
1325 1325
 							}
1326 1326
 							unset( $mk, $mv );
1327 1327
 						}
@@ -1334,7 +1334,7 @@  discard block
 block discarded – undo
1334 1334
 			$m['value'] = FrmAppHelper::maybe_json_decode( $m['value'] );
1335 1335
 		}
1336 1336
 
1337
-		$post['postmeta'][ (string) $meta->meta_key ] = $m['value'];
1337
+		$post['postmeta'][(string) $meta->meta_key] = $m['value'];
1338 1338
 	}
1339 1339
 
1340 1340
 	/**
@@ -1344,7 +1344,7 @@  discard block
 block discarded – undo
1344 1344
 	 * @return void
1345 1345
 	 */
1346 1346
 	private static function populate_layout( &$post, $layout ) {
1347
-		$post['layout'][ (string) $layout->type ] = (string) $layout->data;
1347
+		$post['layout'][(string) $layout->type] = (string) $layout->data;
1348 1348
 	}
1349 1349
 
1350 1350
 	/**
@@ -1372,11 +1372,11 @@  discard block
 block discarded – undo
1372 1372
 				$name = (string) $c;
1373 1373
 			}
1374 1374
 
1375
-			if ( ! isset( $post['tax_input'][ $taxonomy ] ) ) {
1376
-				$post['tax_input'][ $taxonomy ] = array();
1375
+			if ( ! isset( $post['tax_input'][$taxonomy] ) ) {
1376
+				$post['tax_input'][$taxonomy] = array();
1377 1377
 			}
1378 1378
 
1379
-			$post['tax_input'][ $taxonomy ][] = $name;
1379
+			$post['tax_input'][$taxonomy][] = $name;
1380 1380
 			unset( $name );
1381 1381
 		}//end foreach
1382 1382
 	}
@@ -1525,7 +1525,7 @@  discard block
 block discarded – undo
1525 1525
 
1526 1526
 		$message = '<ul>';
1527 1527
 		foreach ( $result as $type => $results ) {
1528
-			if ( ! isset( $t_strings[ $type ] ) ) {
1528
+			if ( ! isset( $t_strings[$type] ) ) {
1529 1529
 				// only print imported and updated
1530 1530
 				continue;
1531 1531
 			}
@@ -1537,7 +1537,7 @@  discard block
 block discarded – undo
1537 1537
 			}
1538 1538
 
1539 1539
 			if ( ! empty( $s_message ) ) {
1540
-				$message .= '<li><strong>' . $t_strings[ $type ] . ':</strong> ';
1540
+				$message .= '<li><strong>' . $t_strings[$type] . ':</strong> ';
1541 1541
 				$message .= implode( ', ', $s_message );
1542 1542
 				$message .= '</li>';
1543 1543
 			}
@@ -1589,8 +1589,8 @@  discard block
 block discarded – undo
1589 1589
 			'actions' => sprintf( _n( '%1$s Form Action', '%1$s Form Actions', $m, 'formidable' ), $m ),
1590 1590
 		);
1591 1591
 
1592
-		if ( isset( $strings[ $type ] ) ) {
1593
-			$s_message[] = $strings[ $type ];
1592
+		if ( isset( $strings[$type] ) ) {
1593
+			$s_message[] = $strings[$type];
1594 1594
 		} else {
1595 1595
 			$string = ' ' . $m . ' ' . ucfirst( $type );
1596 1596
 
@@ -1749,7 +1749,7 @@  discard block
 block discarded – undo
1749 1749
 
1750 1750
 		foreach ( $options as $key => $option ) {
1751 1751
 			if ( is_array( $option ) && ! empty( $option['image'] ) ) {
1752
-				$options[ $key ]['src'] = wp_get_attachment_url( $option['image'] );
1752
+				$options[$key]['src'] = wp_get_attachment_url( $option['image'] );
1753 1753
 				$updated                = true;
1754 1754
 			}
1755 1755
 		}
@@ -1787,8 +1787,8 @@  discard block
 block discarded – undo
1787 1787
 	 */
1788 1788
 	private static function remove_defaults( $defaults, &$saved ) {
1789 1789
 		foreach ( $saved as $key => $value ) {
1790
-			if ( isset( $defaults[ $key ] ) && $defaults[ $key ] === $value ) {
1791
-				unset( $saved[ $key ] );
1790
+			if ( isset( $defaults[$key] ) && $defaults[$key] === $value ) {
1791
+				unset( $saved[$key] );
1792 1792
 			}
1793 1793
 		}
1794 1794
 	}
@@ -1805,14 +1805,14 @@  discard block
 block discarded – undo
1805 1805
 	 * @return void
1806 1806
 	 */
1807 1807
 	private static function remove_default_html( $html_name, $defaults, &$options ) {
1808
-		if ( ! isset( $options[ $html_name ] ) || ! isset( $defaults[ $html_name ] ) ) {
1808
+		if ( ! isset( $options[$html_name] ) || ! isset( $defaults[$html_name] ) ) {
1809 1809
 			return;
1810 1810
 		}
1811 1811
 
1812
-		$old_html     = str_replace( "\r\n", "\n", $options[ $html_name ] );
1813
-		$default_html = $defaults[ $html_name ];
1812
+		$old_html     = str_replace( "\r\n", "\n", $options[$html_name] );
1813
+		$default_html = $defaults[$html_name];
1814 1814
 		if ( $old_html == $default_html ) {
1815
-			unset( $options[ $html_name ] );
1815
+			unset( $options[$html_name] );
1816 1816
 
1817 1817
 			return;
1818 1818
 		}
@@ -1820,7 +1820,7 @@  discard block
 block discarded – undo
1820 1820
 		// Account for some of the older field default HTML.
1821 1821
 		$default_html = str_replace( ' id="frm_desc_field_[key]"', '', $default_html );
1822 1822
 		if ( $old_html === $default_html ) {
1823
-			unset( $options[ $html_name ] );
1823
+			unset( $options[$html_name] );
1824 1824
 		}
1825 1825
 	}
1826 1826
 
@@ -1928,8 +1928,8 @@  discard block
 block discarded – undo
1928 1928
 		);
1929 1929
 
1930 1930
 		foreach ( $post_settings as $post_setting ) {
1931
-			if ( isset( $form_options[ $post_setting ] ) ) {
1932
-				$new_action['post_content'][ $post_setting ] = $form_options[ $post_setting ];
1931
+			if ( isset( $form_options[$post_setting] ) ) {
1932
+				$new_action['post_content'][$post_setting] = $form_options[$post_setting];
1933 1933
 			}
1934 1934
 			unset( $post_setting );
1935 1935
 		}
@@ -1967,7 +1967,7 @@  discard block
 block discarded – undo
1967 1967
 		if ( ! $exists ) {
1968 1968
 			// this isn't an email, but we need to use a class that will always be included
1969 1969
 			FrmDb::save_json_post( $new_action );
1970
-			++$imported['imported']['actions'];
1970
+			++ $imported['imported']['actions'];
1971 1971
 		}
1972 1972
 	}
1973 1973
 
@@ -2000,11 +2000,11 @@  discard block
 block discarded – undo
2000 2000
 		foreach ( $post_content as $key => $setting ) {
2001 2001
 			if ( ! is_array( $setting ) && in_array( $key, $basic_fields ) ) {
2002 2002
 				// Replace old IDs with new IDs
2003
-				$post_content[ $key ] = str_replace( $old, $new, $setting );
2003
+				$post_content[$key] = str_replace( $old, $new, $setting );
2004 2004
 			} elseif ( is_array( $setting ) && in_array( $key, $array_fields ) ) {
2005 2005
 				foreach ( $setting as $k => $val ) {
2006 2006
 					// Replace old IDs with new IDs
2007
-					$post_content[ $key ][ $k ] = str_replace( $old, $new, $val );
2007
+					$post_content[$key][$k] = str_replace( $old, $new, $val );
2008 2008
 				}
2009 2009
 			}
2010 2010
 			unset( $key, $setting );
@@ -2072,7 +2072,7 @@  discard block
 block discarded – undo
2072 2072
 
2073 2073
 			if ( empty( $exists ) ) {
2074 2074
 				FrmDb::save_json_post( $new_notification );
2075
-				++$imported['imported']['actions'];
2075
+				++ $imported['imported']['actions'];
2076 2076
 			}
2077 2077
 			unset( $new_notification );
2078 2078
 		}//end foreach
@@ -2093,8 +2093,8 @@  discard block
 block discarded – undo
2093 2093
 	private static function remove_deprecated_notification_settings( $form_id, $form_options ) {
2094 2094
 		$delete_settings = array( 'notification', 'autoresponder', 'email_to' );
2095 2095
 		foreach ( $delete_settings as $index ) {
2096
-			if ( isset( $form_options[ $index ] ) ) {
2097
-				unset( $form_options[ $index ] );
2096
+			if ( isset( $form_options[$index] ) ) {
2097
+				unset( $form_options[$index] );
2098 2098
 			}
2099 2099
 		}
2100 2100
 		FrmForm::update( $form_id, array( 'options' => $form_options ) );
@@ -2164,12 +2164,12 @@  discard block
 block discarded – undo
2164 2164
 			'reply_to_name' => '',
2165 2165
 		);
2166 2166
 		foreach ( $reply_fields as $f => $val ) {
2167
-			if ( isset( $notification[ $f ] ) ) {
2168
-				$atts[ $f ] = $notification[ $f ];
2169
-				if ( 'custom' == $notification[ $f ] ) {
2170
-					$atts[ $f ] = $notification[ 'cust_' . $f ];
2171
-				} elseif ( is_numeric( $atts[ $f ] ) && ! empty( $atts[ $f ] ) ) {
2172
-					$atts[ $f ] = '[' . $atts[ $f ] . ']';
2167
+			if ( isset( $notification[$f] ) ) {
2168
+				$atts[$f] = $notification[$f];
2169
+				if ( 'custom' == $notification[$f] ) {
2170
+					$atts[$f] = $notification['cust_' . $f];
2171
+				} elseif ( is_numeric( $atts[$f] ) && ! empty( $atts[$f] ) ) {
2172
+					$atts[$f] = '[' . $atts[$f] . ']';
2173 2173
 				}
2174 2174
 			}
2175 2175
 			unset( $f, $val );
@@ -2208,13 +2208,13 @@  discard block
 block discarded – undo
2208 2208
 		foreach ( $atts['email_to'] as $key => $email_field ) {
2209 2209
 
2210 2210
 			if ( is_numeric( $email_field ) ) {
2211
-				$atts['email_to'][ $key ] = '[' . $email_field . ']';
2211
+				$atts['email_to'][$key] = '[' . $email_field . ']';
2212 2212
 			}
2213 2213
 
2214 2214
 			if ( strpos( $email_field, '|' ) ) {
2215 2215
 				$email_opt = explode( '|', $email_field );
2216 2216
 				if ( isset( $email_opt[0] ) ) {
2217
-					$atts['email_to'][ $key ] = '[' . $email_opt[0] . ' show=' . $email_opt[1] . ']';
2217
+					$atts['email_to'][$key] = '[' . $email_opt[0] . ' show=' . $email_opt[1] . ']';
2218 2218
 				}
2219 2219
 				unset( $email_opt );
2220 2220
 			}
@@ -2244,12 +2244,12 @@  discard block
 block discarded – undo
2244 2244
 		// Add more fields to the new notification
2245 2245
 		$add_fields = array( 'email_message', 'email_subject', 'plain_text', 'inc_user_info', 'conditions' );
2246 2246
 		foreach ( $add_fields as $add_field ) {
2247
-			if ( isset( $notification[ $add_field ] ) ) {
2248
-				$new_notification['post_content'][ $add_field ] = $notification[ $add_field ];
2247
+			if ( isset( $notification[$add_field] ) ) {
2248
+				$new_notification['post_content'][$add_field] = $notification[$add_field];
2249 2249
 			} elseif ( in_array( $add_field, array( 'plain_text', 'inc_user_info' ) ) ) {
2250
-				$new_notification['post_content'][ $add_field ] = 0;
2250
+				$new_notification['post_content'][$add_field] = 0;
2251 2251
 			} else {
2252
-				$new_notification['post_content'][ $add_field ] = '';
2252
+				$new_notification['post_content'][$add_field] = '';
2253 2253
 			}
2254 2254
 			unset( $add_field );
2255 2255
 		}
@@ -2275,7 +2275,7 @@  discard block
 block discarded – undo
2275 2275
 		if ( isset( $post_content['conditions'] ) && is_array( $post_content['conditions'] ) ) {
2276 2276
 			foreach ( $post_content['conditions'] as $email_key => $val ) {
2277 2277
 				if ( is_numeric( $email_key ) ) {
2278
-					$post_content['conditions'][ $email_key ] = self::switch_action_field_ids( $val, array( 'hide_field' ) );
2278
+					$post_content['conditions'][$email_key] = self::switch_action_field_ids( $val, array( 'hide_field' ) );
2279 2279
 				}
2280 2280
 				unset( $email_key, $val );
2281 2281
 			}
Please login to merge, or discard this patch.