Completed
Push — master ( 67005e...6d6fde )
by
unknown
18s
created
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/models/FrmAddon.php 2 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -593,7 +593,8 @@
 block discarded – undo
593 593
 	 * @return void
594 594
 	 */
595 595
 	private function is_license_revoked() {
596
-		if ( empty( $this->license ) || empty( $this->plugin_slug ) || isset( $_POST['license'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
596
+		if ( empty( $this->license ) || empty( $this->plugin_slug ) || isset( $_POST['license'] ) ) {
597
+// phpcs:ignore WordPress.Security.NonceVerification.Missing
597 598
 			return;
598 599
 		}
599 600
 
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 	 * @return array
140 140
 	 */
141 141
 	public function insert_installed_addon( $plugins ) {
142
-		$plugins[ $this->plugin_slug ] = $this;
142
+		$plugins[$this->plugin_slug] = $this;
143 143
 
144 144
 		return $plugins;
145 145
 	}
@@ -153,8 +153,8 @@  discard block
 block discarded – undo
153 153
 		$plugins = apply_filters( 'frm_installed_addons', array() );
154 154
 		$plugin  = false;
155 155
 
156
-		if ( isset( $plugins[ $plugin_slug ] ) ) {
157
-			$plugin = $plugins[ $plugin_slug ];
156
+		if ( isset( $plugins[$plugin_slug] ) ) {
157
+			$plugin = $plugins[$plugin_slug];
158 158
 		}
159 159
 
160 160
 		return $plugin;
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
 		} else {
220 220
 			$api     = new FrmFormApi( $this->license );
221 221
 			$plugins = $api->get_api_info();
222
-			$_data   = $plugins[ $item_id ];
222
+			$_data   = $plugins[$item_id];
223 223
 		}
224 224
 
225 225
 		$_data['sections'] = array(
@@ -520,19 +520,19 @@  discard block
 block discarded – undo
520 520
 
521 521
 		if ( $this->is_current_version( $transient ) ) {
522 522
 			// Make sure it doesn't show there is an update if plugin is up-to-date.
523
-			if ( isset( $transient->response[ $this->plugin_folder ] ) ) {
524
-				unset( $transient->response[ $this->plugin_folder ] );
523
+			if ( isset( $transient->response[$this->plugin_folder] ) ) {
524
+				unset( $transient->response[$this->plugin_folder] );
525 525
 			}
526
-		} elseif ( isset( $transient->response ) && isset( $transient->response[ $this->plugin_folder ] ) ) {
527
-			$this->prepare_update_details( $transient->response[ $this->plugin_folder ] );
526
+		} elseif ( isset( $transient->response ) && isset( $transient->response[$this->plugin_folder] ) ) {
527
+			$this->prepare_update_details( $transient->response[$this->plugin_folder] );
528 528
 
529 529
 			// if the transient has expired, clear the update and trigger it again
530
-			if ( $transient->response[ $this->plugin_folder ] === false ) {
530
+			if ( $transient->response[$this->plugin_folder] === false ) {
531 531
 				if ( ! $this->has_been_cleared() ) {
532 532
 					$this->cleared_plugins();
533 533
 					$this->manually_queue_update();
534 534
 				}
535
-				unset( $transient->response[ $this->plugin_folder ] );
535
+				unset( $transient->response[$this->plugin_folder] );
536 536
 			}
537 537
 		}
538 538
 
@@ -645,7 +645,7 @@  discard block
 block discarded – undo
645 645
 	 * @return bool
646 646
 	 */
647 647
 	private function is_current_version( $transient ) {
648
-		if ( empty( $transient->checked ) || ! isset( $transient->checked[ $this->plugin_folder ] ) ) {
648
+		if ( empty( $transient->checked ) || ! isset( $transient->checked[$this->plugin_folder] ) ) {
649 649
 			return false;
650 650
 		}
651 651
 
@@ -655,7 +655,7 @@  discard block
 block discarded – undo
655 655
 			return true;
656 656
 		}
657 657
 
658
-		return isset( $transient->response ) && isset( $transient->response[ $this->plugin_folder ] ) && $transient->checked[ $this->plugin_folder ] === $transient->response[ $this->plugin_folder ]->new_version;
658
+		return isset( $transient->response ) && isset( $transient->response[$this->plugin_folder] ) && $transient->checked[$this->plugin_folder] === $transient->response[$this->plugin_folder]->new_version;
659 659
 	}
660 660
 
661 661
 	/**
@@ -826,8 +826,8 @@  discard block
 block discarded – undo
826 826
 		} else {
827 827
 			$messages = $this->get_messages();
828 828
 
829
-			if ( is_string( $response['status'] ) && isset( $messages[ $response['status'] ] ) ) {
830
-				$response['message'] = $messages[ $response['status'] ];
829
+			if ( is_string( $response['status'] ) && isset( $messages[$response['status']] ) ) {
830
+				$response['message'] = $messages[$response['status']];
831 831
 			} else {
832 832
 				$response['message'] = FrmAppHelper::kses( $response['status'], array( 'a' ) );
833 833
 			}
@@ -1010,7 +1010,7 @@  discard block
 block discarded – undo
1010 1010
 			'user-agent' => $this->plugin_slug . '/' . $this->version . '; ' . get_bloginfo( 'url' ),
1011 1011
 		);
1012 1012
 
1013
-		$resp              = wp_remote_post(
1013
+		$resp = wp_remote_post(
1014 1014
 			$this->store_url . '?l=' . urlencode( base64_encode( $this->license ) ),
1015 1015
 			$arg_array
1016 1016
 		);
Please login to merge, or discard this patch.
classes/helpers/FrmFieldsHelper.php 2 patches
Braces   +8 added lines, -4 removed lines patch added patch discarded remove patch
@@ -231,7 +231,8 @@  discard block
 block discarded – undo
231 231
 				return false;
232 232
 			}
233 233
 
234
-			if ( ! $_POST || ! isset( $_POST['field_options'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
234
+			if ( ! $_POST || ! isset( $_POST['field_options'] ) ) {
235
+// phpcs:ignore WordPress.Security.NonceVerification.Missing
235 236
 				return false;
236 237
 			}
237 238
 
@@ -338,7 +339,8 @@  discard block
 block discarded – undo
338 339
 	 * @return void
339 340
 	 */
340 341
 	private static function get_posted_field_setting( $setting, &$value ) {
341
-		if ( ! isset( $_POST['field_options'][ $setting ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
342
+		if ( ! isset( $_POST['field_options'][ $setting ] ) ) {
343
+// phpcs:ignore WordPress.Security.NonceVerification.Missing
342 344
 			return;
343 345
 		}
344 346
 
@@ -1531,7 +1533,8 @@  discard block
 block discarded – undo
1531 1533
 
1532 1534
 		// Check posted vals before checking saved values
1533 1535
 		// For fields inside repeating sections - note, don't check if $pointer is true because it will often be zero
1534
-		if ( $parent && isset( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
1536
+		if ( $parent && isset( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ] ) ) {
1537
+// phpcs:ignore WordPress.Security.NonceVerification.Missing
1535 1538
 			if ( FrmField::is_field_with_multiple_values( $field ) ) {
1536 1539
 				// phpcs:ignore WordPress.Security.NonceVerification.Missing
1537 1540
 				$other_val = isset( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ][ $opt_key ] ) ? sanitize_text_field( wp_unslash( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ][ $opt_key ] ) ) : '';
@@ -1542,7 +1545,8 @@  discard block
 block discarded – undo
1542 1545
 			return $other_val;
1543 1546
 		}
1544 1547
 
1545
-		if ( isset( $field['id'] ) && isset( $_POST['item_meta']['other'][ $field['id'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
1548
+		if ( isset( $field['id'] ) && isset( $_POST['item_meta']['other'][ $field['id'] ] ) ) {
1549
+// phpcs:ignore WordPress.Security.NonceVerification.Missing
1546 1550
 			// For normal fields
1547 1551
 
1548 1552
 			if ( FrmField::is_field_with_multiple_values( $field ) ) {
Please login to merge, or discard this patch.
Spacing   +50 added lines, -50 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 			if ( in_array( $type, array( 'data', 'lookup' ), true ) ) {
45 45
 				$values['field_options']['data_type'] = $setting;
46 46
 			} else {
47
-				$values['field_options'][ $setting ] = 1;
47
+				$values['field_options'][$setting] = 1;
48 48
 			}
49 49
 		}
50 50
 
@@ -209,10 +209,10 @@  discard block
 block discarded – undo
209 209
 		}
210 210
 
211 211
 		foreach ( $defaults as $opt => $default ) {
212
-			$values[ $opt ] = $field->field_options[ $opt ] ?? $default;
212
+			$values[$opt] = $field->field_options[$opt] ?? $default;
213 213
 
214 214
 			if ( $check_post ) {
215
-				self::get_posted_field_setting( $opt . '_' . $field->id, $values[ $opt ] );
215
+				self::get_posted_field_setting( $opt . '_' . $field->id, $values[$opt] );
216 216
 			}
217 217
 		}
218 218
 	}
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
 			return self::$context_is_safe_to_load_field_options_from_request_data;
230 230
 		}
231 231
 
232
-		$function = function () {
232
+		$function = function() {
233 233
 			if ( ! FrmAppHelper::is_admin_page() ) {
234 234
 				return false;
235 235
 			}
@@ -343,12 +343,12 @@  discard block
 block discarded – undo
343 343
 	 * @return void
344 344
 	 */
345 345
 	private static function get_posted_field_setting( $setting, &$value ) {
346
-		if ( ! isset( $_POST['field_options'][ $setting ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
346
+		if ( ! isset( $_POST['field_options'][$setting] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
347 347
 			return;
348 348
 		}
349 349
 
350 350
 		if ( strpos( $setting, 'html' ) !== false ) {
351
-			$value = wp_unslash( $_POST['field_options'][ $setting ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
351
+			$value = wp_unslash( $_POST['field_options'][$setting] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
352 352
 
353 353
 			// Conditionally strip script tags if the user sending $_POST data is not allowed to use unfiltered HTML.
354 354
 			if ( ! FrmAppHelper::allow_unfiltered_html() ) {
@@ -356,9 +356,9 @@  discard block
 block discarded – undo
356 356
 			}
357 357
 		} elseif ( strpos( $setting, 'format_' ) === 0 ) {
358 358
 			// TODO: Remove stripslashes on output, and use on input only.
359
-			$value = sanitize_text_field( $_POST['field_options'][ $setting ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.NonceVerification.Missing
359
+			$value = sanitize_text_field( $_POST['field_options'][$setting] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.NonceVerification.Missing
360 360
 		} else {
361
-			$value = wp_unslash( $_POST['field_options'][ $setting ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
361
+			$value = wp_unslash( $_POST['field_options'][$setting] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
362 362
 			FrmAppHelper::sanitize_value( 'wp_kses_post', $value );
363 363
 		}
364 364
 	}
@@ -442,7 +442,7 @@  discard block
 block discarded – undo
442 442
 		$values['default_value'] = FrmAppHelper::maybe_json_encode( $field->default_value );
443 443
 
444 444
 		foreach ( array( 'name', 'description', 'type', 'field_order', 'field_options', 'required' ) as $col ) {
445
-			$values[ $col ] = $field->{$col};
445
+			$values[$col] = $field->{$col};
446 446
 		}
447 447
 	}
448 448
 
@@ -480,7 +480,7 @@  discard block
 block discarded – undo
480 480
 		);
481 481
 
482 482
 		$msg = FrmField::get_option( $field, $error );
483
-		$msg = empty( $msg ) ? $defaults[ $error ]['part'] : $msg;
483
+		$msg = empty( $msg ) ? $defaults[$error]['part'] : $msg;
484 484
 		$msg = do_shortcode( $msg );
485 485
 
486 486
 		$msg = self::maybe_replace_substrings_with_field_name( $msg, $error, $field );
@@ -817,7 +817,7 @@  discard block
 block discarded – undo
817 817
 			'inside_class' => 'inside',
818 818
 			'dismiss-icon' => true,
819 819
 		);
820
-		$args     = array_merge( $defaults, $args );
820
+		$args = array_merge( $defaults, $args );
821 821
 
822 822
 		include FrmAppHelper::plugin_path() . '/classes/views/frm-fields/back-end/inline-modal.php';
823 823
 	}
@@ -1108,7 +1108,7 @@  discard block
 block discarded – undo
1108 1108
 				continue;
1109 1109
 			}
1110 1110
 
1111
-			$atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[3][ $short_key ] );
1111
+			$atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[3][$short_key] );
1112 1112
 			$tag  = FrmShortcodeHelper::get_shortcode_tag( $shortcodes, $short_key );
1113 1113
 
1114 1114
 			$atts['entry'] = $entry;
@@ -1118,7 +1118,7 @@  discard block
 block discarded – undo
1118 1118
 			if ( $replace_with !== null ) {
1119 1119
 				$replace_with = self::trigger_shortcode_atts( $replace_with, $atts );
1120 1120
 				self::sanitize_embedded_shortcodes( compact( 'entry' ), $replace_with );
1121
-				$content = str_replace( $shortcodes[0][ $short_key ], $replace_with, $content );
1121
+				$content = str_replace( $shortcodes[0][$short_key], $replace_with, $content );
1122 1122
 			}
1123 1123
 
1124 1124
 			unset( $atts, $replace_with );
@@ -1138,7 +1138,7 @@  discard block
 block discarded – undo
1138 1138
 		$included_atts  = array_intersect( $supported_atts, array_keys( $atts ) );
1139 1139
 
1140 1140
 		foreach ( $included_atts as $included_att ) {
1141
-			if ( '0' === $atts[ $included_att ] ) {
1141
+			if ( '0' === $atts[$included_att] ) {
1142 1142
 				// Skip any option that uses 0 so sanitize_url=0 does not encode.
1143 1143
 				continue;
1144 1144
 			}
@@ -1221,8 +1221,8 @@  discard block
 block discarded – undo
1221 1221
 
1222 1222
 		$dynamic_default = array( 'admin_email', 'siteurl', 'frmurl', 'sitename', 'get', 'default-email', 'default-from-email' );
1223 1223
 
1224
-		if ( isset( $shortcode_values[ $atts['tag'] ] ) ) {
1225
-			$replace_with = $shortcode_values[ $atts['tag'] ];
1224
+		if ( isset( $shortcode_values[$atts['tag']] ) ) {
1225
+			$replace_with = $shortcode_values[$atts['tag']];
1226 1226
 		} elseif ( in_array( $atts['tag'], $dynamic_default, true ) ) {
1227 1227
 			$replace_with = self::dynamic_default_values( $atts['tag'], $atts );
1228 1228
 		} elseif ( $clean_tag === 'user_agent' ) {
@@ -1471,8 +1471,8 @@  discard block
 block discarded – undo
1471 1471
 			self::field_types_for_input( $single_input, $field_selection, $field_types );
1472 1472
 		} elseif ( in_array( $type, $multiple_input, true ) ) {
1473 1473
 			self::field_types_for_input( $multiple_input, $field_selection, $field_types );
1474
-		} elseif ( isset( $field_selection[ $type ] ) ) {
1475
-			$field_types[ $type ] = $field_selection[ $type ];
1474
+		} elseif ( isset( $field_selection[$type] ) ) {
1475
+			$field_types[$type] = $field_selection[$type];
1476 1476
 		}
1477 1477
 
1478 1478
 		$field_types = apply_filters( 'frm_switch_field_types', $field_types, compact( 'type', 'field_selection' ) );
@@ -1517,7 +1517,7 @@  discard block
 block discarded – undo
1517 1517
 		foreach ( $inputs as $input ) {
1518 1518
 			// This may not be set if a field type was removed using the frm_available_fields or frm_pro_available_fields filters.
1519 1519
 			if ( array_key_exists( $input, $fields ) ) {
1520
-				$field_types[ $input ] = $fields[ $input ];
1520
+				$field_types[$input] = $fields[$input];
1521 1521
 			}
1522 1522
 			unset( $input );
1523 1523
 		}
@@ -1552,7 +1552,7 @@  discard block
 block discarded – undo
1552 1552
 			'parent'  => false,
1553 1553
 			'pointer' => false,
1554 1554
 		);
1555
-		$args     = wp_parse_args( $args, $defaults );
1555
+		$args = wp_parse_args( $args, $defaults );
1556 1556
 
1557 1557
 		$opt_key   = $args['opt_key'];
1558 1558
 		$field     = $args['field'];
@@ -1568,25 +1568,25 @@  discard block
 block discarded – undo
1568 1568
 
1569 1569
 		// Check posted vals before checking saved values
1570 1570
 		// For fields inside repeating sections - note, don't check if $pointer is true because it will often be zero
1571
-		if ( $parent && isset( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
1571
+		if ( $parent && isset( $_POST['item_meta'][$parent][$pointer]['other'][$field['id']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
1572 1572
 			if ( FrmField::is_field_with_multiple_values( $field ) ) {
1573 1573
 				// phpcs:ignore WordPress.Security.NonceVerification.Missing
1574
-				$other_val = isset( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ][ $opt_key ] ) ? sanitize_text_field( wp_unslash( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ][ $opt_key ] ) ) : '';
1574
+				$other_val = isset( $_POST['item_meta'][$parent][$pointer]['other'][$field['id']][$opt_key] ) ? sanitize_text_field( wp_unslash( $_POST['item_meta'][$parent][$pointer]['other'][$field['id']][$opt_key] ) ) : '';
1575 1575
 			} else {
1576
-				$other_val = sanitize_text_field( wp_unslash( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing
1576
+				$other_val = sanitize_text_field( wp_unslash( $_POST['item_meta'][$parent][$pointer]['other'][$field['id']] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing
1577 1577
 			}
1578 1578
 
1579 1579
 			return $other_val;
1580 1580
 		}
1581 1581
 
1582
-		if ( isset( $field['id'] ) && isset( $_POST['item_meta']['other'][ $field['id'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
1582
+		if ( isset( $field['id'] ) && isset( $_POST['item_meta']['other'][$field['id']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
1583 1583
 			// For normal fields
1584 1584
 
1585 1585
 			if ( FrmField::is_field_with_multiple_values( $field ) ) {
1586 1586
 				// phpcs:ignore WordPress.Security.NonceVerification.Missing
1587
-				$other_val = isset( $_POST['item_meta']['other'][ $field['id'] ][ $opt_key ] ) ? sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][ $field['id'] ][ $opt_key ] ) ) : '';
1587
+				$other_val = isset( $_POST['item_meta']['other'][$field['id']][$opt_key] ) ? sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][$field['id']][$opt_key] ) ) : '';
1588 1588
 			} else {
1589
-				$other_val = sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][ $field['id'] ] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing
1589
+				$other_val = sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][$field['id']] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing
1590 1590
 			}
1591 1591
 
1592 1592
 			return $other_val;
@@ -1596,8 +1596,8 @@  discard block
 block discarded – undo
1596 1596
 		if ( $field['type'] === 'checkbox' && is_array( $field['value'] ) ) {
1597 1597
 			// Check if there is an "other" val in saved value and make sure the
1598 1598
 			// "other" val is not equal to the Other checkbox option
1599
-			if ( isset( $field['value'][ $opt_key ] ) && $field['options'][ $opt_key ] != $field['value'][ $opt_key ] ) {
1600
-				$other_val = $field['value'][ $opt_key ];
1599
+			if ( isset( $field['value'][$opt_key] ) && $field['options'][$opt_key] != $field['value'][$opt_key] ) {
1600
+				$other_val = $field['value'][$opt_key];
1601 1601
 			}
1602 1602
 		} else {
1603 1603
 			/**
@@ -1611,8 +1611,8 @@  discard block
 block discarded – undo
1611 1611
 				if ( is_array( $field['value'] ) ) {
1612 1612
 					$o_key = array_search( $temp_val, $field['value'] );
1613 1613
 
1614
-					if ( isset( $field['value'][ $o_key ] ) ) {
1615
-						unset( $field['value'][ $o_key ], $o_key );
1614
+					if ( isset( $field['value'][$o_key] ) ) {
1615
+						unset( $field['value'][$o_key], $o_key );
1616 1616
 					}
1617 1617
 				} elseif ( $temp_val == $field['value'] ) {
1618 1618
 					// For radio and regular dropdowns
@@ -1842,11 +1842,11 @@  discard block
 block discarded – undo
1842 1842
 			foreach ( $val as $k => $v ) {
1843 1843
 				if ( is_string( $v ) ) {
1844 1844
 					if ( 'custom_html' === $k ) {
1845
-						$val[ $k ] = self::switch_ids_except_strings( $replace, $replace_with, array( '[if description]', '[description]', '[/if description]' ), $v );
1845
+						$val[$k] = self::switch_ids_except_strings( $replace, $replace_with, array( '[if description]', '[description]', '[/if description]' ), $v );
1846 1846
 						unset( $k, $v );
1847 1847
 						continue;
1848 1848
 					}
1849
-					$val[ $k ] = str_replace( $replace, $replace_with, $v );
1849
+					$val[$k] = str_replace( $replace, $replace_with, $v );
1850 1850
 					unset( $k, $v );
1851 1851
 				}
1852 1852
 			}
@@ -1876,8 +1876,8 @@  discard block
 block discarded – undo
1876 1876
 			if ( false === $index ) {
1877 1877
 				continue;
1878 1878
 			}
1879
-			unset( $replace[ $index ] );
1880
-			unset( $replace_with[ $index ] );
1879
+			unset( $replace[$index] );
1880
+			unset( $replace_with[$index] );
1881 1881
 		}
1882 1882
 
1883 1883
 		$value = str_replace( $replace, $replace_with, $value );
@@ -2237,7 +2237,7 @@  discard block
 block discarded – undo
2237 2237
 			$countries['class'] = 'frm-countries-opts';
2238 2238
 		}
2239 2239
 
2240
-		$prepop[ __( 'Countries', 'formidable' ) ] = $countries;
2240
+		$prepop[__( 'Countries', 'formidable' )] = $countries;
2241 2241
 
2242 2242
 		// State abv.
2243 2243
 		$states    = self::get_us_states();
@@ -2248,7 +2248,7 @@  discard block
 block discarded – undo
2248 2248
 			$state_abv['class'] = 'frm-state-abv-opts';
2249 2249
 		}
2250 2250
 
2251
-		$prepop[ __( 'U.S. State Abbreviations', 'formidable' ) ] = $state_abv;
2251
+		$prepop[__( 'U.S. State Abbreviations', 'formidable' )] = $state_abv;
2252 2252
 
2253 2253
 		// States.
2254 2254
 		$states = array_values( $states );
@@ -2258,7 +2258,7 @@  discard block
 block discarded – undo
2258 2258
 			$states['class'] = 'frm-states-opts';
2259 2259
 		}
2260 2260
 
2261
-		$prepop[ __( 'U.S. States', 'formidable' ) ] = $states;
2261
+		$prepop[__( 'U.S. States', 'formidable' )] = $states;
2262 2262
 		unset( $state_abv, $states );
2263 2263
 
2264 2264
 		// Age.
@@ -2277,7 +2277,7 @@  discard block
 block discarded – undo
2277 2277
 			$ages['class'] = 'frm-age-opts';
2278 2278
 		}
2279 2279
 
2280
-		$prepop[ __( 'Age', 'formidable' ) ] = $ages;
2280
+		$prepop[__( 'Age', 'formidable' )] = $ages;
2281 2281
 
2282 2282
 		// Satisfaction.
2283 2283
 		$satisfaction = array(
@@ -2293,7 +2293,7 @@  discard block
 block discarded – undo
2293 2293
 			$satisfaction['class'] = 'frm-satisfaction-opts';
2294 2294
 		}
2295 2295
 
2296
-		$prepop[ __( 'Satisfaction', 'formidable' ) ] = $satisfaction;
2296
+		$prepop[__( 'Satisfaction', 'formidable' )] = $satisfaction;
2297 2297
 
2298 2298
 		// Importance.
2299 2299
 		$importance = array(
@@ -2309,7 +2309,7 @@  discard block
 block discarded – undo
2309 2309
 			$importance['class'] = 'frm-importance-opts';
2310 2310
 		}
2311 2311
 
2312
-		$prepop[ __( 'Importance', 'formidable' ) ] = $importance;
2312
+		$prepop[__( 'Importance', 'formidable' )] = $importance;
2313 2313
 
2314 2314
 		// Agreement.
2315 2315
 		$agreement = array(
@@ -2325,7 +2325,7 @@  discard block
 block discarded – undo
2325 2325
 			$agreement['class'] = 'frm-agreement-opts';
2326 2326
 		}
2327 2327
 
2328
-		$prepop[ __( 'Agreement', 'formidable' ) ] = $agreement;
2328
+		$prepop[__( 'Agreement', 'formidable' )] = $agreement;
2329 2329
 
2330 2330
 		// Likely.
2331 2331
 		$likely = array(
@@ -2341,7 +2341,7 @@  discard block
 block discarded – undo
2341 2341
 			$likely['class'] = 'frm-likely-opts';
2342 2342
 		}
2343 2343
 
2344
-		$prepop[ __( 'Likely', 'formidable' ) ] = $likely;
2344
+		$prepop[__( 'Likely', 'formidable' )] = $likely;
2345 2345
 
2346 2346
 		$prepop = apply_filters( 'frm_bulk_field_choices', $prepop );
2347 2347
 	}
@@ -2591,17 +2591,17 @@  discard block
 block discarded – undo
2591 2591
 	 */
2592 2592
 	private static function fill_image_setting_options( $options, &$args ) {
2593 2593
 		foreach ( $options as $key => $option ) {
2594
-			$args['options'][ $key ] = $option;
2594
+			$args['options'][$key] = $option;
2595 2595
 
2596 2596
 			if ( ! empty( $option['addon'] ) ) {
2597
-				$args['options'][ $key ]['custom_attrs'] = self::fill_image_setting_addon_link( $option );
2597
+				$args['options'][$key]['custom_attrs'] = self::fill_image_setting_addon_link( $option );
2598 2598
 			}
2599 2599
 
2600
-			unset( $args['options'][ $key ]['addon'] );
2600
+			unset( $args['options'][$key]['addon'] );
2601 2601
 			$fill = array( 'upgrade', 'message', 'content' );
2602 2602
 
2603 2603
 			foreach ( $fill as $f ) {
2604
-				unset( $args['options'][ $key ][ $f ], $f );
2604
+				unset( $args['options'][$key][$f], $f );
2605 2605
 			}
2606 2606
 		}
2607 2607
 	}
@@ -2625,8 +2625,8 @@  discard block
 block discarded – undo
2625 2625
 		$fill = array( 'upgrade', 'message', 'content' );
2626 2626
 
2627 2627
 		foreach ( $fill as $f ) {
2628
-			if ( isset( $option[ $f ] ) ) {
2629
-				$custom_attrs[ 'data-' . $f ] = $option[ $f ];
2628
+			if ( isset( $option[$f] ) ) {
2629
+				$custom_attrs['data-' . $f] = $option[$f];
2630 2630
 			}
2631 2631
 		}
2632 2632
 
@@ -2695,7 +2695,7 @@  discard block
 block discarded – undo
2695 2695
 
2696 2696
 		return array_filter(
2697 2697
 			$rows,
2698
-			function ( $row ) {
2698
+			function( $row ) {
2699 2699
 				FrmAppHelper::unserialize_or_decode( $row->field_options );
2700 2700
 				return is_array( $row->field_options ) && ! empty( $row->field_options['draft'] );
2701 2701
 			}
@@ -2762,7 +2762,7 @@  discard block
 block discarded – undo
2762 2762
 			unset( $data['plugin-status'] );
2763 2763
 
2764 2764
 			foreach ( $data as $key => $value ) {
2765
-				$attributes[ 'data-' . $key ] = $value;
2765
+				$attributes['data-' . $key] = $value;
2766 2766
 			}
2767 2767
 		}
2768 2768
 
Please login to merge, or discard this patch.
classes/models/FrmFieldFormHtml.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -46,8 +46,8 @@  discard block
 block discarded – undo
46 46
 	 * @return void
47 47
 	 */
48 48
 	private function _set( $param, $atts ) {
49
-		if ( isset( $atts[ $param ] ) ) {
50
-			$this->{$param} = $atts[ $param ];
49
+		if ( isset( $atts[$param] ) ) {
50
+			$this->{$param} = $atts[$param];
51 51
 		}
52 52
 	}
53 53
 
@@ -97,8 +97,8 @@  discard block
 block discarded – undo
97 97
 
98 98
 		$exclude = array( 'field_obj', 'html' );
99 99
 		foreach ( $exclude as $ex ) {
100
-			if ( isset( $atts[ $ex ] ) ) {
101
-				unset( $this->pass_args[ $ex ] );
100
+			if ( isset( $atts[$ex] ) ) {
101
+				unset( $this->pass_args[$ex] );
102 102
 			}
103 103
 		}
104 104
 	}
@@ -112,8 +112,8 @@  discard block
 block discarded – undo
112 112
 	 * @return void
113 113
 	 */
114 114
 	private function set_from_field( $atts, $set ) {
115
-		if ( isset( $atts[ $set['param'] ] ) ) {
116
-			$this->{$set['param']} = $atts[ $set['param'] ];
115
+		if ( isset( $atts[$set['param']] ) ) {
116
+			$this->{$set['param']} = $atts[$set['param']];
117 117
 		} else {
118 118
 			$this->{$set['param']} = $this->field_obj->get_field_column( $set['default'] );
119 119
 		}
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
 	 */
265 265
 	private function replace_error_shortcode() {
266 266
 		$this->maybe_add_error_id();
267
-		$error = $this->pass_args['errors'][ 'field' . $this->field_id ] ?? false;
267
+		$error = $this->pass_args['errors']['field' . $this->field_id] ?? false;
268 268
 
269 269
 		if ( ! empty( $error ) && false === strpos( $this->html, 'role="alert"' ) && FrmAppHelper::should_include_alert_role_on_field_errors() ) {
270 270
 			$error_body = self::get_error_body( $this->html );
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
 	 * @return void
308 308
 	 */
309 309
 	private function maybe_add_error_id() {
310
-		if ( ! isset( $this->pass_args['errors'][ 'field' . $this->field_id ] ) ) {
310
+		if ( ! isset( $this->pass_args['errors']['field' . $this->field_id] ) ) {
311 311
 			return;
312 312
 		}
313 313
 
@@ -399,7 +399,7 @@  discard block
 block discarded – undo
399 399
 		preg_match_all( "/\[(input|deletelink)\b(.*?)(?:(\/))?\]/s", $this->html, $shortcodes, PREG_PATTERN_ORDER );
400 400
 
401 401
 		foreach ( $shortcodes[0] as $short_key => $tag ) {
402
-			$shortcode_atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[2][ $short_key ] );
402
+			$shortcode_atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[2][$short_key] );
403 403
 			$tag            = FrmShortcodeHelper::get_shortcode_tag( $shortcodes, $short_key );
404 404
 
405 405
 			$replace_with = '';
@@ -410,7 +410,7 @@  discard block
 block discarded – undo
410 410
 				$replace_with = $this->replace_input_shortcode( $shortcode_atts );
411 411
 			}
412 412
 
413
-			$this->html = str_replace( $shortcodes[0][ $short_key ], $replace_with, $this->html );
413
+			$this->html = str_replace( $shortcodes[0][$short_key], $replace_with, $this->html );
414 414
 		}
415 415
 	}
416 416
 
@@ -432,7 +432,7 @@  discard block
 block discarded – undo
432 432
 	 */
433 433
 	private function prepare_input_shortcode_atts( $shortcode_atts ) {
434 434
 		if ( isset( $shortcode_atts['opt'] ) ) {
435
-			--$shortcode_atts['opt'];
435
+			-- $shortcode_atts['opt'];
436 436
 		}
437 437
 
438 438
 		$field_class = $shortcode_atts['class'] ?? '';
@@ -502,7 +502,7 @@  discard block
 block discarded – undo
502 502
 	 */
503 503
 	private function get_field_div_classes() {
504 504
 		// Add error class
505
-		$classes = isset( $this->pass_args['errors'][ 'field' . $this->field_id ] ) ? ' frm_blank_field' : '';
505
+		$classes = isset( $this->pass_args['errors']['field' . $this->field_id] ) ? ' frm_blank_field' : '';
506 506
 
507 507
 		// Add label position class
508 508
 		$settings = $this->field_obj->display_field_settings();
@@ -583,7 +583,7 @@  discard block
 block discarded – undo
583 583
 		}
584 584
 
585 585
 		// Add 'aria-invalid' attribute to the group if there are errors.
586
-		if ( isset( $this->pass_args['errors'][ 'field' . $this->field_id ] ) ) {
586
+		if ( isset( $this->pass_args['errors']['field' . $this->field_id] ) ) {
587 587
 			$attributes['aria-invalid'] = 'true';
588 588
 		}
589 589
 
Please login to merge, or discard this patch.
classes/models/FrmEntryFormatter.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -169,8 +169,8 @@  discard block
 block discarded – undo
169 169
 
170 170
 		$conditionally_add = array( 'include_fields', 'fields', 'exclude_fields', 'entry' );
171 171
 		foreach ( $conditionally_add as $index ) {
172
-			if ( isset( $atts[ $index ] ) ) {
173
-				$entry_atts[ $index ] = $atts[ $index ];
172
+			if ( isset( $atts[$index] ) ) {
173
+				$entry_atts[$index] = $atts[$index];
174 174
 			}
175 175
 		}
176 176
 
@@ -376,8 +376,8 @@  discard block
 block discarded – undo
376 376
 
377 377
 		$unset = array( 'id', 'form_id', 'format' );
378 378
 		foreach ( $unset as $param ) {
379
-			if ( isset( $atts[ $param ] ) ) {
380
-				unset( $atts[ $param ] );
379
+			if ( isset( $atts[$param] ) ) {
380
+				unset( $atts[$param] );
381 381
 			}
382 382
 		}
383 383
 
@@ -553,11 +553,11 @@  discard block
 block discarded – undo
553 553
 
554 554
 			$displayed_value = $this->prepare_display_value_for_array( $field_value->get_displayed_value() );
555 555
 
556
-			$output[ $this->get_key_or_id( $field_value ) ] = $displayed_value;
556
+			$output[$this->get_key_or_id( $field_value )] = $displayed_value;
557 557
 
558 558
 			$has_separate_value = (bool) $field_value->get_field_option( 'separate_value' );
559 559
 			if ( $has_separate_value || $displayed_value !== $field_value->get_saved_value() ) {
560
-				$output[ $this->get_key_or_id( $field_value ) . '-value' ] = $field_value->get_saved_value();
560
+				$output[$this->get_key_or_id( $field_value ) . '-value'] = $field_value->get_saved_value();
561 561
 			}
562 562
 		}
563 563
 	}
@@ -975,7 +975,7 @@  discard block
 block discarded – undo
975 975
 		if ( $this->is_plain_text ) {
976 976
 			if ( is_array( $value ) ) {
977 977
 				foreach ( $value as $key => $single_value ) {
978
-					$value[ $key ] = $this->strip_html( $single_value );
978
+					$value[$key] = $this->strip_html( $single_value );
979 979
 				}
980 980
 			} elseif ( $this->is_plain_text && ! is_array( $value ) ) {
981 981
 				if ( strpos( $value, '<img' ) !== false ) {
Please login to merge, or discard this patch.
classes/models/FrmCreateFile.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -33,12 +33,12 @@
 block discarded – undo
33 33
 	/**
34 34
 	 * @var int
35 35
 	 */
36
-	public $chmod_dir       = 0755;
36
+	public $chmod_dir = 0755;
37 37
 
38 38
 	/**
39 39
 	 * @var int
40 40
 	 */
41
-	public $chmod_file      = 0644;
41
+	public $chmod_file = 0644;
42 42
 
43 43
 	/**
44 44
 	 * @var bool
Please login to merge, or discard this patch.
classes/helpers/FrmTipsHelper.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 			'page'  => '',
46 46
 			'class' => 'frm-mt-0',
47 47
 		);
48
-		$tip      = array_merge( $defaults, $tip );
48
+		$tip = array_merge( $defaults, $tip );
49 49
 
50 50
 		if ( isset( $tip['link'] ) && ! isset( $tip['link']['medium'] ) ) {
51 51
 			$tip['link']['medium'] = 'tip';
@@ -402,7 +402,7 @@  discard block
 block discarded – undo
402 402
 		}
403 403
 
404 404
 		$random = random_int( 0, $count - 1 );
405
-		return $tips[ $random ];
405
+		return $tips[$random];
406 406
 	}
407 407
 
408 408
 	/**
Please login to merge, or discard this patch.
stripe/controllers/FrmStrpLiteAppController.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -152,13 +152,13 @@  discard block
 block discarded – undo
152 152
 
153 153
 		$is_setup_intent = 0 === strpos( $intent->id, 'seti_' );
154 154
 		if ( $is_setup_intent ) {
155
-			$errors[ 'field' . $cc_field_id ] = is_object( $intent->last_setup_error ) ? $intent->last_setup_error->message : '';
155
+			$errors['field' . $cc_field_id] = is_object( $intent->last_setup_error ) ? $intent->last_setup_error->message : '';
156 156
 		} else {
157
-			$errors[ 'field' . $cc_field_id ] = is_object( $intent->last_payment_error ) ? $intent->last_payment_error->message : '';
157
+			$errors['field' . $cc_field_id] = is_object( $intent->last_payment_error ) ? $intent->last_payment_error->message : '';
158 158
 		}
159 159
 
160
-		if ( ! $errors[ 'field' . $cc_field_id ] ) {
161
-			$errors[ 'field' . $cc_field_id ] = 'Payment was not successfully processed.';
160
+		if ( ! $errors['field' . $cc_field_id] ) {
161
+			$errors['field' . $cc_field_id] = 'Payment was not successfully processed.';
162 162
 		}
163 163
 
164 164
 		global $frm_vars;
@@ -187,10 +187,10 @@  discard block
 block discarded – undo
187 187
 		$save_draft = ! empty( $form->options['save_draft'] );
188 188
 
189 189
 		global $frm_vars;
190
-		$frm_vars['created_entries'][ $form_id ]['errors'] = $errors;
190
+		$frm_vars['created_entries'][$form_id]['errors'] = $errors;
191 191
 
192 192
 		// Set to true to get FrmProFieldsHelper::get_page_with_error() run.
193
-		$_POST[ 'frm_page_order_' . $form_id ] = true;
193
+		$_POST['frm_page_order_' . $form_id] = true;
194 194
 
195 195
 		if ( ! $save_draft ) {
196 196
 			// If draft saving is not on, delete the entry.
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
 		}
200 200
 
201 201
 		// If draft saving is on, load the draft entry.
202
-		$frm_vars['created_entries'][ $form_id ]['entry_id'] = $entry_id;
202
+		$frm_vars['created_entries'][$form_id]['entry_id'] = $entry_id;
203 203
 		add_action(
204 204
 			'frm_filter_final_form',
205 205
 			/**
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
 			 *
211 211
 			 * @return string
212 212
 			 */
213
-			function ( $html ) use ( $entry_id ) {
213
+			function( $html ) use ( $entry_id ) {
214 214
 				global $wpdb;
215 215
 				$wpdb->update( $wpdb->prefix . 'frm_items', array( 'is_draft' => 1 ), array( 'id' => $entry_id ) );
216 216
 				return $html;
Please login to merge, or discard this patch.
stripe/controllers/FrmStrpLiteSettingsController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
 			 *
27 27
 			 * @return void
28 28
 			 */
29
-			function ( $frm_settings ) {
29
+			function( $frm_settings ) {
30 30
 				$stripe_settings = FrmStrpLiteAppHelper::get_settings()->settings;
31 31
 				require FrmStrpLiteAppHelper::plugin_path() . '/views/settings/messages.php';
32 32
 			}
Please login to merge, or discard this patch.