Completed
Pull Request — master (#2513)
by
unknown
47s
created
classes/helpers/FrmListHelper.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -224,8 +224,8 @@  discard block
 block discarded – undo
224 224
 			return $this->get_pagenum();
225 225
 		}
226 226
 
227
-		if ( isset( $this->_pagination_args[ $key ] ) ) {
228
-			return $this->_pagination_args[ $key ];
227
+		if ( isset( $this->_pagination_args[$key] ) ) {
228
+			return $this->_pagination_args[$key];
229 229
 		}
230 230
 	}
231 231
 
@@ -270,8 +270,8 @@  discard block
 block discarded – undo
270 270
 	}
271 271
 
272 272
 	private function hidden_search_inputs( $param_name ) {
273
-		if ( ! empty( $_REQUEST[ $param_name ] ) ) {
274
-			$value = sanitize_text_field( wp_unslash( $_REQUEST[ $param_name ] ) );
273
+		if ( ! empty( $_REQUEST[$param_name] ) ) {
274
+			$value = sanitize_text_field( wp_unslash( $_REQUEST[$param_name] ) );
275 275
 			echo '<input type="hidden" name="' . esc_attr( $param_name ) . '" value="' . esc_attr( $value ) . '" />';
276 276
 		}
277 277
 	}
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
 
314 314
 		echo "<ul class='subsubsub'>\n";
315 315
 		foreach ( $views as $class => $view ) {
316
-			$views[ $class ] = "\t" . '<li class="' . esc_attr( $class ) . '">' . $view;
316
+			$views[$class] = "\t" . '<li class="' . esc_attr( $class ) . '">' . $view;
317 317
 		}
318 318
 		echo implode( " |</li>\n", $views ) . "</li>\n"; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
319 319
 		echo '</ul>';
@@ -474,7 +474,7 @@  discard block
 block discarded – undo
474 474
 
475 475
 		$out = '<div class="' . ( $always_visible ? 'row-actions visible' : 'row-actions' ) . '">';
476 476
 		foreach ( $actions as $action => $link ) {
477
-			++$i;
477
+			++ $i;
478 478
 			$sep  = $i === $action_count ? '' : ' | ';
479 479
 			$out .= "<span class='$action'>$link$sep</span>";
480 480
 		}
@@ -697,7 +697,7 @@  discard block
 block discarded – undo
697 697
 			'next'  => __( 'Next page', 'formidable' ),
698 698
 		);
699 699
 
700
-		return $labels[ $link ];
700
+		return $labels[$link];
701 701
 	}
702 702
 
703 703
 	private function current_url() {
@@ -787,7 +787,7 @@  discard block
 block discarded – undo
787 787
 
788 788
 		// If the primary column doesn't exist fall back to the
789 789
 		// first non-checkbox column.
790
-		if ( ! isset( $columns[ $default ] ) ) {
790
+		if ( ! isset( $columns[$default] ) ) {
791 791
 			$default = self::get_default_primary_column_name();
792 792
 		}
793 793
 
@@ -801,7 +801,7 @@  discard block
 block discarded – undo
801 801
 		 */
802 802
 		$column = apply_filters( 'list_table_primary_column', $default, $this->screen->id );
803 803
 
804
-		if ( empty( $column ) || ! isset( $columns[ $column ] ) ) {
804
+		if ( empty( $column ) || ! isset( $columns[$column] ) ) {
805 805
 			$column = $default;
806 806
 		}
807 807
 
@@ -822,7 +822,7 @@  discard block
 block discarded – undo
822 822
 			// In 4.3, we added a fourth argument for primary column.
823 823
 			$column_headers = array( array(), array(), array(), $this->get_primary_column_name() );
824 824
 			foreach ( $this->_column_headers as $key => $value ) {
825
-				$column_headers[ $key ] = $value;
825
+				$column_headers[$key] = $value;
826 826
 			}
827 827
 
828 828
 			return $column_headers;
@@ -855,7 +855,7 @@  discard block
 block discarded – undo
855 855
 				$data[1] = false;
856 856
 			}
857 857
 
858
-			$sortable[ $id ] = $data;
858
+			$sortable[$id] = $data;
859 859
 		}
860 860
 
861 861
 		$primary = $this->get_primary_column_name();
@@ -913,7 +913,7 @@  discard block
 block discarded – undo
913 913
 			static $cb_counter = 1;
914 914
 			$columns['cb']     = '<label class="screen-reader-text" for="cb-select-all-' . $cb_counter . '">' . __( 'Select All', 'formidable' ) . '</label>';
915 915
 			$columns['cb']    .= '<input id="cb-select-all-' . esc_attr( $cb_counter ) . '" type="checkbox" />';
916
-			++$cb_counter;
916
+			++ $cb_counter;
917 917
 		}
918 918
 
919 919
 		foreach ( $columns as $column_key => $column_display_name ) {
@@ -935,8 +935,8 @@  discard block
 block discarded – undo
935 935
 				$class[] = 'column-primary';
936 936
 			}
937 937
 
938
-			if ( isset( $sortable[ $column_key ] ) ) {
939
-				list( $orderby, $desc_first ) = $sortable[ $column_key ];
938
+			if ( isset( $sortable[$column_key] ) ) {
939
+				list( $orderby, $desc_first ) = $sortable[$column_key];
940 940
 
941 941
 				if ( $current_orderby == $orderby ) {
942 942
 					// The sorted column. The `aria-sort` attribute must be set only on the sorted column.
@@ -1053,7 +1053,7 @@  discard block
 block discarded – undo
1053 1053
 	 * @return bool Returns true if the setting is not set or if it is not false; otherwise, returns false.
1054 1054
 	 */
1055 1055
 	protected function should_display( $args, $settings ) {
1056
-		return ! isset( $args[ $settings ] ) || false !== $args[ $settings ];
1056
+		return ! isset( $args[$settings] ) || false !== $args[$settings];
1057 1057
 	}
1058 1058
 
1059 1059
 	/**
Please login to merge, or discard this patch.
classes/models/FrmForm.php 1 patch
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
 			}
217 217
 
218 218
 			if ( $new_val !== $value ) {
219
-				$new_values[ $key ] = $new_val;
219
+				$new_values[$key] = $new_val;
220 220
 			}
221 221
 		}//end foreach
222 222
 
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
 
254 254
 		foreach ( $values as $value_key => $value ) {
255 255
 			if ( $value_key && in_array( $value_key, $form_fields ) ) {
256
-				$new_values[ $value_key ] = $value;
256
+				$new_values[$value_key] = $value;
257 257
 			}
258 258
 		}
259 259
 
@@ -338,15 +338,15 @@  discard block
 block discarded – undo
338 338
 		$existing_keys = array_keys( $values['item_meta'] );
339 339
 		foreach ( $all_fields as $fid ) {
340 340
 			if ( ! in_array( $fid->id, $existing_keys ) && ( isset( $values['frm_fields_submitted'] ) && in_array( $fid->id, $values['frm_fields_submitted'] ) ) || isset( $values['options'] ) ) {
341
-				$values['item_meta'][ $fid->id ] = '';
341
+				$values['item_meta'][$fid->id] = '';
342 342
 			}
343
-			$field_array[ $fid->id ] = $fid;
343
+			$field_array[$fid->id] = $fid;
344 344
 		}
345 345
 		unset( $all_fields );
346 346
 
347 347
 		foreach ( $values['item_meta'] as $field_id => $default_value ) {
348
-			if ( isset( $field_array[ $field_id ] ) ) {
349
-				$field = $field_array[ $field_id ];
348
+			if ( isset( $field_array[$field_id] ) ) {
349
+				$field = $field_array[$field_id];
350 350
 			} else {
351 351
 				$field = FrmField::getOne( $field_id );
352 352
 			}
@@ -355,7 +355,7 @@  discard block
 block discarded – undo
355 355
 				continue;
356 356
 			}
357 357
 
358
-			$is_settings_page = ( isset( $values['options'] ) || isset( $values['field_options'][ 'custom_html_' . $field_id ] ) );
358
+			$is_settings_page = ( isset( $values['options'] ) || isset( $values['field_options']['custom_html_' . $field_id] ) );
359 359
 			if ( $is_settings_page ) {
360 360
 				self::get_settings_page_html( $values, $field );
361 361
 
@@ -375,22 +375,22 @@  discard block
 block discarded – undo
375 375
 			}
376 376
 
377 377
 			foreach ( $update_options as $opt => $default ) {
378
-				$field->field_options[ $opt ] = $values['field_options'][ $opt . '_' . $field_id ] ?? $default;
379
-				self::sanitize_field_opt( $opt, $field->field_options[ $opt ] );
378
+				$field->field_options[$opt] = $values['field_options'][$opt . '_' . $field_id] ?? $default;
379
+				self::sanitize_field_opt( $opt, $field->field_options[$opt] );
380 380
 			}
381 381
 
382 382
 			$field->field_options = apply_filters( 'frm_update_field_options', $field->field_options, $field, $values );
383 383
 
384 384
 			$new_field = array(
385 385
 				'field_options' => $field->field_options,
386
-				'default_value' => isset( $values[ 'default_value_' . $field_id ] ) ? FrmAppHelper::maybe_json_encode( $values[ 'default_value_' . $field_id ] ) : '',
386
+				'default_value' => isset( $values['default_value_' . $field_id] ) ? FrmAppHelper::maybe_json_encode( $values['default_value_' . $field_id] ) : '',
387 387
 			);
388 388
 
389
-			if ( ! FrmAppHelper::allow_unfiltered_html() && isset( $values['field_options'][ 'options_' . $field_id ] ) && is_array( $values['field_options'][ 'options_' . $field_id ] ) ) {
390
-				foreach ( $values['field_options'][ 'options_' . $field_id ] as $option_key => $option ) {
389
+			if ( ! FrmAppHelper::allow_unfiltered_html() && isset( $values['field_options']['options_' . $field_id] ) && is_array( $values['field_options']['options_' . $field_id] ) ) {
390
+				foreach ( $values['field_options']['options_' . $field_id] as $option_key => $option ) {
391 391
 					if ( is_array( $option ) ) {
392 392
 						foreach ( $option as $key => $item ) {
393
-							$values['field_options'][ 'options_' . $field_id ][ $option_key ][ $key ] = FrmAppHelper::kses( $item, 'all' );
393
+							$values['field_options']['options_' . $field_id][$option_key][$key] = FrmAppHelper::kses( $item, 'all' );
394 394
 						}
395 395
 					}
396 396
 				}
@@ -420,8 +420,8 @@  discard block
 block discarded – undo
420 420
 	 */
421 421
 	private static function maybe_update_max_option( $field, $values, &$new_field ) {
422 422
 		if ( $field->type === 'textarea' &&
423
-			! empty( $values['field_options'][ 'type_' . $field->id ] ) &&
424
-			in_array( $values['field_options'][ 'type_' . $field->id ], array( 'text', 'email', 'url', 'password', 'phone' ), true ) ) {
423
+			! empty( $values['field_options']['type_' . $field->id] ) &&
424
+			in_array( $values['field_options']['type_' . $field->id], array( 'text', 'email', 'url', 'password', 'phone' ), true ) ) {
425 425
 
426 426
 			$new_field['field_options']['max'] = '';
427 427
 
@@ -429,7 +429,7 @@  discard block
 block discarded – undo
429 429
 			 * Update posted field setting so that new 'max' option is displayed after form is saved and page reloads.
430 430
 			 * FrmFieldsHelper::fill_default_field_opts populates field options by calling self::get_posted_field_setting.
431 431
 			 */
432
-			$_POST['field_options'][ 'max_' . $field->id ] = '';
432
+			$_POST['field_options']['max_' . $field->id] = '';
433 433
 		}
434 434
 	}
435 435
 
@@ -511,11 +511,11 @@  discard block
 block discarded – undo
511 511
 	 * @return void
512 512
 	 */
513 513
 	private static function get_settings_page_html( $values, &$field ) {
514
-		if ( isset( $values['field_options'][ 'custom_html_' . $field->id ] ) ) {
514
+		if ( isset( $values['field_options']['custom_html_' . $field->id] ) ) {
515 515
 			$prev_opts     = array();
516 516
 			$fallback_html = $field->field_options['custom_html'] ?? FrmFieldsHelper::get_default_html( $field->type );
517 517
 
518
-			$field->field_options['custom_html'] = $values['field_options'][ 'custom_html_' . $field->id ] ?? $fallback_html;
518
+			$field->field_options['custom_html'] = $values['field_options']['custom_html_' . $field->id] ?? $fallback_html;
519 519
 		} elseif ( $field->type === 'hidden' || $field->type === 'user_id' ) {
520 520
 			$prev_opts = $field->field_options;
521 521
 		}
@@ -540,7 +540,7 @@  discard block
 block discarded – undo
540 540
 		);
541 541
 		foreach ( $field_cols as $col => $default ) {
542 542
 			$default           = $default === '' ? $field->{$col} : $default;
543
-			$new_field[ $col ] = $values['field_options'][ $col . '_' . $field->id ] ?? $default;
543
+			$new_field[$col] = $values['field_options'][$col . '_' . $field->id] ?? $default;
544 544
 		}
545 545
 
546 546
 		if ( $field->type === 'submit' && isset( $new_field['field_order'] ) && (int) $new_field['field_order'] === FrmSubmitHelper::DEFAULT_ORDER ) {
@@ -734,7 +734,7 @@  discard block
 block discarded – undo
734 734
 			if ( ! isset( $form->options['trash_time'] ) || $form->options['trash_time'] < $delete_timestamp ) {
735 735
 				self::destroy( $form->id );
736 736
 				if ( empty( $form->parent_form_id ) ) {
737
-					++$count;
737
+					++ $count;
738 738
 				}
739 739
 			}
740 740
 
@@ -961,16 +961,16 @@  discard block
 block discarded – undo
961 961
 		foreach ( $results as $row ) {
962 962
 			if ( 'trash' != $row->status ) {
963 963
 				if ( $row->is_template ) {
964
-					++$counts['template'];
964
+					++ $counts['template'];
965 965
 				} else {
966
-					++$counts['published'];
966
+					++ $counts['published'];
967 967
 				}
968 968
 			} else {
969
-				++$counts['trash'];
969
+				++ $counts['trash'];
970 970
 			}
971 971
 
972 972
 			if ( 'draft' == $row->status ) {
973
-				++$counts['draft'];
973
+				++ $counts['draft'];
974 974
 			}
975 975
 
976 976
 			unset( $row );
@@ -1011,8 +1011,8 @@  discard block
 block discarded – undo
1011 1011
 			self::maybe_get_form( $form );
1012 1012
 		}
1013 1013
 
1014
-		if ( isset( $frm_vars['form_params'] ) && is_array( $frm_vars['form_params'] ) && isset( $frm_vars['form_params'][ $form->id ] ) ) {
1015
-			return $frm_vars['form_params'][ $form->id ];
1014
+		if ( isset( $frm_vars['form_params'] ) && is_array( $frm_vars['form_params'] ) && isset( $frm_vars['form_params'][$form->id] ) ) {
1015
+			return $frm_vars['form_params'][$form->id];
1016 1016
 		}
1017 1017
 
1018 1018
 		$action_var = isset( $_REQUEST['frm_action'] ) ? 'frm_action' : 'action'; // phpcs:ignore WordPress.Security.NonceVerification.Missing
@@ -1041,15 +1041,15 @@  discard block
 block discarded – undo
1041 1041
 			// If there are two forms on the same page, make sure not to submit both.
1042 1042
 			foreach ( $default_values as $var => $default ) {
1043 1043
 				if ( $var === 'action' ) {
1044
-					$values[ $var ] = FrmAppHelper::get_param( $action_var, $default, 'get', 'sanitize_title' );
1044
+					$values[$var] = FrmAppHelper::get_param( $action_var, $default, 'get', 'sanitize_title' );
1045 1045
 				} else {
1046
-					$values[ $var ] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' );
1046
+					$values[$var] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' );
1047 1047
 				}
1048 1048
 				unset( $var, $default );
1049 1049
 			}
1050 1050
 		} else {
1051 1051
 			foreach ( $default_values as $var => $default ) {
1052
-				$values[ $var ] = $default;
1052
+				$values[$var] = $default;
1053 1053
 				unset( $var, $default );
1054 1054
 			}
1055 1055
 		}
@@ -1075,7 +1075,7 @@  discard block
 block discarded – undo
1075 1075
 			'sdir'     => '',
1076 1076
 		);
1077 1077
 		foreach ( $defaults as $var => $default ) {
1078
-			$values[ $var ] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' );
1078
+			$values[$var] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' );
1079 1079
 		}
1080 1080
 
1081 1081
 		return $values;
@@ -1103,7 +1103,7 @@  discard block
 block discarded – undo
1103 1103
 			'keep_post' => '',
1104 1104
 		);
1105 1105
 		foreach ( $defaults as $var => $default ) {
1106
-			$values[ $var ] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' );
1106
+			$values[$var] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' );
1107 1107
 		}
1108 1108
 
1109 1109
 		return $values;
@@ -1217,7 +1217,7 @@  discard block
 block discarded – undo
1217 1217
 		$form    = $atts['form'];
1218 1218
 		$default = $atts['default'] ?? '';
1219 1219
 
1220
-		return $form->options[ $atts['option'] ] ?? $default;
1220
+		return $form->options[$atts['option']] ?? $default;
1221 1221
 	}
1222 1222
 
1223 1223
 	/**
Please login to merge, or discard this patch.
classes/helpers/FrmEntriesHelper.php 2 patches
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -137,10 +137,10 @@  discard block
 block discarded – undo
137 137
 		if ( $_POST ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
138 138
 			$repeating = isset( $args['repeating'] ) && $args['repeating'];
139 139
 			if ( $repeating ) {
140
-				if ( isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
140
+				if ( isset( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']][$field->id] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
141 141
 					$value_is_posted = true;
142 142
 				}
143
-			} elseif ( isset( $_POST['item_meta'][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
143
+			} elseif ( isset( $_POST['item_meta'][$field->id] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
144 144
 				$value_is_posted = true;
145 145
 			}
146 146
 		}
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
 		preg_match_all( "/\[(default-message|default_message)\b(.*?)(?:(\/))?\]/s", $message, $shortcodes, PREG_PATTERN_ORDER );
173 173
 
174 174
 		foreach ( $shortcodes[0] as $short_key => $tag ) {
175
-			$add_atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[2][ $short_key ] );
175
+			$add_atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[2][$short_key] );
176 176
 			if ( ! empty( $add_atts ) ) {
177 177
 				$this_atts = array_merge( $atts, $add_atts );
178 178
 			} else {
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
 			$default = FrmEntriesController::show_entry_shortcode( $this_atts );
183 183
 
184 184
 			// Add the default message.
185
-			$message = str_replace( $shortcodes[0][ $short_key ], $default, $message );
185
+			$message = str_replace( $shortcodes[0][$short_key], $default, $message );
186 186
 		}
187 187
 
188 188
 		return $message;
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
 	 * @return string
196 196
 	 */
197 197
 	public static function prepare_display_value( $entry, $field, $atts ) {
198
-		$field_value = $entry->metas[ $field->id ] ?? false;
198
+		$field_value = $entry->metas[$field->id] ?? false;
199 199
 
200 200
 		if ( FrmAppHelper::pro_is_installed() ) {
201 201
 			$empty = empty( $field_value );
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
 			$child_entries = FrmEntry::getAll( array( 'it.parent_item_id' => $entry->id ), '', '', true );
224 224
 		} else {
225 225
 			// Get all values for this field.
226
-			$child_values = $entry->metas[ $atts['embedded_field_id'] ] ?? false;
226
+			$child_values = $entry->metas[$atts['embedded_field_id']] ?? false;
227 227
 
228 228
 			if ( $child_values ) {
229 229
 				$child_entries = FrmEntry::getAll( array( 'it.id' => (array) $child_values ) );
@@ -345,7 +345,7 @@  discard block
 block discarded – undo
345 345
 			$value = $args['temp_value'];
346 346
 		}
347 347
 		if ( empty( $args['parent_field_id'] ) ) {
348
-			$_POST['item_meta'][ $field->id ] = $value;
348
+			$_POST['item_meta'][$field->id] = $value;
349 349
 		} else {
350 350
 			self::set_parent_field_posted_value( $field, $value, $args );
351 351
 		}
@@ -363,17 +363,17 @@  discard block
 block discarded – undo
363 363
 	 * @return void
364 364
 	 */
365 365
 	private static function set_parent_field_posted_value( $field, $value, $args ) {
366
-		if ( isset( $_POST['item_meta'][ $args['parent_field_id'] ] ) && is_array( $_POST['item_meta'][ $args['parent_field_id'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
367
-			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
368
-				$_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing
366
+		if ( isset( $_POST['item_meta'][$args['parent_field_id']] ) && is_array( $_POST['item_meta'][$args['parent_field_id']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
367
+			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
368
+				$_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing
369 369
 			}
370 370
 		} else {
371 371
 			// All of the section was probably removed.
372
-			$_POST['item_meta'][ $args['parent_field_id'] ]                         = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing
373
-			$_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing
372
+			$_POST['item_meta'][$args['parent_field_id']]                         = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing
373
+			$_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing
374 374
 		}
375 375
 
376
-		$_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field->id ] = $value; // phpcs:ignore WordPress.Security.NonceVerification.Missing
376
+		$_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']][$field->id] = $value; // phpcs:ignore WordPress.Security.NonceVerification.Missing
377 377
 	}
378 378
 
379 379
 	public static function get_posted_value( $field, &$value, $args ) {
@@ -413,9 +413,9 @@  discard block
 block discarded – undo
413 413
 	private static function get_posted_meta( $field_id, $args ) {
414 414
 		if ( empty( $args['parent_field_id'] ) ) {
415 415
 			// Sanitizing is done next.
416
-			$value = isset( $_POST['item_meta'][ $field_id ] ) ? wp_unslash( $_POST['item_meta'][ $field_id ] ) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
416
+			$value = isset( $_POST['item_meta'][$field_id] ) ? wp_unslash( $_POST['item_meta'][$field_id] ) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
417 417
 		} else {
418
-			$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
418
+			$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
419 419
 		}
420 420
 		return $value;
421 421
 	}
@@ -446,14 +446,14 @@  discard block
 block discarded – undo
446 446
 		self::set_other_repeating_vals( $field, $value, $args );
447 447
 
448 448
 		// Check if there are any posted "Other" values.
449
-		if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta']['other'][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
449
+		if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta']['other'][$field->id] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
450 450
 
451 451
 			// Save original value.
452 452
 			$args['temp_value'] = $value;
453 453
 			$args['other']      = true;
454 454
 
455 455
 			// Sanitizing is done next.
456
-			$other_vals = wp_unslash( $_POST['item_meta']['other'][ $field->id ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
456
+			$other_vals = wp_unslash( $_POST['item_meta']['other'][$field->id] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
457 457
 			FrmAppHelper::sanitize_value( 'sanitize_text_field', $other_vals );
458 458
 
459 459
 			// Set the validation value now
@@ -476,12 +476,12 @@  discard block
 block discarded – undo
476 476
 		}
477 477
 
478 478
 		// Check if there are any other posted "other" values for this field.
479
-		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
479
+		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
480 480
 			// Save original value
481 481
 			$args['temp_value'] = $value;
482 482
 			$args['other']      = true;
483 483
 
484
-			$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
484
+			$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
485 485
 			FrmAppHelper::sanitize_value( 'sanitize_text_field', $other_vals );
486 486
 
487 487
 			// Set the validation value now.
@@ -508,7 +508,7 @@  discard block
 block discarded – undo
508 508
 		if ( is_array( $value ) && $field->type === 'checkbox' ) {
509 509
 			// Combine "Other" values with checked values. "Other" values will override checked box values.
510 510
 			foreach ( $other_vals as $k => $v ) {
511
-				if ( isset( $value[ $k ] ) && trim( $v ) === '' ) {
511
+				if ( isset( $value[$k] ) && trim( $v ) === '' ) {
512 512
 					// If the other box is checked, but doesn't have a value.
513 513
 					$value = '';
514 514
 					break;
@@ -525,25 +525,25 @@  discard block
 block discarded – undo
525 525
 
526 526
 			// Multi-select dropdown.
527 527
 			if ( is_array( $value ) ) {
528
-				$o_key = array_search( $field->options[ $other_key ], $value );
528
+				$o_key = array_search( $field->options[$other_key], $value );
529 529
 
530 530
 				if ( $o_key !== false ) {
531 531
 					// Modify the original value so other key will be preserved.
532
-					$value[ $other_key ] = $value[ $o_key ];
532
+					$value[$other_key] = $value[$o_key];
533 533
 
534 534
 					// By default, the array keys will be numeric for multi-select dropdowns.
535 535
 					// If going backwards and forwards between pages, the array key will match the other key.
536 536
 					if ( $o_key !== $other_key ) {
537
-						unset( $value[ $o_key ] );
537
+						unset( $value[$o_key] );
538 538
 					}
539 539
 
540 540
 					$args['temp_value']  = $value;
541
-					$value[ $other_key ] = reset( $other_vals );
542
-					if ( FrmAppHelper::is_empty_value( $value[ $other_key ] ) ) {
543
-						unset( $value[ $other_key ] );
541
+					$value[$other_key] = reset( $other_vals );
542
+					if ( FrmAppHelper::is_empty_value( $value[$other_key] ) ) {
543
+						unset( $value[$other_key] );
544 544
 					}
545 545
 				}
546
-			} elseif ( $field->options[ $other_key ] == $value ) {
546
+			} elseif ( $field->options[$other_key] == $value ) {
547 547
 				$value = $other_vals;
548 548
 			}//end if
549 549
 		}//end if
@@ -797,7 +797,7 @@  discard block
 block discarded – undo
797 797
 	 * @return void
798 798
 	 */
799 799
 	public static function maybe_render_captcha_score( $entry_id ) {
800
-		$query                 = array(
800
+		$query = array(
801 801
 			'item_id'  => (int) $entry_id,
802 802
 			'field_id' => 0,
803 803
 		);
@@ -851,7 +851,7 @@  discard block
 block discarded – undo
851 851
 	public static function get_entry_status_label( $status ) {
852 852
 		$statuses = self::get_entry_statuses();
853 853
 
854
-		return $statuses[ self::get_entry_status( $status ) ];
854
+		return $statuses[self::get_entry_status( $status )];
855 855
 	}
856 856
 
857 857
 	/**
Please login to merge, or discard this patch.
Braces   +14 added lines, -7 removed lines patch added patch discarded remove patch
@@ -134,13 +134,16 @@  discard block
 block discarded – undo
134 134
 	 */
135 135
 	public static function value_is_posted( $field, $args ) {
136 136
 		$value_is_posted = false;
137
-		if ( $_POST ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
137
+		if ( $_POST ) {
138
+// phpcs:ignore WordPress.Security.NonceVerification.Missing
138 139
 			$repeating = isset( $args['repeating'] ) && $args['repeating'];
139 140
 			if ( $repeating ) {
140
-				if ( isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
141
+				if ( isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field->id ] ) ) {
142
+// phpcs:ignore WordPress.Security.NonceVerification.Missing
141 143
 					$value_is_posted = true;
142 144
 				}
143
-			} elseif ( isset( $_POST['item_meta'][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
145
+			} elseif ( isset( $_POST['item_meta'][ $field->id ] ) ) {
146
+// phpcs:ignore WordPress.Security.NonceVerification.Missing
144 147
 				$value_is_posted = true;
145 148
 			}
146 149
 		}
@@ -363,8 +366,10 @@  discard block
 block discarded – undo
363 366
 	 * @return void
364 367
 	 */
365 368
 	private static function set_parent_field_posted_value( $field, $value, $args ) {
366
-		if ( isset( $_POST['item_meta'][ $args['parent_field_id'] ] ) && is_array( $_POST['item_meta'][ $args['parent_field_id'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
367
-			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
369
+		if ( isset( $_POST['item_meta'][ $args['parent_field_id'] ] ) && is_array( $_POST['item_meta'][ $args['parent_field_id'] ] ) ) {
370
+// phpcs:ignore WordPress.Security.NonceVerification.Missing
371
+			if ( ! isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] ) || ! is_array( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] ) ) {
372
+// phpcs:ignore WordPress.Security.NonceVerification.Missing
368 373
 				$_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing
369 374
 			}
370 375
 		} else {
@@ -446,7 +451,8 @@  discard block
 block discarded – undo
446 451
 		self::set_other_repeating_vals( $field, $value, $args );
447 452
 
448 453
 		// Check if there are any posted "Other" values.
449
-		if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta']['other'][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
454
+		if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta']['other'][ $field->id ] ) ) {
455
+// phpcs:ignore WordPress.Security.NonceVerification.Missing
450 456
 
451 457
 			// Save original value.
452 458
 			$args['temp_value'] = $value;
@@ -476,7 +482,8 @@  discard block
 block discarded – undo
476 482
 		}
477 483
 
478 484
 		// Check if there are any other posted "other" values for this field.
479
-		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
485
+		if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ]['other'][ $field->id ] ) ) {
486
+// phpcs:ignore WordPress.Security.NonceVerification.Missing
480 487
 			// Save original value
481 488
 			$args['temp_value'] = $value;
482 489
 			$args['other']      = true;
Please login to merge, or discard this patch.
classes/views/frm-fields/front-end/radio-field.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
 		if ( isset( $shortcode_atts ) && isset( $shortcode_atts['opt'] ) && $shortcode_atts['opt'] !== $opt_key ) {
25 25
 			continue;
26 26
 		}
27
-		$choice_limit_reached = $field_choices_limit_reached_statuses[ $opt_key ] ?? false;
27
+		$choice_limit_reached = $field_choices_limit_reached_statuses[$opt_key] ?? false;
28 28
 		if ( FrmFieldsHelper::should_hide_field_choice( $choice_limit_reached, $field['form_id'] ) ) {
29 29
 			continue;
30 30
 		}
Please login to merge, or discard this patch.
classes/views/frm-fields/front-end/dropdown-field.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@
 block discarded – undo
52 52
 	}
53 53
 
54 54
 	foreach ( $field['options'] as $opt_key => $opt ) {
55
-		$choice_limit_reached = $field_choices_limit_reached_statuses[ $opt_key ];
55
+		$choice_limit_reached = $field_choices_limit_reached_statuses[$opt_key];
56 56
 		if ( FrmFieldsHelper::should_hide_field_choice( $choice_limit_reached, $field['form_id'] ) ) {
57 57
 			continue;
58 58
 		}
Please login to merge, or discard this patch.
classes/views/frm-fields/front-end/checkbox-field.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 		if ( isset( $shortcode_atts ) && isset( $shortcode_atts['opt'] ) && $shortcode_atts['opt'] !== $opt_key ) {
26 26
 			continue;
27 27
 		}
28
-		$choice_limit_reached = $field_choices_limit_reached_statuses[ $opt_key ] ?? false;
28
+		$choice_limit_reached = $field_choices_limit_reached_statuses[$opt_key] ?? false;
29 29
 		if ( FrmFieldsHelper::should_hide_field_choice( $choice_limit_reached, $field['form_id'] ) ) {
30 30
 			continue;
31 31
 		}
@@ -107,6 +107,6 @@  discard block
 block discarded – undo
107 107
 
108 108
 		?></div>
109 109
 <?php
110
-		++$option_index;
110
+		++ $option_index;
111 111
 	}//end foreach
112 112
 }//end if
Please login to merge, or discard this patch.