Completed
Pull Request — master (#2396)
by
unknown
48s
created
classes/views/dashboard/templates/counters.php 1 patch
Braces   +10 added lines, -4 removed lines patch added patch discarded remove patch
@@ -14,20 +14,26 @@
 block discarded – undo
14 14
 				<h4><?php echo esc_html( $counter['heading'] ); ?></h4>
15 15
 				<?php if ( isset( $counter['cta'] ) && isset( $counter['cta']['display'] ) && true === $counter['cta']['display'] ) : ?>
16 16
 					<a href="<?php echo esc_url( $counter['cta']['link'] ); ?>"><?php echo esc_html( $counter['cta']['title'] ); ?></a>
17
-				<?php else : ?>
17
+				<?php else {
18
+	: ?>
18 19
 					<?php if ( 'currency' === $counter['type'] ) : ?>
19 20
 						<div class="frm-flex-box frm-gap-md">
20 21
 							<?php foreach ( $counter['items'] as $item ) : ?>
21 22
 								<b>
22
-									<?php echo esc_attr( $item['counter_label']['symbol_left'] ); ?>
23
+									<?php echo esc_attr( $item['counter_label']['symbol_left'] );
24
+}
25
+?>
23 26
 									<span class="frm-counter" data-type="<?php echo esc_attr( $counter['type'] ); ?>" data-locale="<?php echo esc_attr( get_locale() ); ?>" data-counter="<?php echo (int) $item['counter']; ?>"><?php echo (int) $item['counter']; ?></span>
24 27
 									<?php echo esc_attr( $item['counter_label']['symbol_right'] ); ?>
25 28
 								</b>
26 29
 							<?php endforeach; ?>
27 30
 						</div>
28
-					<?php else : ?>
31
+					<?php else {
32
+	: ?>
29 33
 						<b>
30
-							<span class="frm-counter" data-type="<?php echo esc_attr( $counter['type'] ); ?>" data-locale="<?php echo esc_attr( get_locale() ); ?>" data-counter="<?php echo (int) $counter['counter']; ?>"><?php echo (int) $counter['counter']; ?></span>
34
+							<span class="frm-counter" data-type="<?php echo esc_attr( $counter['type'] );
35
+}
36
+?>" data-locale="<?php echo esc_attr( get_locale() ); ?>" data-counter="<?php echo (int) $counter['counter']; ?>"><?php echo (int) $counter['counter']; ?></span>
31 37
 						</b>
32 38
 					<?php endif; ?>
33 39
 				<?php endif; ?>
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
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
 			return;
164 164
 		}
165 165
 
166
-		$selected_xml = isset( $form['xml'] ) && isset( $form['xml'][ $selected_form ] ) ? $form['xml'][ $selected_form ] : '';
166
+		$selected_xml = isset( $form['xml'] ) && isset( $form['xml'][$selected_form] ) ? $form['xml'][$selected_form] : '';
167 167
 		if ( empty( $selected_xml ) || strpos( $selected_xml, 'http' ) !== 0 ) {
168 168
 			return;
169 169
 		}
@@ -178,8 +178,8 @@  discard block
 block discarded – undo
178 178
 	 * @param string $value
179 179
 	 */
180 180
 	private static function get_selected_in_form( $form, $value = 'form' ) {
181
-		if ( ! empty( $form ) && ! empty( $form[ $value ] ) ) {
182
-			return $form[ $value ];
181
+		if ( ! empty( $form ) && ! empty( $form[$value] ) ) {
182
+			return $form[$value];
183 183
 		}
184 184
 
185 185
 		return '';
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
 			}
209 209
 
210 210
 			if ( $for === 'view' ) {
211
-				$item_key  = is_array( $view_keys ) ? $view_keys[ $form_key ] : $view_keys;
211
+				$item_key  = is_array( $view_keys ) ? $view_keys[$form_key] : $view_keys;
212 212
 				$shortcode = '[display-frm-data id=%1$s filter=limited]';
213 213
 			} elseif ( $for === 'form' ) {
214 214
 				$item_key  = $form_key;
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
 				continue;
224 224
 			}
225 225
 
226
-			$page_ids[ $for ] = wp_insert_post(
226
+			$page_ids[$for] = wp_insert_post(
227 227
 				array(
228 228
 					'post_title'   => $name,
229 229
 					'post_type'    => 'page',
@@ -376,7 +376,7 @@  discard block
 block discarded – undo
376 376
 		// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.NonceVerification.Missing
377 377
 		$file_type = sanitize_option( 'upload_path', $_FILES['frm_import_file']['name'] );
378 378
 		$file_type = strtolower( pathinfo( $file_type, PATHINFO_EXTENSION ) );
379
-		if ( 'xml' !== $file_type && isset( $export_format[ $file_type ] ) ) {
379
+		if ( 'xml' !== $file_type && isset( $export_format[$file_type] ) ) {
380 380
 			// allow other file types to be imported
381 381
 			do_action( 'frm_before_import_' . $file_type );
382 382
 
@@ -470,7 +470,7 @@  discard block
 block discarded – undo
470 470
 		foreach ( $type as $tb_type ) {
471 471
 			$where = array();
472 472
 			$join  = '';
473
-			$table = $tables[ $tb_type ];
473
+			$table = $tables[$tb_type];
474 474
 
475 475
 			$select     = $table . '.id';
476 476
 			$query_vars = array();
@@ -485,7 +485,7 @@  discard block
 block discarded – undo
485 485
 							$table . '.parent_form_id' => $args['ids'],
486 486
 						);
487 487
 					} else {
488
-						$where[ $table . '.status !' ] = 'draft';
488
+						$where[$table . '.status !'] = 'draft';
489 489
 					}
490 490
 					break;
491 491
 				case 'actions':
@@ -498,7 +498,7 @@  discard block
 block discarded – undo
498 498
 				case 'items':
499 499
 					// $join = "INNER JOIN {$wpdb->prefix}frm_item_metas im ON ($table.id = im.item_id)";
500 500
 					if ( $args['ids'] ) {
501
-						$where[ $table . '.form_id' ] = $args['ids'];
501
+						$where[$table . '.form_id'] = $args['ids'];
502 502
 					}
503 503
 					break;
504 504
 				case 'styles':
@@ -539,7 +539,7 @@  discard block
 block discarded – undo
539 539
 					}
540 540
 			}//end switch
541 541
 
542
-			$records[ $tb_type ] = FrmDb::get_col( $table . $join, $where, $select );
542
+			$records[$tb_type] = FrmDb::get_col( $table . $join, $where, $select );
543 543
 			unset( $tb_type );
544 544
 		}//end foreach
545 545
 
@@ -734,7 +734,7 @@  discard block
 block discarded – undo
734 734
 		$no_export_fields = FrmField::no_save_fields();
735 735
 		foreach ( $csv_fields as $k => $f ) {
736 736
 			if ( in_array( $f->type, $no_export_fields, true ) ) {
737
-				unset( $csv_fields[ $k ] );
737
+				unset( $csv_fields[$k] );
738 738
 			}
739 739
 		}
740 740
 
Please login to merge, or discard this patch.
classes/helpers/FrmXMLHelper.php 2 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -126,7 +126,8 @@
 block discarded – undo
126 126
 
127 127
 		if ( empty( $imported['form_status'] ) ) {
128 128
 			// Check for an error message in the XML.
129
-			if ( isset( $xml->Code ) && isset( $xml->Message ) ) { // phpcs:ignore WordPress.NamingConventions
129
+			if ( isset( $xml->Code ) && isset( $xml->Message ) ) {
130
+// phpcs:ignore WordPress.NamingConventions
130 131
 				$imported['error'] = (string) $xml->Message; // phpcs:ignore WordPress.NamingConventions
131 132
 			}
132 133
 		}
Please login to merge, or discard this patch.
Spacing   +101 added lines, -101 removed lines patch added patch discarded remove patch
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 				$content_before_channel_tag,
97 97
 				1
98 98
 			);
99
-			$xml_string                 = $content_before_channel_tag . substr( $xml_string, $channel_start_position );
99
+			$xml_string = $content_before_channel_tag . substr( $xml_string, $channel_start_position );
100 100
 		}
101 101
 	}
102 102
 
@@ -185,8 +185,8 @@  discard block
 block discarded – undo
185 185
 			);
186 186
 
187 187
 			if ( $term && is_array( $term ) ) {
188
-				++$imported['imported']['terms'];
189
-				$imported['terms'][ (int) $t->term_id ] = $term['term_id'];
188
+				++ $imported['imported']['terms'];
189
+				$imported['terms'][(int) $t->term_id] = $term['term_id'];
190 190
 			}
191 191
 
192 192
 			unset( $term, $t );
@@ -246,11 +246,11 @@  discard block
 block discarded – undo
246 246
 				if ( $form_id ) {
247 247
 					if ( empty( $form['parent_form_id'] ) ) {
248 248
 						// Don't include the repeater form in the imported count.
249
-						++$imported['imported']['forms'];
249
+						++ $imported['imported']['forms'];
250 250
 					}
251 251
 
252 252
 					// Keep track of whether this specific form was updated or not.
253
-					$imported['form_status'][ $form_id ] = 'imported';
253
+					$imported['form_status'][$form_id] = 'imported';
254 254
 				}
255 255
 			}
256 256
 
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
 			// Update field ids/keys to new ones.
266 266
 			do_action( 'frm_after_duplicate_form', $form_id, $form, array( 'old_id' => $old_id ) );
267 267
 
268
-			$imported['forms'][ (int) $item->id ] = $form_id;
268
+			$imported['forms'][(int) $item->id] = $form_id;
269 269
 
270 270
 			// Send pre 2.0 form options through function that creates actions.
271 271
 			self::migrate_form_settings_to_actions( $form['options'], $form_id, $imported, true );
@@ -335,19 +335,19 @@  discard block
 block discarded – undo
335 335
 		FrmForm::update( $form_id, $form );
336 336
 		if ( empty( $form['parent_form_id'] ) ) {
337 337
 			// Don't include the repeater form in the updated count.
338
-			++$imported['updated']['forms'];
338
+			++ $imported['updated']['forms'];
339 339
 		}
340 340
 
341 341
 		// Keep track of whether this specific form was updated or not
342
-		$imported['form_status'][ $form_id ] = 'updated';
342
+		$imported['form_status'][$form_id] = 'updated';
343 343
 	}
344 344
 
345 345
 	private static function get_form_fields( $form_id ) {
346 346
 		$form_fields = FrmField::get_all_for_form( $form_id, '', 'exclude', 'exclude' );
347 347
 		$old_fields  = array();
348 348
 		foreach ( $form_fields as $f ) {
349
-			$old_fields[ $f->id ]        = $f;
350
-			$old_fields[ $f->field_key ] = $f->id;
349
+			$old_fields[$f->id]        = $f;
350
+			$old_fields[$f->field_key] = $f->id;
351 351
 			unset( $f );
352 352
 		}
353 353
 		$form_fields = $old_fields;
@@ -404,7 +404,7 @@  discard block
 block discarded – undo
404 404
 	 */
405 405
 	private static function track_imported_child_forms( $form_id, $parent_form_id, &$child_forms ) {
406 406
 		if ( $parent_form_id ) {
407
-			$child_forms[ $form_id ] = $parent_form_id;
407
+			$child_forms[$form_id] = $parent_form_id;
408 408
 		}
409 409
 	}
410 410
 
@@ -419,9 +419,9 @@  discard block
 block discarded – undo
419 419
 	 */
420 420
 	private static function maybe_update_child_form_parent_id( $imported_forms, $child_forms ) {
421 421
 		foreach ( $child_forms as $child_form_id => $old_parent_form_id ) {
422
-			if ( isset( $imported_forms[ $old_parent_form_id ] ) && (int) $imported_forms[ $old_parent_form_id ] !== (int) $old_parent_form_id ) {
422
+			if ( isset( $imported_forms[$old_parent_form_id] ) && (int) $imported_forms[$old_parent_form_id] !== (int) $old_parent_form_id ) {
423 423
 				// Update all children with this old parent_form_id
424
-				$new_parent_form_id = (int) $imported_forms[ $old_parent_form_id ];
424
+				$new_parent_form_id = (int) $imported_forms[$old_parent_form_id];
425 425
 				FrmForm::update( $child_form_id, array( 'parent_form_id' => $new_parent_form_id ) );
426 426
 				do_action( 'frm_update_child_form_parent_id', $child_form_id, $new_parent_form_id );
427 427
 			}
@@ -451,34 +451,34 @@  discard block
 block discarded – undo
451 451
 
452 452
 			if ( ! empty( $this_form ) ) {
453 453
 				// check for field to edit by field id
454
-				if ( isset( $form_fields[ $f['id'] ] ) ) {
454
+				if ( isset( $form_fields[$f['id']] ) ) {
455 455
 					FrmField::update( $f['id'], $f );
456
-					++$imported['updated']['fields'];
456
+					++ $imported['updated']['fields'];
457 457
 
458
-					unset( $form_fields[ $f['id'] ] );
458
+					unset( $form_fields[$f['id']] );
459 459
 
460 460
 					// Unset old field key.
461
-					if ( isset( $form_fields[ $f['field_key'] ] ) ) {
462
-						unset( $form_fields[ $f['field_key'] ] );
461
+					if ( isset( $form_fields[$f['field_key']] ) ) {
462
+						unset( $form_fields[$f['field_key']] );
463 463
 					}
464
-				} elseif ( isset( $form_fields[ $f['field_key'] ] ) ) {
465
-					$keys_by_original_field_id[ $f['id'] ] = $f['field_key'];
464
+				} elseif ( isset( $form_fields[$f['field_key']] ) ) {
465
+					$keys_by_original_field_id[$f['id']] = $f['field_key'];
466 466
 
467 467
 					$old_field_id = $f['id'];
468 468
 
469 469
 					// check for field to edit by field key
470 470
 					unset( $f['id'] );
471 471
 
472
-					FrmField::update( $form_fields[ $f['field_key'] ], $f );
473
-					++$imported['updated']['fields'];
472
+					FrmField::update( $form_fields[$f['field_key']], $f );
473
+					++ $imported['updated']['fields'];
474 474
 
475 475
 					self::do_after_field_imported_action( $f, $form_fields, $old_field_id );
476 476
 
477 477
 					// Unset old field id.
478
-					unset( $form_fields[ $form_fields[ $f['field_key'] ] ] );
478
+					unset( $form_fields[$form_fields[$f['field_key']]] );
479 479
 
480 480
 					// Unset old field key.
481
-					unset( $form_fields[ $f['field_key'] ] );
481
+					unset( $form_fields[$f['field_key']] );
482 482
 				} else {
483 483
 					// If no matching field id or key in this form, create the field.
484 484
 					self::create_imported_field( $f, $imported );
@@ -518,7 +518,7 @@  discard block
 block discarded – undo
518 518
 	 */
519 519
 	private static function do_after_field_imported_action( $field_array, $form_fields, $old_field_id ) {
520 520
 		// Assign field array the update field's ID.
521
-		$field_array['id'] = $form_fields[ $field_array['field_key'] ];
521
+		$field_array['id'] = $form_fields[$field_array['field_key']];
522 522
 
523 523
 		/**
524 524
 		 * Fires when an existing field is imported.
@@ -529,7 +529,7 @@  discard block
 block discarded – undo
529 529
 		 * @param int   $field_id
530 530
 		 * @param int   $old_field_id
531 531
 		 */
532
-		do_action( 'frm_after_existing_field_is_imported', $field_array, $form_fields[ $field_array['field_key'] ], $old_field_id );
532
+		do_action( 'frm_after_existing_field_is_imported', $field_array, $form_fields[$field_array['field_key']], $old_field_id );
533 533
 	}
534 534
 
535 535
 	private static function fill_field( $field, $form_id ) {
@@ -625,8 +625,8 @@  discard block
 block discarded – undo
625 625
 		if ( $f['type'] === 'form' || ( $f['type'] === 'divider' && FrmField::is_option_true( $f['field_options'], 'repeat' ) ) ) {
626 626
 			if ( FrmField::is_option_true( $f['field_options'], 'form_select' ) ) {
627 627
 				$form_select = (int) $f['field_options']['form_select'];
628
-				if ( isset( $imported['forms'][ $form_select ] ) ) {
629
-					$f['field_options']['form_select'] = $imported['forms'][ $form_select ];
628
+				if ( isset( $imported['forms'][$form_select] ) ) {
629
+					$f['field_options']['form_select'] = $imported['forms'][$form_select];
630 630
 				}
631 631
 			}
632 632
 		}
@@ -647,8 +647,8 @@  discard block
 block discarded – undo
647 647
 
648 648
 		if ( FrmField::is_option_true_in_array( $f['field_options'], 'get_values_form' ) ) {
649 649
 			$old_form = $f['field_options']['get_values_form'];
650
-			if ( isset( $imported['forms'][ $old_form ] ) ) {
651
-				$f['field_options']['get_values_form'] = $imported['forms'][ $old_form ];
650
+			if ( isset( $imported['forms'][$old_form] ) ) {
651
+				$f['field_options']['get_values_form'] = $imported['forms'][$old_form];
652 652
 			}
653 653
 		}
654 654
 	}
@@ -669,12 +669,12 @@  discard block
 block discarded – undo
669 669
 	private static function migrate_placeholders( &$f ) {
670 670
 		$update_values = self::migrate_field_placeholder( $f, 'clear_on_focus' );
671 671
 		foreach ( $update_values as $k => $v ) {
672
-			$f[ $k ] = $v;
672
+			$f[$k] = $v;
673 673
 		}
674 674
 
675 675
 		$update_values = self::migrate_field_placeholder( $f, 'default_blank' );
676 676
 		foreach ( $update_values as $k => $v ) {
677
-			$f[ $k ] = $v;
677
+			$f[$k] = $v;
678 678
 		}
679 679
 	}
680 680
 
@@ -688,7 +688,7 @@  discard block
 block discarded – undo
688 688
 	public static function migrate_field_placeholder( $field, $type ) {
689 689
 		$field         = (array) $field;
690 690
 		$field_options = $field['field_options'];
691
-		if ( empty( $field_options[ $type ] ) || empty( $field['default_value'] ) ) {
691
+		if ( empty( $field_options[$type] ) || empty( $field['default_value'] ) ) {
692 692
 			return array();
693 693
 		}
694 694
 
@@ -714,7 +714,7 @@  discard block
 block discarded – undo
714 714
 				}
715 715
 
716 716
 				if ( $opt == $default_value ) {
717
-					unset( $options[ $opt_key ] );
717
+					unset( $options[$opt_key] );
718 718
 					break;
719 719
 				}
720 720
 			}
@@ -741,7 +741,7 @@  discard block
 block discarded – undo
741 741
 
742 742
 		$new_id = FrmField::create( $f );
743 743
 		if ( $new_id != false ) {
744
-			++$imported['imported']['fields'];
744
+			++ $imported['imported']['fields'];
745 745
 			do_action( 'frm_after_field_is_imported', $f, $new_id );
746 746
 		}
747 747
 	}
@@ -770,10 +770,10 @@  discard block
 block discarded – undo
770 770
 
771 771
 			$image_id = FrmProFileImport::import_attachment( $option['src'], $field_object );
772 772
 			// Remove the src from options as it isn't required after import.
773
-			unset( $field['options'][ $key ]['src'] );
773
+			unset( $field['options'][$key]['src'] );
774 774
 
775 775
 			if ( is_numeric( $image_id ) ) {
776
-				$field['options'][ $key ]['image'] = $image_id;
776
+				$field['options'][$key]['image'] = $image_id;
777 777
 			}
778 778
 		}
779 779
 
@@ -950,8 +950,8 @@  discard block
 block discarded – undo
950 950
 			} else {
951 951
 				if ( $post['post_type'] === 'frm_display' ) {
952 952
 					$post['post_content'] = self::maybe_prepare_json_view_content( $post['post_content'] );
953
-				} elseif ( 'page' === $post['post_type'] && isset( $imported['posts'][ $post['post_parent'] ] ) ) {
954
-					$post['post_parent'] = $imported['posts'][ $post['post_parent'] ];
953
+				} elseif ( 'page' === $post['post_type'] && isset( $imported['posts'][$post['post_parent']] ) ) {
954
+					$post['post_parent'] = $imported['posts'][$post['post_parent']];
955 955
 				}
956 956
 				// Create/update post now
957 957
 				$post_id = wp_insert_post( $post );
@@ -962,27 +962,27 @@  discard block
 block discarded – undo
962 962
 			}
963 963
 
964 964
 			if ( false !== strpos( $post['post_content'], '[display-frm-data' ) || false !== strpos( $post['post_content'], '[formidable' ) ) {
965
-				$posts_with_shortcodes[ $post_id ] = $post;
965
+				$posts_with_shortcodes[$post_id] = $post;
966 966
 			}
967 967
 
968 968
 			self::update_postmeta( $post, $post_id );
969 969
 			self::update_layout( $post, $post_id );
970 970
 
971 971
 			$this_type = 'posts';
972
-			if ( isset( $post_types[ $post['post_type'] ] ) ) {
973
-				$this_type = $post_types[ $post['post_type'] ];
972
+			if ( isset( $post_types[$post['post_type']] ) ) {
973
+				$this_type = $post_types[$post['post_type']];
974 974
 			}
975 975
 
976 976
 			if ( isset( $post['ID'] ) && $post_id == $post['ID'] ) {
977
-				++$imported['updated'][ $this_type ];
977
+				++ $imported['updated'][$this_type];
978 978
 			} else {
979
-				++$imported['imported'][ $this_type ];
979
+				++ $imported['imported'][$this_type];
980 980
 			}
981 981
 
982
-			$imported['posts'][ $old_id ] = $post_id;
982
+			$imported['posts'][$old_id] = $post_id;
983 983
 
984 984
 			if ( $post['post_type'] === 'frm_display' ) {
985
-				$view_ids[ $old_id ] = $post_id;
985
+				$view_ids[$old_id] = $post_id;
986 986
 			}
987 987
 
988 988
 			do_action( 'frm_after_import_view', $post_id, $post );
@@ -1143,9 +1143,9 @@  discard block
 block discarded – undo
1143 1143
 			$post['attachment_url'] = (string) $item->attachment_url;
1144 1144
 		}
1145 1145
 
1146
-		if ( $post['post_type'] == FrmFormActionsController::$action_post_type && isset( $imported['forms'][ (int) $post['menu_order'] ] ) ) {
1146
+		if ( $post['post_type'] == FrmFormActionsController::$action_post_type && isset( $imported['forms'][(int) $post['menu_order']] ) ) {
1147 1147
 			// update to new form id
1148
-			$post['menu_order'] = $imported['forms'][ (int) $post['menu_order'] ];
1148
+			$post['menu_order'] = $imported['forms'][(int) $post['menu_order']];
1149 1149
 		}
1150 1150
 
1151 1151
 		// Don't allow default styles to take over a site's default style
@@ -1182,8 +1182,8 @@  discard block
 block discarded – undo
1182 1182
 		);
1183 1183
 
1184 1184
 		// Switch old form and field ids to new ones.
1185
-		if ( 'frm_form_id' === $m['key'] && isset( $imported['forms'][ (int) $m['value'] ] ) ) {
1186
-			$m['value'] = $imported['forms'][ (int) $m['value'] ];
1185
+		if ( 'frm_form_id' === $m['key'] && isset( $imported['forms'][(int) $m['value']] ) ) {
1186
+			$m['value'] = $imported['forms'][(int) $m['value']];
1187 1187
 		} else {
1188 1188
 			$m['value'] = FrmAppHelper::maybe_json_decode( $m['value'] );
1189 1189
 
@@ -1194,23 +1194,23 @@  discard block
 block discarded – undo
1194 1194
 				} elseif ( 'frm_options' === $m['key'] ) {
1195 1195
 
1196 1196
 					foreach ( array( 'date_field_id', 'edate_field_id' ) as $setting_name ) {
1197
-						if ( isset( $m['value'][ $setting_name ] ) && is_numeric( $m['value'][ $setting_name ] ) && isset( $frm_duplicate_ids[ $m['value'][ $setting_name ] ] ) ) {
1198
-							$m['value'][ $setting_name ] = $frm_duplicate_ids[ $m['value'][ $setting_name ] ];
1197
+						if ( isset( $m['value'][$setting_name] ) && is_numeric( $m['value'][$setting_name] ) && isset( $frm_duplicate_ids[$m['value'][$setting_name]] ) ) {
1198
+							$m['value'][$setting_name] = $frm_duplicate_ids[$m['value'][$setting_name]];
1199 1199
 						}
1200 1200
 					}
1201 1201
 
1202 1202
 					if ( ! empty( $m['value']['map_address_fields'] ) ) {
1203 1203
 						foreach ( $m['value']['map_address_fields'] as $address_field_key => $address_field_id ) {
1204
-							if ( isset( $frm_duplicate_ids[ $address_field_id ] ) ) {
1205
-								$m['value']['map_address_fields'][ $address_field_key ] = $frm_duplicate_ids[ $address_field_id ];
1204
+							if ( isset( $frm_duplicate_ids[$address_field_id] ) ) {
1205
+								$m['value']['map_address_fields'][$address_field_key] = $frm_duplicate_ids[$address_field_id];
1206 1206
 							}
1207 1207
 						}
1208 1208
 					}
1209 1209
 
1210 1210
 					if ( ! empty( $m['value']['calendar_options'] ) ) {
1211 1211
 						foreach ( $m['value']['calendar_options'] as $calendar_option_group_key => $calendar_option ) {
1212
-							if ( isset( $frm_duplicate_ids[ $calendar_option['value'] ] ) ) {
1213
-								$m['value']['calendar_options'][ $calendar_option_group_key ]['value'] = $frm_duplicate_ids[ $calendar_option['value'] ];
1212
+							if ( isset( $frm_duplicate_ids[$calendar_option['value']] ) ) {
1213
+								$m['value']['calendar_options'][$calendar_option_group_key]['value'] = $frm_duplicate_ids[$calendar_option['value']];
1214 1214
 							}
1215 1215
 						}
1216 1216
 					}
@@ -1218,8 +1218,8 @@  discard block
 block discarded – undo
1218 1218
 					if ( ! empty( $m['value']['timeline_options'] ) ) {
1219 1219
 						foreach ( $m['value']['timeline_options'] as $timeline_option_group_key => $timeline_group_option ) {
1220 1220
 							foreach ( $timeline_group_option as $timeline_option_key => $timeline_option ) {
1221
-								if ( isset( $frm_duplicate_ids[ $timeline_option ] ) ) {
1222
-									$m['value']['timeline_options'][ $timeline_option_group_key ][ $timeline_option_key ] = $frm_duplicate_ids[ $timeline_option ];
1221
+								if ( isset( $frm_duplicate_ids[$timeline_option] ) ) {
1222
+									$m['value']['timeline_options'][$timeline_option_group_key][$timeline_option_key] = $frm_duplicate_ids[$timeline_option];
1223 1223
 								}
1224 1224
 							}
1225 1225
 						}
@@ -1227,8 +1227,8 @@  discard block
 block discarded – undo
1227 1227
 
1228 1228
 					$check_dup_array = array();
1229 1229
 					if ( ! empty( $m['value']['order_by'] ) ) {
1230
-						if ( is_numeric( $m['value']['order_by'] ) && isset( $frm_duplicate_ids[ $m['value']['order_by'] ] ) ) {
1231
-							$m['value']['order_by'] = $frm_duplicate_ids[ $m['value']['order_by'] ];
1230
+						if ( is_numeric( $m['value']['order_by'] ) && isset( $frm_duplicate_ids[$m['value']['order_by']] ) ) {
1231
+							$m['value']['order_by'] = $frm_duplicate_ids[$m['value']['order_by']];
1232 1232
 						} elseif ( is_array( $m['value']['order_by'] ) ) {
1233 1233
 							$check_dup_array[] = 'order_by';
1234 1234
 						}
@@ -1239,9 +1239,9 @@  discard block
 block discarded – undo
1239 1239
 					}
1240 1240
 
1241 1241
 					foreach ( $check_dup_array as $check_k ) {
1242
-						foreach ( (array) $m['value'][ $check_k ] as $mk => $mv ) {
1243
-							if ( isset( $frm_duplicate_ids[ $mv ] ) ) {
1244
-								$m['value'][ $check_k ][ $mk ] = $frm_duplicate_ids[ $mv ];
1242
+						foreach ( (array) $m['value'][$check_k] as $mk => $mv ) {
1243
+							if ( isset( $frm_duplicate_ids[$mv] ) ) {
1244
+								$m['value'][$check_k][$mk] = $frm_duplicate_ids[$mv];
1245 1245
 							}
1246 1246
 							unset( $mk, $mv );
1247 1247
 						}
@@ -1254,11 +1254,11 @@  discard block
 block discarded – undo
1254 1254
 			$m['value'] = FrmAppHelper::maybe_json_decode( $m['value'] );
1255 1255
 		}
1256 1256
 
1257
-		$post['postmeta'][ (string) $meta->meta_key ] = $m['value'];
1257
+		$post['postmeta'][(string) $meta->meta_key] = $m['value'];
1258 1258
 	}
1259 1259
 
1260 1260
 	private static function populate_layout( &$post, $layout ) {
1261
-		$post['layout'][ (string) $layout->type ] = (string) $layout->data;
1261
+		$post['layout'][(string) $layout->type] = (string) $layout->data;
1262 1262
 	}
1263 1263
 
1264 1264
 	/**
@@ -1286,11 +1286,11 @@  discard block
 block discarded – undo
1286 1286
 				$name = (string) $c;
1287 1287
 			}
1288 1288
 
1289
-			if ( ! isset( $post['tax_input'][ $taxonomy ] ) ) {
1290
-				$post['tax_input'][ $taxonomy ] = array();
1289
+			if ( ! isset( $post['tax_input'][$taxonomy] ) ) {
1290
+				$post['tax_input'][$taxonomy] = array();
1291 1291
 			}
1292 1292
 
1293
-			$post['tax_input'][ $taxonomy ][] = $name;
1293
+			$post['tax_input'][$taxonomy][] = $name;
1294 1294
 			unset( $name );
1295 1295
 		}//end foreach
1296 1296
 	}
@@ -1430,7 +1430,7 @@  discard block
 block discarded – undo
1430 1430
 
1431 1431
 		$message = '<ul>';
1432 1432
 		foreach ( $result as $type => $results ) {
1433
-			if ( ! isset( $t_strings[ $type ] ) ) {
1433
+			if ( ! isset( $t_strings[$type] ) ) {
1434 1434
 				// only print imported and updated
1435 1435
 				continue;
1436 1436
 			}
@@ -1442,7 +1442,7 @@  discard block
 block discarded – undo
1442 1442
 			}
1443 1443
 
1444 1444
 			if ( ! empty( $s_message ) ) {
1445
-				$message .= '<li><strong>' . $t_strings[ $type ] . ':</strong> ';
1445
+				$message .= '<li><strong>' . $t_strings[$type] . ':</strong> ';
1446 1446
 				$message .= implode( ', ', $s_message );
1447 1447
 				$message .= '</li>';
1448 1448
 			}
@@ -1494,8 +1494,8 @@  discard block
 block discarded – undo
1494 1494
 			'actions' => sprintf( _n( '%1$s Form Action', '%1$s Form Actions', $m, 'formidable' ), $m ),
1495 1495
 		);
1496 1496
 
1497
-		if ( isset( $strings[ $type ] ) ) {
1498
-			$s_message[] = $strings[ $type ];
1497
+		if ( isset( $strings[$type] ) ) {
1498
+			$s_message[] = $strings[$type];
1499 1499
 		} else {
1500 1500
 			$string = ' ' . $m . ' ' . ucfirst( $type );
1501 1501
 
@@ -1643,7 +1643,7 @@  discard block
 block discarded – undo
1643 1643
 
1644 1644
 		foreach ( $options as $key => $option ) {
1645 1645
 			if ( is_array( $option ) && ! empty( $option['image'] ) ) {
1646
-				$options[ $key ]['src'] = wp_get_attachment_url( $option['image'] );
1646
+				$options[$key]['src'] = wp_get_attachment_url( $option['image'] );
1647 1647
 				$updated                = true;
1648 1648
 			}
1649 1649
 		}
@@ -1672,8 +1672,8 @@  discard block
 block discarded – undo
1672 1672
 	 */
1673 1673
 	private static function remove_defaults( $defaults, &$saved ) {
1674 1674
 		foreach ( $saved as $key => $value ) {
1675
-			if ( isset( $defaults[ $key ] ) && $defaults[ $key ] === $value ) {
1676
-				unset( $saved[ $key ] );
1675
+			if ( isset( $defaults[$key] ) && $defaults[$key] === $value ) {
1676
+				unset( $saved[$key] );
1677 1677
 			}
1678 1678
 		}
1679 1679
 	}
@@ -1684,14 +1684,14 @@  discard block
 block discarded – undo
1684 1684
 	 * @since 3.06
1685 1685
 	 */
1686 1686
 	private static function remove_default_html( $html_name, $defaults, &$options ) {
1687
-		if ( ! isset( $options[ $html_name ] ) || ! isset( $defaults[ $html_name ] ) ) {
1687
+		if ( ! isset( $options[$html_name] ) || ! isset( $defaults[$html_name] ) ) {
1688 1688
 			return;
1689 1689
 		}
1690 1690
 
1691
-		$old_html     = str_replace( "\r\n", "\n", $options[ $html_name ] );
1692
-		$default_html = $defaults[ $html_name ];
1691
+		$old_html     = str_replace( "\r\n", "\n", $options[$html_name] );
1692
+		$default_html = $defaults[$html_name];
1693 1693
 		if ( $old_html == $default_html ) {
1694
-			unset( $options[ $html_name ] );
1694
+			unset( $options[$html_name] );
1695 1695
 
1696 1696
 			return;
1697 1697
 		}
@@ -1699,7 +1699,7 @@  discard block
 block discarded – undo
1699 1699
 		// Account for some of the older field default HTML.
1700 1700
 		$default_html = str_replace( ' id="frm_desc_field_[key]"', '', $default_html );
1701 1701
 		if ( $old_html == $default_html ) {
1702
-			unset( $options[ $html_name ] );
1702
+			unset( $options[$html_name] );
1703 1703
 		}
1704 1704
 	}
1705 1705
 
@@ -1790,8 +1790,8 @@  discard block
 block discarded – undo
1790 1790
 		);
1791 1791
 
1792 1792
 		foreach ( $post_settings as $post_setting ) {
1793
-			if ( isset( $form_options[ $post_setting ] ) ) {
1794
-				$new_action['post_content'][ $post_setting ] = $form_options[ $post_setting ];
1793
+			if ( isset( $form_options[$post_setting] ) ) {
1794
+				$new_action['post_content'][$post_setting] = $form_options[$post_setting];
1795 1795
 			}
1796 1796
 			unset( $post_setting );
1797 1797
 		}
@@ -1829,7 +1829,7 @@  discard block
 block discarded – undo
1829 1829
 		if ( ! $exists ) {
1830 1830
 			// this isn't an email, but we need to use a class that will always be included
1831 1831
 			FrmDb::save_json_post( $new_action );
1832
-			++$imported['imported']['actions'];
1832
+			++ $imported['imported']['actions'];
1833 1833
 		}
1834 1834
 	}
1835 1835
 
@@ -1862,11 +1862,11 @@  discard block
 block discarded – undo
1862 1862
 		foreach ( $post_content as $key => $setting ) {
1863 1863
 			if ( ! is_array( $setting ) && in_array( $key, $basic_fields ) ) {
1864 1864
 				// Replace old IDs with new IDs
1865
-				$post_content[ $key ] = str_replace( $old, $new, $setting );
1865
+				$post_content[$key] = str_replace( $old, $new, $setting );
1866 1866
 			} elseif ( is_array( $setting ) && in_array( $key, $array_fields ) ) {
1867 1867
 				foreach ( $setting as $k => $val ) {
1868 1868
 					// Replace old IDs with new IDs
1869
-					$post_content[ $key ][ $k ] = str_replace( $old, $new, $val );
1869
+					$post_content[$key][$k] = str_replace( $old, $new, $val );
1870 1870
 				}
1871 1871
 			}
1872 1872
 			unset( $key, $setting );
@@ -1923,7 +1923,7 @@  discard block
 block discarded – undo
1923 1923
 
1924 1924
 			if ( empty( $exists ) ) {
1925 1925
 				FrmDb::save_json_post( $new_notification );
1926
-				++$imported['imported']['actions'];
1926
+				++ $imported['imported']['actions'];
1927 1927
 			}
1928 1928
 			unset( $new_notification );
1929 1929
 		}//end foreach
@@ -1942,8 +1942,8 @@  discard block
 block discarded – undo
1942 1942
 	private static function remove_deprecated_notification_settings( $form_id, $form_options ) {
1943 1943
 		$delete_settings = array( 'notification', 'autoresponder', 'email_to' );
1944 1944
 		foreach ( $delete_settings as $index ) {
1945
-			if ( isset( $form_options[ $index ] ) ) {
1946
-				unset( $form_options[ $index ] );
1945
+			if ( isset( $form_options[$index] ) ) {
1946
+				unset( $form_options[$index] );
1947 1947
 			}
1948 1948
 		}
1949 1949
 		FrmForm::update( $form_id, array( 'options' => $form_options ) );
@@ -1996,12 +1996,12 @@  discard block
 block discarded – undo
1996 1996
 			'reply_to_name' => '',
1997 1997
 		);
1998 1998
 		foreach ( $reply_fields as $f => $val ) {
1999
-			if ( isset( $notification[ $f ] ) ) {
2000
-				$atts[ $f ] = $notification[ $f ];
2001
-				if ( 'custom' == $notification[ $f ] ) {
2002
-					$atts[ $f ] = $notification[ 'cust_' . $f ];
2003
-				} elseif ( is_numeric( $atts[ $f ] ) && ! empty( $atts[ $f ] ) ) {
2004
-					$atts[ $f ] = '[' . $atts[ $f ] . ']';
1999
+			if ( isset( $notification[$f] ) ) {
2000
+				$atts[$f] = $notification[$f];
2001
+				if ( 'custom' == $notification[$f] ) {
2002
+					$atts[$f] = $notification['cust_' . $f];
2003
+				} elseif ( is_numeric( $atts[$f] ) && ! empty( $atts[$f] ) ) {
2004
+					$atts[$f] = '[' . $atts[$f] . ']';
2005 2005
 				}
2006 2006
 			}
2007 2007
 			unset( $f, $val );
@@ -2032,13 +2032,13 @@  discard block
 block discarded – undo
2032 2032
 		foreach ( $atts['email_to'] as $key => $email_field ) {
2033 2033
 
2034 2034
 			if ( is_numeric( $email_field ) ) {
2035
-				$atts['email_to'][ $key ] = '[' . $email_field . ']';
2035
+				$atts['email_to'][$key] = '[' . $email_field . ']';
2036 2036
 			}
2037 2037
 
2038 2038
 			if ( strpos( $email_field, '|' ) ) {
2039 2039
 				$email_opt = explode( '|', $email_field );
2040 2040
 				if ( isset( $email_opt[0] ) ) {
2041
-					$atts['email_to'][ $key ] = '[' . $email_opt[0] . ' show=' . $email_opt[1] . ']';
2041
+					$atts['email_to'][$key] = '[' . $email_opt[0] . ' show=' . $email_opt[1] . ']';
2042 2042
 				}
2043 2043
 				unset( $email_opt );
2044 2044
 			}
@@ -2059,12 +2059,12 @@  discard block
 block discarded – undo
2059 2059
 		// Add more fields to the new notification
2060 2060
 		$add_fields = array( 'email_message', 'email_subject', 'plain_text', 'inc_user_info', 'conditions' );
2061 2061
 		foreach ( $add_fields as $add_field ) {
2062
-			if ( isset( $notification[ $add_field ] ) ) {
2063
-				$new_notification['post_content'][ $add_field ] = $notification[ $add_field ];
2062
+			if ( isset( $notification[$add_field] ) ) {
2063
+				$new_notification['post_content'][$add_field] = $notification[$add_field];
2064 2064
 			} elseif ( in_array( $add_field, array( 'plain_text', 'inc_user_info' ) ) ) {
2065
-				$new_notification['post_content'][ $add_field ] = 0;
2065
+				$new_notification['post_content'][$add_field] = 0;
2066 2066
 			} else {
2067
-				$new_notification['post_content'][ $add_field ] = '';
2067
+				$new_notification['post_content'][$add_field] = '';
2068 2068
 			}
2069 2069
 			unset( $add_field );
2070 2070
 		}
@@ -2088,7 +2088,7 @@  discard block
 block discarded – undo
2088 2088
 		if ( isset( $post_content['conditions'] ) && is_array( $post_content['conditions'] ) ) {
2089 2089
 			foreach ( $post_content['conditions'] as $email_key => $val ) {
2090 2090
 				if ( is_numeric( $email_key ) ) {
2091
-					$post_content['conditions'][ $email_key ] = self::switch_action_field_ids( $val, array( 'hide_field' ) );
2091
+					$post_content['conditions'][$email_key] = self::switch_action_field_ids( $val, array( 'hide_field' ) );
2092 2092
 				}
2093 2093
 				unset( $email_key, $val );
2094 2094
 			}
Please login to merge, or discard this patch.
classes/models/FrmEntryValues.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -177,12 +177,12 @@  discard block
 block discarded – undo
177 177
 	 * @return array
178 178
 	 */
179 179
 	private function prepare_array_property( $index, $atts ) {
180
-		if ( ! empty( $atts[ $index ] ) ) {
180
+		if ( ! empty( $atts[$index] ) ) {
181 181
 
182
-			if ( is_array( $atts[ $index ] ) ) {
183
-				$property = $atts[ $index ];
182
+			if ( is_array( $atts[$index] ) ) {
183
+				$property = $atts[$index];
184 184
 			} else {
185
-				$property = explode( ',', $atts[ $index ] );
185
+				$property = explode( ',', $atts[$index] );
186 186
 			}
187 187
 		} else {
188 188
 			$property = array();
@@ -262,11 +262,11 @@  discard block
 block discarded – undo
262 262
 			);
263 263
 		}
264 264
 
265
-		$ip       = array(
265
+		$ip = array(
266 266
 			'label' => __( 'IP Address', 'formidable' ),
267 267
 			'value' => $this->entry->ip,
268 268
 		);
269
-		$browser  = array(
269
+		$browser = array(
270 270
 			'label' => __( 'User-Agent (Browser/OS)', 'formidable' ),
271 271
 			'value' => isset( $entry_description['browser'] ) ? FrmEntriesHelper::get_browser( $entry_description['browser'] ) : '',
272 272
 		);
@@ -353,6 +353,6 @@  discard block
 block discarded – undo
353 353
 	 * @return void
354 354
 	 */
355 355
 	protected function add_field_values( $field ) {
356
-		$this->field_values[ $field->id ] = new FrmFieldValue( $field, $this->entry );
356
+		$this->field_values[$field->id] = new FrmFieldValue( $field, $this->entry );
357 357
 	}
358 358
 }
Please login to merge, or discard this patch.
classes/helpers/FrmSerializedStringParserHelper.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -89,12 +89,12 @@
 block discarded – undo
89 89
 		$string->skip_next_character();
90 90
 
91 91
 		$val = array();
92
-		for ( $i = 0; $i < $count; $i++ ) {
92
+		for ( $i = 0; $i < $count; $i ++ ) {
93 93
 			$array_key   = $this->do_parse( $string );
94 94
 			$array_value = $this->do_parse( $string );
95 95
 
96 96
 			if ( ! is_array( $array_key ) ) {
97
-				$val[ $array_key ] = $array_value;
97
+				$val[$array_key] = $array_value;
98 98
 			}
99 99
 		}
100 100
 
Please login to merge, or discard this patch.
classes/helpers/FrmStringReaderHelper.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 	 */
51 51
 	public function read_until( $char ) {
52 52
 		$value = '';
53
-		while ( $this->pos <= $this->max && ( $one = $this->string[ $this->pos++ ] ) !== $char ) {
53
+		while ( $this->pos <= $this->max && ( $one = $this->string[$this->pos ++] ) !== $char ) {
54 54
 			$value .= $one;
55 55
 		}
56 56
 		return $value;
@@ -67,10 +67,10 @@  discard block
 block discarded – undo
67 67
 	public function read( $count ) {
68 68
 		$value = '';
69 69
 
70
-		while ( $count > 0 && $this->pos <= $this->max && ( ( $one = $this->string[ $this->pos ] ) || '0' === $one ) ) {
70
+		while ( $count > 0 && $this->pos <= $this->max && ( ( $one = $this->string[$this->pos] ) || '0' === $one ) ) {
71 71
 			$value     .= $one;
72 72
 			$this->pos += 1;
73
-			--$count;
73
+			-- $count;
74 74
 		}
75 75
 
76 76
 		/**
Please login to merge, or discard this patch.
classes/models/FrmInbox.php 1 patch
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
 			return;
106 106
 		}
107 107
 
108
-		if ( isset( self::$messages[ $message['key'] ] ) && ! isset( $message['force'] ) ) {
108
+		if ( isset( self::$messages[$message['key']] ) && ! isset( $message['force'] ) ) {
109 109
 			// Don't replace messages unless required.
110 110
 			return;
111 111
 		}
@@ -114,13 +114,13 @@  discard block
 block discarded – undo
114 114
 			return;
115 115
 		}
116 116
 
117
-		if ( isset( self::$messages[ $message['key'] ] ) ) {
117
+		if ( isset( self::$messages[$message['key']] ) ) {
118 118
 			// Move up and mark as new.
119
-			unset( self::$messages[ $message['key'] ] );
119
+			unset( self::$messages[$message['key']] );
120 120
 		}
121 121
 
122 122
 		$this->fill_message( $message );
123
-		self::$messages[ $message['key'] ] = $message;
123
+		self::$messages[$message['key']] = $message;
124 124
 
125 125
 		$this->update_list();
126 126
 
@@ -157,11 +157,11 @@  discard block
 block discarded – undo
157 157
 	private function clean_messages() {
158 158
 		$removed = false;
159 159
 		foreach ( self::$messages as $t => $message ) {
160
-			$read      = ! empty( $message['read'] ) && isset( $message['read'][ get_current_user_id() ] ) && $message['read'][ get_current_user_id() ] < strtotime( '-1 month' );
161
-			$dismissed = ! empty( $message['dismissed'] ) && isset( $message['dismissed'][ get_current_user_id() ] ) && $message['dismissed'][ get_current_user_id() ] < strtotime( '-1 week' );
160
+			$read      = ! empty( $message['read'] ) && isset( $message['read'][get_current_user_id()] ) && $message['read'][get_current_user_id()] < strtotime( '-1 month' );
161
+			$dismissed = ! empty( $message['dismissed'] ) && isset( $message['dismissed'][get_current_user_id()] ) && $message['dismissed'][get_current_user_id()] < strtotime( '-1 week' );
162 162
 			$expired   = $this->is_expired( $message );
163 163
 			if ( $read || $expired || $dismissed ) {
164
-				unset( self::$messages[ $t ] );
164
+				unset( self::$messages[$t] );
165 165
 				$removed = true;
166 166
 			}
167 167
 		}
@@ -179,11 +179,11 @@  discard block
 block discarded – undo
179 179
 	public function filter_messages( &$messages, $type = 'unread' ) {
180 180
 		$user_id = get_current_user_id();
181 181
 		foreach ( $messages as $k => $message ) {
182
-			$dismissed = isset( $message['dismissed'] ) && isset( $message['dismissed'][ $user_id ] );
182
+			$dismissed = isset( $message['dismissed'] ) && isset( $message['dismissed'][$user_id] );
183 183
 			if ( empty( $k ) || $this->is_expired( $message ) || ( $type === 'dismissed' ) !== $dismissed ) {
184
-				unset( $messages[ $k ] );
184
+				unset( $messages[$k] );
185 185
 			} elseif ( ! $this->is_for_user( $message ) ) {
186
-				unset( $messages[ $k ] );
186
+				unset( $messages[$k] );
187 187
 			}
188 188
 		}
189 189
 		$messages = apply_filters( 'frm_filter_inbox', $messages );
@@ -241,14 +241,14 @@  discard block
 block discarded – undo
241 241
 	 * @return void
242 242
 	 */
243 243
 	public function mark_read( $key ) {
244
-		if ( ! $key || ! isset( self::$messages[ $key ] ) ) {
244
+		if ( ! $key || ! isset( self::$messages[$key] ) ) {
245 245
 			return;
246 246
 		}
247 247
 
248
-		if ( ! isset( self::$messages[ $key ]['read'] ) ) {
249
-			self::$messages[ $key ]['read'] = array();
248
+		if ( ! isset( self::$messages[$key]['read'] ) ) {
249
+			self::$messages[$key]['read'] = array();
250 250
 		}
251
-		self::$messages[ $key ]['read'][ get_current_user_id() ] = time();
251
+		self::$messages[$key]['read'][get_current_user_id()] = time();
252 252
 
253 253
 		$this->update_list();
254 254
 	}
@@ -260,9 +260,9 @@  discard block
 block discarded – undo
260 260
 	 * @return void
261 261
 	 */
262 262
 	public function mark_unread( $key ) {
263
-		$is_read = isset( self::$messages[ $key ] ) && isset( self::$messages[ $key ]['read'] ) && isset( self::$messages[ $key ]['read'][ get_current_user_id() ] );
263
+		$is_read = isset( self::$messages[$key] ) && isset( self::$messages[$key]['read'] ) && isset( self::$messages[$key]['read'][get_current_user_id()] );
264 264
 		if ( $is_read ) {
265
-			unset( self::$messages[ $key ]['read'][ get_current_user_id() ] );
265
+			unset( self::$messages[$key]['read'][get_current_user_id()] );
266 266
 			$this->update_list();
267 267
 		}
268 268
 	}
@@ -278,14 +278,14 @@  discard block
 block discarded – undo
278 278
 			return;
279 279
 		}
280 280
 
281
-		if ( ! isset( self::$messages[ $key ] ) ) {
281
+		if ( ! isset( self::$messages[$key] ) ) {
282 282
 			return;
283 283
 		}
284 284
 
285
-		if ( ! isset( self::$messages[ $key ]['dismissed'] ) ) {
286
-			self::$messages[ $key ]['dismissed'] = array();
285
+		if ( ! isset( self::$messages[$key]['dismissed'] ) ) {
286
+			self::$messages[$key]['dismissed'] = array();
287 287
 		}
288
-		self::$messages[ $key ]['dismissed'][ get_current_user_id() ] = time();
288
+		self::$messages[$key]['dismissed'][get_current_user_id()] = time();
289 289
 
290 290
 		$this->update_list();
291 291
 	}
@@ -299,11 +299,11 @@  discard block
 block discarded – undo
299 299
 		$user_id = get_current_user_id();
300 300
 		foreach ( self::$messages as $key => $message ) {
301 301
 			if ( ! isset( $message['dismissed'] ) ) {
302
-				self::$messages[ $key ]['dismissed'] = array();
302
+				self::$messages[$key]['dismissed'] = array();
303 303
 			}
304 304
 
305
-			if ( ! isset( $message['dismissed'][ $user_id ] ) ) {
306
-				self::$messages[ $key ]['dismissed'][ $user_id ] = time();
305
+			if ( ! isset( $message['dismissed'][$user_id] ) ) {
306
+				self::$messages[$key]['dismissed'][$user_id] = time();
307 307
 			}
308 308
 		}
309 309
 		$this->update_list();
@@ -313,8 +313,8 @@  discard block
 block discarded – undo
313 313
 		$messages = $this->get_messages( 'filter' );
314 314
 		$user_id  = get_current_user_id();
315 315
 		foreach ( $messages as $t => $message ) {
316
-			if ( isset( $message['read'] ) && isset( $message['read'][ $user_id ] ) ) {
317
-				unset( $messages[ $t ] );
316
+			if ( isset( $message['read'] ) && isset( $message['read'][$user_id] ) ) {
317
+				unset( $messages[$t] );
318 318
 			}
319 319
 		}
320 320
 		return $messages;
@@ -353,8 +353,8 @@  discard block
 block discarded – undo
353 353
 	 * @return void
354 354
 	 */
355 355
 	public function remove( $key ) {
356
-		if ( isset( self::$messages[ $key ] ) ) {
357
-			unset( self::$messages[ $key ] );
356
+		if ( isset( self::$messages[$key] ) ) {
357
+			unset( self::$messages[$key] );
358 358
 			$this->update_list();
359 359
 		}
360 360
 	}
@@ -400,7 +400,7 @@  discard block
 block discarded – undo
400 400
 			 * @param array $matches The regex results for a single match.
401 401
 			 * @return string
402 402
 			 */
403
-			function ( $matches ) {
403
+			function( $matches ) {
404 404
 				$url   = $matches[2];
405 405
 				$parts = parse_url( $url );
406 406
 
@@ -463,8 +463,8 @@  discard block
 block discarded – undo
463 463
 		$inbox = new self();
464 464
 		return array_filter(
465 465
 			$inbox->get_messages( 'filter' ),
466
-			function ( $message ) use ( $key ) {
467
-				return ! empty( $message[ $key ] );
466
+			function( $message ) use ( $key ) {
467
+				return ! empty( $message[$key] );
468 468
 			}
469 469
 		);
470 470
 	}
@@ -510,8 +510,8 @@  discard block
 block discarded – undo
510 510
 
511 511
 		return array_reduce(
512 512
 			$keys_to_return,
513
-			function ( $total, $key ) use ( $message ) {
514
-				$total[ $key ] = isset( $message[ $key ] ) ? $message[ $key ] : '';
513
+			function( $total, $key ) use ( $message ) {
514
+				$total[$key] = isset( $message[$key] ) ? $message[$key] : '';
515 515
 				return $total;
516 516
 			},
517 517
 			array()
Please login to merge, or discard this patch.
classes/models/FrmFieldTypeOptionData.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -19,9 +19,9 @@
 block discarded – undo
19 19
 	 * @return array
20 20
 	 */
21 21
 	public static function get_field_types( $type ) {
22
-		if ( ! isset( self::$data[ $type ] ) ) {
23
-			self::$data[ $type ] = FrmFieldsHelper::get_field_types( $type );
22
+		if ( ! isset( self::$data[$type] ) ) {
23
+			self::$data[$type] = FrmFieldsHelper::get_field_types( $type );
24 24
 		}
25
-		return self::$data[ $type ];
25
+		return self::$data[$type];
26 26
 	}
27 27
 }
Please login to merge, or discard this patch.
classes/models/fields/FrmFieldUserID.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@
 block discarded – undo
58 58
 	protected function get_field_value( $args ) {
59 59
 		$user_ID      = get_current_user_id();
60 60
 		$user_ID      = ( $user_ID ? $user_ID : '' );
61
-		$posted_value = ( FrmAppHelper::is_admin() && $_POST && isset( $_POST['item_meta'][ $this->field['id'] ] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing
61
+		$posted_value = ( FrmAppHelper::is_admin() && $_POST && isset( $_POST['item_meta'][$this->field['id']] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing
62 62
 		$action       = ( isset( $args['action'] ) ? $args['action'] : ( isset( $args['form_action'] ) ? $args['form_action'] : '' ) );
63 63
 		$updating     = $action === 'update';
64 64
 		return is_numeric( $this->field['value'] ) || $posted_value || $updating ? $this->field['value'] : $user_ID;
Please login to merge, or discard this patch.