Completed
Pull Request — master (#1415)
by Stephanie
29s
created
classes/helpers/FrmOnSubmitHelper.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -240,26 +240,26 @@  discard block
 block discarded – undo
240 240
 	public static function populate_on_submit_data( &$form_options, $action = null, $event = 'create' ) {
241 241
 		$opt = 'update' === $event ? 'edit_' : 'success_';
242 242
 		if ( ! $action || ! is_object( $action ) ) {
243
-			$form_options[ $opt . 'action' ] = self::get_default_action_type();
244
-			$form_options[ $opt . 'msg' ]    = self::get_default_msg();
243
+			$form_options[$opt . 'action'] = self::get_default_action_type();
244
+			$form_options[$opt . 'msg']    = self::get_default_msg();
245 245
 
246 246
 			return;
247 247
 		}
248 248
 
249
-		$form_options[ $opt . 'action' ] = isset( $action->post_content['success_action'] ) ? $action->post_content['success_action'] : 'message';
249
+		$form_options[$opt . 'action'] = isset( $action->post_content['success_action'] ) ? $action->post_content['success_action'] : 'message';
250 250
 
251
-		switch ( $form_options[ $opt . 'action' ] ) {
251
+		switch ( $form_options[$opt . 'action'] ) {
252 252
 			case 'redirect':
253
-				$form_options[ $opt . 'url' ]    = isset( $action->post_content['success_url'] ) ? $action->post_content['success_url'] : '';
253
+				$form_options[$opt . 'url']    = isset( $action->post_content['success_url'] ) ? $action->post_content['success_url'] : '';
254 254
 				$form_options['open_in_new_tab'] = ! empty( $action->post_content['open_in_new_tab'] );
255 255
 				break;
256 256
 
257 257
 			case 'page':
258
-				$form_options[ $opt . 'page_id' ] = isset( $action->post_content['success_page_id'] ) ? $action->post_content['success_page_id'] : '';
258
+				$form_options[$opt . 'page_id'] = isset( $action->post_content['success_page_id'] ) ? $action->post_content['success_page_id'] : '';
259 259
 				break;
260 260
 
261 261
 			default:
262
-				$form_options[ $opt . 'msg' ] = ! empty( $action->post_content['success_msg'] ) ? $action->post_content['success_msg'] : self::get_default_msg();
262
+				$form_options[$opt . 'msg'] = ! empty( $action->post_content['success_msg'] ) ? $action->post_content['success_msg'] : self::get_default_msg();
263 263
 				$form_options['show_form']    = ! empty( $action->post_content['show_form'] );
264 264
 		}
265 265
 	}
@@ -348,20 +348,20 @@  discard block
 block discarded – undo
348 348
 	private static function get_on_submit_action_data_from_form_options( $form_options, $event = 'create' ) {
349 349
 		$opt  = 'update' === $event ? 'edit_' : 'success_';
350 350
 		$data = array(
351
-			'success_action' => isset( $form_options[ $opt . 'action' ] ) ? $form_options[ $opt . 'action' ] : self::get_default_action_type(),
351
+			'success_action' => isset( $form_options[$opt . 'action'] ) ? $form_options[$opt . 'action'] : self::get_default_action_type(),
352 352
 		);
353 353
 
354 354
 		switch ( $data['success_action'] ) {
355 355
 			case 'redirect':
356
-				$data['success_url'] = isset( $form_options[ $opt . 'url' ] ) ? $form_options[ $opt . 'url' ] : '';
356
+				$data['success_url'] = isset( $form_options[$opt . 'url'] ) ? $form_options[$opt . 'url'] : '';
357 357
 				break;
358 358
 
359 359
 			case 'page':
360
-				$data['success_page_id'] = isset( $form_options[ $opt . 'page_id' ] ) ? $form_options[ $opt . 'page_id' ] : '';
360
+				$data['success_page_id'] = isset( $form_options[$opt . 'page_id'] ) ? $form_options[$opt . 'page_id'] : '';
361 361
 				break;
362 362
 
363 363
 			default:
364
-				$data['success_msg'] = isset( $form_options[ $opt . 'msg' ] ) ? $form_options[ $opt . 'msg' ] : self::get_default_msg();
364
+				$data['success_msg'] = isset( $form_options[$opt . 'msg'] ) ? $form_options[$opt . 'msg'] : self::get_default_msg();
365 365
 				$data['show_form']   = ! empty( $form_options['show_form'] );
366 366
 		}
367 367
 
Please login to merge, or discard this patch.
classes/controllers/FrmSimpleBlocksController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@
 block discarded – undo
76 76
 			return false;
77 77
 		}
78 78
 
79
-		return $addons[ $addon_id ];
79
+		return $addons[$addon_id];
80 80
 	}
81 81
 
82 82
 	/**
Please login to merge, or discard this patch.
classes/models/FrmSettings.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -187,8 +187,8 @@  discard block
 block discarded – undo
187 187
 		}
188 188
 
189 189
 		foreach ( $settings as $setting => $default ) {
190
-			if ( isset( $params[ 'frm_' . $setting ] ) ) {
191
-				$this->{$setting} = $params[ 'frm_' . $setting ];
190
+			if ( isset( $params['frm_' . $setting] ) ) {
191
+				$this->{$setting} = $params['frm_' . $setting];
192 192
 			} elseif ( ! isset( $this->{$setting} ) ) {
193 193
 				$this->{$setting} = $default;
194 194
 			}
@@ -356,7 +356,7 @@  discard block
 block discarded – undo
356 356
 
357 357
 		$checkboxes = array( 'mu_menu', 're_multi', 'use_html', 'jquery_css', 'accordion_js', 'fade_form', 'no_ips', 'custom_header_ip', 'tracking', 'admin_bar', 'summary_emails' );
358 358
 		foreach ( $checkboxes as $set ) {
359
-			$this->$set = isset( $params[ 'frm_' . $set ] ) ? absint( $params[ 'frm_' . $set ] ) : 0;
359
+			$this->$set = isset( $params['frm_' . $set] ) ? absint( $params['frm_' . $set] ) : 0;
360 360
 		}
361 361
 	}
362 362
 
@@ -369,7 +369,7 @@  discard block
 block discarded – undo
369 369
 		$frm_roles = FrmAppHelper::frm_capabilities();
370 370
 		$roles     = get_editable_roles();
371 371
 		foreach ( $frm_roles as $frm_role => $frm_role_description ) {
372
-			$this->$frm_role = (array) ( isset( $params[ $frm_role ] ) ? $params[ $frm_role ] : 'administrator' );
372
+			$this->$frm_role = (array) ( isset( $params[$frm_role] ) ? $params[$frm_role] : 'administrator' );
373 373
 
374 374
 			// Make sure administrators always have permissions
375 375
 			if ( ! in_array( 'administrator', $this->$frm_role ) ) {
Please login to merge, or discard this patch.
classes/factories/FrmFieldFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -108,7 +108,7 @@
 block discarded – undo
108 108
 			'credit_card' => 'FrmFieldCreditCard',
109 109
 		);
110 110
 
111
-		$class = isset( $type_classes[ $field_type ] ) ? $type_classes[ $field_type ] : '';
111
+		$class = isset( $type_classes[$field_type] ) ? $type_classes[$field_type] : '';
112 112
 
113 113
 		return apply_filters( 'frm_get_field_type_class', $class, $field_type );
114 114
 	}
Please login to merge, or discard this patch.
classes/models/fields/FrmFieldType.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -144,8 +144,8 @@  discard block
 block discarded – undo
144 144
 		$field_val = '';
145 145
 		if ( is_object( $this->field ) ) {
146 146
 			$field_val = $this->field->{$column};
147
-		} elseif ( is_array( $this->field ) && isset( $this->field[ $column ] ) ) {
148
-			$field_val = $this->field[ $column ];
147
+		} elseif ( is_array( $this->field ) && isset( $this->field[$column] ) ) {
148
+			$field_val = $this->field[$column];
149 149
 		}
150 150
 
151 151
 		return $field_val;
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
 		if ( is_object( $this->field ) ) {
160 160
 			$this->field->{$column} = $value;
161 161
 		} elseif ( is_array( $this->field ) ) {
162
-			$this->field[ $column ] = $value;
162
+			$this->field[$column] = $value;
163 163
 		}
164 164
 	}
165 165
 
@@ -548,7 +548,7 @@  discard block
 block discarded – undo
548 548
 			printf(
549 549
 				/* translators: %s: Field type */
550 550
 				esc_html__( '%s Options', 'formidable' ),
551
-				esc_html( $all_field_types[ $args['display']['type'] ]['name'] )
551
+				esc_html( $all_field_types[$args['display']['type']]['name'] )
552 552
 			);
553 553
 			FrmAppHelper::icon_by_class( 'frmfont frm_arrowdown6_icon', array( 'aria-hidden' => 'true' ) );
554 554
 			?>
@@ -681,8 +681,8 @@  discard block
 block discarded – undo
681 681
 
682 682
 		$fields = array_merge( $fields, $pro_fields );
683 683
 
684
-		if ( isset( $fields[ $this->type ] ) ) {
685
-			$name = is_array( $fields[ $this->type ] ) ? $fields[ $this->type ]['name'] : $fields[ $this->type ];
684
+		if ( isset( $fields[$this->type] ) ) {
685
+			$name = is_array( $fields[$this->type] ) ? $fields[$this->type]['name'] : $fields[$this->type];
686 686
 		}
687 687
 
688 688
 		return $name;
@@ -699,7 +699,7 @@  discard block
 block discarded – undo
699 699
 	 * @return array
700 700
 	 */
701 701
 	public function get_default_field_options() {
702
-		$opts       = array(
702
+		$opts = array(
703 703
 			'size'               => '',
704 704
 			'max'                => '',
705 705
 			'label'              => '',
@@ -1066,7 +1066,7 @@  discard block
 block discarded – undo
1066 1066
 			}
1067 1067
 		} else {
1068 1068
 			$args['save_array'] = $this->is_readonly_array();
1069
-			$hidden             .= $this->show_single_hidden( $selected_value, $args );
1069
+			$hidden .= $this->show_single_hidden( $selected_value, $args );
1070 1070
 		}
1071 1071
 
1072 1072
 		return $hidden;
@@ -1075,7 +1075,7 @@  discard block
 block discarded – undo
1075 1075
 	protected function show_single_hidden( $selected, $args ) {
1076 1076
 		if ( $args['save_array'] ) {
1077 1077
 			$args['field_name'] .= '[]';
1078
-			$id                 = '';
1078
+			$id = '';
1079 1079
 		} else {
1080 1080
 			$id = ' id="' . esc_attr( $args['html_id'] ) . '"';
1081 1081
 		}
@@ -1091,8 +1091,8 @@  discard block
 block discarded – undo
1091 1091
 		$selected = $values['field_value'];
1092 1092
 
1093 1093
 		if ( isset( $values['combo_name'] ) ) {
1094
-			$options  = $options[ $values['combo_name'] ];
1095
-			$selected = ( is_array( $selected ) && isset( $selected[ $values['combo_name'] ] ) ) ? $selected[ $values['combo_name'] ] : '';
1094
+			$options  = $options[$values['combo_name']];
1095
+			$selected = ( is_array( $selected ) && isset( $selected[$values['combo_name']] ) ) ? $selected[$values['combo_name']] : '';
1096 1096
 		}
1097 1097
 
1098 1098
 		$input = $this->select_tag( $values );
@@ -1143,7 +1143,7 @@  discard block
 block discarded – undo
1143 1143
 	}
1144 1144
 
1145 1145
 	protected function fill_display_field_values( $args = array() ) {
1146
-		$defaults        = array(
1146
+		$defaults = array(
1147 1147
 			'field_name'    => 'item_meta[' . $this->get_field_column( 'id' ) . ']',
1148 1148
 			'field_id'      => $this->get_field_column( 'id' ),
1149 1149
 			'field_plus_id' => '',
@@ -1196,7 +1196,7 @@  discard block
 block discarded – undo
1196 1196
 			}
1197 1197
 		}
1198 1198
 
1199
-		if ( isset( $args['errors'][ 'field' . $args['field_id'] ] ) && ! $custom_error_fields ) {
1199
+		if ( isset( $args['errors']['field' . $args['field_id']] ) && ! $custom_error_fields ) {
1200 1200
 			if ( $error_comes_first ) {
1201 1201
 				array_unshift( $describedby, 'frm_error_' . $args['html_id'] );
1202 1202
 			} else {
@@ -1275,11 +1275,11 @@  discard block
 block discarded – undo
1275 1275
 
1276 1276
 		$field_id = $this->get_field_column( 'id' );
1277 1277
 		if ( ! array_key_exists( $field_id, $frm_validated_unique_values ) ) {
1278
-			$frm_validated_unique_values[ $field_id ] = array();
1278
+			$frm_validated_unique_values[$field_id] = array();
1279 1279
 			return false;
1280 1280
 		}
1281 1281
 
1282
-		$already_validated_this_value = in_array( $value, $frm_validated_unique_values[ $field_id ], true );
1282
+		$already_validated_this_value = in_array( $value, $frm_validated_unique_values[$field_id], true );
1283 1283
 		return $already_validated_this_value;
1284 1284
 	}
1285 1285
 
@@ -1304,7 +1304,7 @@  discard block
 block discarded – undo
1304 1304
 	private function value_validated_as_unique( $value ) {
1305 1305
 		global $frm_validated_unique_values;
1306 1306
 		$field_id                                   = $this->get_field_column( 'id' );
1307
-		$frm_validated_unique_values[ $field_id ][] = $value;
1307
+		$frm_validated_unique_values[$field_id][] = $value;
1308 1308
 	}
1309 1309
 
1310 1310
 	public function get_value_to_save( $value, $atts ) {
@@ -1336,8 +1336,8 @@  discard block
 block discarded – undo
1336 1336
 		$value = $this->prepare_display_value( $value, $atts );
1337 1337
 
1338 1338
 		if ( is_array( $value ) ) {
1339
-			if ( isset( $atts['show'] ) && $atts['show'] && isset( $value[ $atts['show'] ] ) ) {
1340
-				$value = $value[ $atts['show'] ];
1339
+			if ( isset( $atts['show'] ) && $atts['show'] && isset( $value[$atts['show']] ) ) {
1340
+				$value = $value[$atts['show']];
1341 1341
 			} elseif ( ! isset( $atts['return_array'] ) || ! $atts['return_array'] ) {
1342 1342
 				$sep   = isset( $atts['sep'] ) ? $atts['sep'] : ', ';
1343 1343
 				$value = implode( $sep, $value );
@@ -1406,8 +1406,8 @@  discard block
 block discarded – undo
1406 1406
 		$saved_entries = $atts['ids'];
1407 1407
 		$new_value     = array();
1408 1408
 		foreach ( (array) $value as $old_child_id ) {
1409
-			if ( isset( $saved_entries[ $old_child_id ] ) ) {
1410
-				$new_value[] = $saved_entries[ $old_child_id ];
1409
+			if ( isset( $saved_entries[$old_child_id] ) ) {
1410
+				$new_value[] = $saved_entries[$old_child_id];
1411 1411
 			}
1412 1412
 		}
1413 1413
 
Please login to merge, or discard this patch.
classes/helpers/FrmAppHelper.php 2 patches
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -493,7 +493,8 @@  discard block
 block discarded – undo
493 493
 
494 494
 		if ( $src === 'get' ) {
495 495
 			$value = isset( $_POST[ $param ] ) ? wp_unslash( $_POST[ $param ] ) : ( isset( $_GET[ $param ] ) ? wp_unslash( $_GET[ $param ] ) : $default ); // phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
496
-			if ( ! isset( $_POST[ $param ] ) && isset( $_GET[ $param ] ) && ! is_array( $value ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
496
+			if ( ! isset( $_POST[ $param ] ) && isset( $_GET[ $param ] ) && ! is_array( $value ) ) {
497
+// phpcs:ignore WordPress.Security.NonceVerification.Missing
497 498
 				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
498 499
 				$value = htmlspecialchars_decode( wp_unslash( $_GET[ $param ] ) );
499 500
 			}
@@ -581,7 +582,8 @@  discard block
 block discarded – undo
581 582
 				$value = wp_unslash( $_GET[ $args['param'] ] );
582 583
 			}
583 584
 		} elseif ( $args['type'] === 'post' ) {
584
-			if ( isset( $_POST[ $args['param'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
585
+			if ( isset( $_POST[ $args['param'] ] ) ) {
586
+// phpcs:ignore WordPress.Security.NonceVerification.Missing
585 587
 				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
586 588
 				$value = wp_unslash( $_POST[ $args['param'] ] );
587 589
 				if ( $args['serialized'] === true && is_serialized_string( $value ) && is_serialized( $value ) ) {
@@ -589,7 +591,8 @@  discard block
 block discarded – undo
589 591
 				}
590 592
 			}
591 593
 		} else {
592
-			if ( isset( $_REQUEST[ $args['param'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
594
+			if ( isset( $_REQUEST[ $args['param'] ] ) ) {
595
+// phpcs:ignore WordPress.Security.NonceVerification.Missing
593 596
 				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
594 597
 				$value = wp_unslash( $_REQUEST[ $args['param'] ] );
595 598
 			}
Please login to merge, or discard this patch.
Spacing   +78 added lines, -78 removed lines patch added patch discarded remove patch
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
 			'fill'   => '#4d4d4d',
199 199
 			'orange' => '#f05a24',
200 200
 		);
201
-		$atts     = array_merge( $defaults, $atts );
201
+		$atts = array_merge( $defaults, $atts );
202 202
 
203 203
 		return '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 599.68 601.37" width="' . esc_attr( $atts['width'] ) . '" height="' . esc_attr( $atts['height'] ) . '">
204 204
 			<path fill="' . esc_attr( $atts['orange'] ) . '" d="M289.6 384h140v76h-140z"/>
@@ -405,7 +405,7 @@  discard block
 block discarded – undo
405 405
 	 * @return string
406 406
 	 */
407 407
 	public static function get_server_value( $value ) {
408
-		return isset( $_SERVER[ $value ] ) ? wp_strip_all_tags( wp_unslash( $_SERVER[ $value ] ) ) : '';
408
+		return isset( $_SERVER[$value] ) ? wp_strip_all_tags( wp_unslash( $_SERVER[$value] ) ) : '';
409 409
 	}
410 410
 
411 411
 	/**
@@ -439,7 +439,7 @@  discard block
 block discarded – undo
439 439
 		$ip         = '';
440 440
 
441 441
 		foreach ( $ip_options as $key ) {
442
-			if ( ! isset( $_SERVER[ $key ] ) ) {
442
+			if ( ! isset( $_SERVER[$key] ) ) {
443 443
 				continue;
444 444
 			}
445 445
 
@@ -508,10 +508,10 @@  discard block
 block discarded – undo
508 508
 		}
509 509
 
510 510
 		if ( $src === 'get' ) {
511
-			$value = isset( $_POST[ $param ] ) ? wp_unslash( $_POST[ $param ] ) : ( isset( $_GET[ $param ] ) ? wp_unslash( $_GET[ $param ] ) : $default ); // phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
512
-			if ( ! isset( $_POST[ $param ] ) && isset( $_GET[ $param ] ) && ! is_array( $value ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
511
+			$value = isset( $_POST[$param] ) ? wp_unslash( $_POST[$param] ) : ( isset( $_GET[$param] ) ? wp_unslash( $_GET[$param] ) : $default ); // phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
512
+			if ( ! isset( $_POST[$param] ) && isset( $_GET[$param] ) && ! is_array( $value ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
513 513
 				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
514
-				$value = htmlspecialchars_decode( wp_unslash( $_GET[ $param ] ) );
514
+				$value = htmlspecialchars_decode( wp_unslash( $_GET[$param] ) );
515 515
 			}
516 516
 			self::sanitize_value( $sanitize, $value );
517 517
 		} else {
@@ -532,7 +532,7 @@  discard block
 block discarded – undo
532 532
 				}
533 533
 
534 534
 				$p     = trim( $p, ']' );
535
-				$value = isset( $value[ $p ] ) ? $value[ $p ] : $default;
535
+				$value = isset( $value[$p] ) ? $value[$p] : $default;
536 536
 			}
537 537
 		}
538 538
 
@@ -588,26 +588,26 @@  discard block
 block discarded – undo
588 588
 			'sanitize' => 'sanitize_text_field',
589 589
 			'serialized' => false,
590 590
 		);
591
-		$args     = wp_parse_args( $args, $defaults );
591
+		$args = wp_parse_args( $args, $defaults );
592 592
 
593 593
 		$value = $args['default'];
594 594
 		if ( $args['type'] === 'get' ) {
595
-			if ( $_GET && isset( $_GET[ $args['param'] ] ) ) {
595
+			if ( $_GET && isset( $_GET[$args['param']] ) ) {
596 596
 				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
597
-				$value = wp_unslash( $_GET[ $args['param'] ] );
597
+				$value = wp_unslash( $_GET[$args['param']] );
598 598
 			}
599 599
 		} elseif ( $args['type'] === 'post' ) {
600
-			if ( isset( $_POST[ $args['param'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
600
+			if ( isset( $_POST[$args['param']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
601 601
 				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
602
-				$value = wp_unslash( $_POST[ $args['param'] ] );
602
+				$value = wp_unslash( $_POST[$args['param']] );
603 603
 				if ( $args['serialized'] === true && is_serialized_string( $value ) && is_serialized( $value ) ) {
604 604
 					self::unserialize_or_decode( $value );
605 605
 				}
606 606
 			}
607 607
 		} else {
608
-			if ( isset( $_REQUEST[ $args['param'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
608
+			if ( isset( $_REQUEST[$args['param']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
609 609
 				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
610
-				$value = wp_unslash( $_REQUEST[ $args['param'] ] );
610
+				$value = wp_unslash( $_REQUEST[$args['param']] );
611 611
 			}
612 612
 		}
613 613
 
@@ -639,7 +639,7 @@  discard block
 block discarded – undo
639 639
 			if ( is_array( $value ) ) {
640 640
 				$temp_values = $value;
641 641
 				foreach ( $temp_values as $k => $v ) {
642
-					self::sanitize_value( $sanitize, $value[ $k ] );
642
+					self::sanitize_value( $sanitize, $value[$k] );
643 643
 				}
644 644
 			} else {
645 645
 				$value = call_user_func( $sanitize, $value );
@@ -650,8 +650,8 @@  discard block
 block discarded – undo
650 650
 	public static function sanitize_request( $sanitize_method, &$values ) {
651 651
 		$temp_values = $values;
652 652
 		foreach ( $temp_values as $k => $val ) {
653
-			if ( isset( $sanitize_method[ $k ] ) ) {
654
-				$values[ $k ] = call_user_func( $sanitize_method[ $k ], $val );
653
+			if ( isset( $sanitize_method[$k] ) ) {
654
+				$values[$k] = call_user_func( $sanitize_method[$k], $val );
655 655
 			}
656 656
 		}
657 657
 	}
@@ -674,7 +674,7 @@  discard block
 block discarded – undo
674 674
 		if ( is_array( $value ) ) {
675 675
 			$temp_values = $value;
676 676
 			foreach ( $temp_values as $k => $v ) {
677
-				self::decode_specialchars( $value[ $k ] );
677
+				self::decode_specialchars( $value[$k] );
678 678
 			}
679 679
 		} else {
680 680
 			self::decode_amp( $value );
@@ -796,7 +796,7 @@  discard block
 block discarded – undo
796 796
 	 * @return array
797 797
 	 */
798 798
 	public static function add_allowed_submit_button_tags( $allowed_html ) {
799
-		$allowed_html['input']                    = array(
799
+		$allowed_html['input'] = array(
800 800
 			'type'           => true,
801 801
 			'value'          => true,
802 802
 			'formnovalidate' => true,
@@ -819,7 +819,7 @@  discard block
 block discarded – undo
819 819
 			$allowed_html = $html;
820 820
 		} elseif ( ! empty( $allowed ) ) {
821 821
 			foreach ( (array) $allowed as $a ) {
822
-				$allowed_html[ $a ] = isset( $html[ $a ] ) ? $html[ $a ] : array();
822
+				$allowed_html[$a] = isset( $html[$a] ) ? $html[$a] : array();
823 823
 			}
824 824
 		}
825 825
 
@@ -998,8 +998,8 @@  discard block
 block discarded – undo
998 998
 		}
999 999
 
1000 1000
 		global $wp_query;
1001
-		if ( isset( $wp_query->query_vars[ $param ] ) ) {
1002
-			$value = $wp_query->query_vars[ $param ];
1001
+		if ( isset( $wp_query->query_vars[$param] ) ) {
1002
+			$value = $wp_query->query_vars[$param];
1003 1003
 		}
1004 1004
 
1005 1005
 		return $value;
@@ -1026,9 +1026,9 @@  discard block
 block discarded – undo
1026 1026
 		$deprecated = array(
1027 1027
 			'frm_clone_solid_icon' => 'frm_clone_icon',
1028 1028
 		);
1029
-		if ( isset( $deprecated[ $icon ] ) ) {
1030
-			$icon = $deprecated[ $icon ];
1031
-			$class = str_replace( $icon, $deprecated[ $icon ], $class );
1029
+		if ( isset( $deprecated[$icon] ) ) {
1030
+			$icon = $deprecated[$icon];
1031
+			$class = str_replace( $icon, $deprecated[$icon], $class );
1032 1032
 		}
1033 1033
 
1034 1034
 		if ( $icon === $class ) {
@@ -1361,7 +1361,7 @@  discard block
 block discarded – undo
1361 1361
 				'new_file_path' => self::plugin_path() . '/js',
1362 1362
 			)
1363 1363
 		);
1364
-		$new_file  = new FrmCreateFile( $file_atts );
1364
+		$new_file = new FrmCreateFile( $file_atts );
1365 1365
 
1366 1366
 		$files = array(
1367 1367
 			self::plugin_path() . '/js/formidable.min.js',
@@ -1380,7 +1380,7 @@  discard block
 block discarded – undo
1380 1380
 				'new_file_path' => self::plugin_path() . '/js',
1381 1381
 			)
1382 1382
 		);
1383
-		$new_file  = new FrmCreateFile( $file_atts );
1383
+		$new_file = new FrmCreateFile( $file_atts );
1384 1384
 		$files = array(
1385 1385
 			FrmStrpLiteAppHelper::plugin_path() . 'js/frmstrp.min.js',
1386 1386
 		);
@@ -1871,8 +1871,8 @@  discard block
 block discarded – undo
1871 1871
 			return $error;
1872 1872
 		}
1873 1873
 
1874
-		$nonce_value = ( $_REQUEST && isset( $_REQUEST[ $nonce_name ] ) ) ? sanitize_text_field( wp_unslash( $_REQUEST[ $nonce_name ] ) ) : '';
1875
-		if ( $_REQUEST && ( ! isset( $_REQUEST[ $nonce_name ] ) || ! wp_verify_nonce( $nonce_value, $nonce ) ) ) {
1874
+		$nonce_value = ( $_REQUEST && isset( $_REQUEST[$nonce_name] ) ) ? sanitize_text_field( wp_unslash( $_REQUEST[$nonce_name] ) ) : '';
1875
+		if ( $_REQUEST && ( ! isset( $_REQUEST[$nonce_name] ) || ! wp_verify_nonce( $nonce_value, $nonce ) ) ) {
1876 1876
 			$frm_settings = self::get_settings();
1877 1877
 			$error        = $frm_settings->admin_permission;
1878 1878
 		}
@@ -1907,7 +1907,7 @@  discard block
 block discarded – undo
1907 1907
 			} else {
1908 1908
 				foreach ( $value as $k => $v ) {
1909 1909
 					if ( ! is_array( $v ) ) {
1910
-						$value[ $k ] = call_user_func( $original_function, $v );
1910
+						$value[$k] = call_user_func( $original_function, $v );
1911 1911
 					}
1912 1912
 				}
1913 1913
 			}
@@ -1932,7 +1932,7 @@  discard block
 block discarded – undo
1932 1932
 				$return = array_merge( $return, self::array_flatten( $value, $keys ) );
1933 1933
 			} else {
1934 1934
 				if ( $keys === 'keep' ) {
1935
-					$return[ $key ] = $value;
1935
+					$return[$key] = $value;
1936 1936
 				} else {
1937 1937
 					$return[] = $value;
1938 1938
 				}
@@ -1985,11 +1985,11 @@  discard block
 block discarded – undo
1985 1985
 		}
1986 1986
 
1987 1987
 		$ver = $default;
1988
-		if ( ! isset( $wp_scripts->registered[ $handle ] ) ) {
1988
+		if ( ! isset( $wp_scripts->registered[$handle] ) ) {
1989 1989
 			return $ver;
1990 1990
 		}
1991 1991
 
1992
-		$query = $wp_scripts->registered[ $handle ];
1992
+		$query = $wp_scripts->registered[$handle];
1993 1993
 		if ( is_object( $query ) && ! empty( $query->ver ) ) {
1994 1994
 			$ver = $query->ver;
1995 1995
 		}
@@ -2095,7 +2095,7 @@  discard block
 block discarded – undo
2095 2095
 			$suffix = 2;
2096 2096
 			do {
2097 2097
 				$key_check = $key . $separator . $suffix;
2098
-				++$suffix;
2098
+				++ $suffix;
2099 2099
 			} while ( in_array( $key_check, $similar_keys, true ) );
2100 2100
 
2101 2101
 			$key = $key_check;
@@ -2203,7 +2203,7 @@  discard block
 block discarded – undo
2203 2203
 
2204 2204
 		foreach ( array( 'name', 'description' ) as $var ) {
2205 2205
 			$default_val    = isset( $record->{$var} ) ? $record->{$var} : '';
2206
-			$values[ $var ] = self::get_param( $var, $default_val, 'get', 'wp_kses_post' );
2206
+			$values[$var] = self::get_param( $var, $default_val, 'get', 'wp_kses_post' );
2207 2207
 			unset( $var, $default_val );
2208 2208
 		}
2209 2209
 
@@ -2261,9 +2261,9 @@  discard block
 block discarded – undo
2261 2261
 			}
2262 2262
 		}//end if
2263 2263
 
2264
-		$field_type = isset( $post_values['field_options'][ 'type_' . $field->id ] ) ? $post_values['field_options'][ 'type_' . $field->id ] : $field->type;
2265
-		if ( isset( $post_values['item_meta'][ $field->id ] ) ) {
2266
-			$new_value = $post_values['item_meta'][ $field->id ];
2264
+		$field_type = isset( $post_values['field_options']['type_' . $field->id] ) ? $post_values['field_options']['type_' . $field->id] : $field->type;
2265
+		if ( isset( $post_values['item_meta'][$field->id] ) ) {
2266
+			$new_value = $post_values['item_meta'][$field->id];
2267 2267
 			self::unserialize_or_decode( $new_value );
2268 2268
 		} else {
2269 2269
 			$new_value = $meta_value;
@@ -2284,7 +2284,7 @@  discard block
 block discarded – undo
2284 2284
 
2285 2285
 		$field_array = array_merge( (array) $field->field_options, $field_array );
2286 2286
 
2287
-		$values['fields'][ $field->id ] = $field_array;
2287
+		$values['fields'][$field->id] = $field_array;
2288 2288
 	}
2289 2289
 
2290 2290
 	/**
@@ -2334,11 +2334,11 @@  discard block
 block discarded – undo
2334 2334
 		}
2335 2335
 
2336 2336
 		foreach ( $form->options as $opt => $value ) {
2337
-			if ( isset( $post_values[ $opt ] ) ) {
2338
-				$values[ $opt ] = $post_values[ $opt ];
2339
-				self::unserialize_or_decode( $values[ $opt ] );
2337
+			if ( isset( $post_values[$opt] ) ) {
2338
+				$values[$opt] = $post_values[$opt];
2339
+				self::unserialize_or_decode( $values[$opt] );
2340 2340
 			} else {
2341
-				$values[ $opt ] = $value;
2341
+				$values[$opt] = $value;
2342 2342
 			}
2343 2343
 		}
2344 2344
 
@@ -2352,8 +2352,8 @@  discard block
 block discarded – undo
2352 2352
 		$form_defaults = FrmFormsHelper::get_default_opts();
2353 2353
 
2354 2354
 		foreach ( $form_defaults as $opt => $default ) {
2355
-			if ( ! isset( $values[ $opt ] ) || $values[ $opt ] == '' ) {
2356
-				$values[ $opt ] = ( $post_values && isset( $post_values['options'][ $opt ] ) ) ? $post_values['options'][ $opt ] : $default;
2355
+			if ( ! isset( $values[$opt] ) || $values[$opt] == '' ) {
2356
+				$values[$opt] = ( $post_values && isset( $post_values['options'][$opt] ) ) ? $post_values['options'][$opt] : $default;
2357 2357
 			}
2358 2358
 
2359 2359
 			unset( $opt, $default );
@@ -2364,8 +2364,8 @@  discard block
 block discarded – undo
2364 2364
 		}
2365 2365
 
2366 2366
 		foreach ( array( 'before', 'after', 'submit' ) as $h ) {
2367
-			if ( ! isset( $values[ $h . '_html' ] ) ) {
2368
-				$values[ $h . '_html' ] = ( isset( $post_values['options'][ $h . '_html' ] ) ? $post_values['options'][ $h . '_html' ] : FrmFormsHelper::get_default_html( $h ) );
2367
+			if ( ! isset( $values[$h . '_html'] ) ) {
2368
+				$values[$h . '_html'] = ( isset( $post_values['options'][$h . '_html'] ) ? $post_values['options'][$h . '_html'] : FrmFormsHelper::get_default_html( $h ) );
2369 2369
 			}
2370 2370
 			unset( $h );
2371 2371
 		}
@@ -2543,25 +2543,25 @@  discard block
 block discarded – undo
2543 2543
 		if ( ! is_numeric( $levels ) ) {
2544 2544
 			// Show time in specified unit.
2545 2545
 			$levels = self::get_unit( $levels );
2546
-			if ( isset( $time_strings[ $levels ] ) ) {
2546
+			if ( isset( $time_strings[$levels] ) ) {
2547 2547
 				$diff = array(
2548 2548
 					$levels => self::time_format( $levels, $diff ),
2549 2549
 				);
2550 2550
 				$time_strings = array(
2551
-					$levels => $time_strings[ $levels ],
2551
+					$levels => $time_strings[$levels],
2552 2552
 				);
2553 2553
 			}
2554 2554
 			$levels = 1;
2555 2555
 		}
2556 2556
 
2557 2557
 		foreach ( $time_strings as $k => $v ) {
2558
-			if ( isset( $diff[ $k ] ) && $diff[ $k ] ) {
2559
-				$time_strings[ $k ] = $diff[ $k ] . ' ' . ( $diff[ $k ] > 1 ? $v[1] : $v[0] );
2560
-			} elseif ( isset( $diff[ $k ] ) && count( $time_strings ) === 1 ) {
2558
+			if ( isset( $diff[$k] ) && $diff[$k] ) {
2559
+				$time_strings[$k] = $diff[$k] . ' ' . ( $diff[$k] > 1 ? $v[1] : $v[0] );
2560
+			} elseif ( isset( $diff[$k] ) && count( $time_strings ) === 1 ) {
2561 2561
 				// Account for 0.
2562
-				$time_strings[ $k ] = $diff[ $k ] . ' ' . $v[1];
2562
+				$time_strings[$k] = $diff[$k] . ' ' . $v[1];
2563 2563
 			} else {
2564
-				unset( $time_strings[ $k ] );
2564
+				unset( $time_strings[$k] );
2565 2565
 			}
2566 2566
 		}
2567 2567
 
@@ -2580,8 +2580,8 @@  discard block
 block discarded – undo
2580 2580
 			'y' => 'y',
2581 2581
 			'd' => 'days',
2582 2582
 		);
2583
-		if ( isset( $return[ $unit ] ) ) {
2584
-			return $diff[ $return[ $unit ] ];
2583
+		if ( isset( $return[$unit] ) ) {
2584
+			return $diff[$return[$unit]];
2585 2585
 		}
2586 2586
 
2587 2587
 		$total = $diff['days'] * self::convert_time( 'd', $unit );
@@ -2589,11 +2589,11 @@  discard block
 block discarded – undo
2589 2589
 		$times = array( 'h', 'i', 's' );
2590 2590
 
2591 2591
 		foreach ( $times as $time ) {
2592
-			if ( ! isset( $diff[ $time ] ) ) {
2592
+			if ( ! isset( $diff[$time] ) ) {
2593 2593
 				continue;
2594 2594
 			}
2595 2595
 
2596
-			$total += $diff[ $time ] * self::convert_time( $time, $unit );
2596
+			$total += $diff[$time] * self::convert_time( $time, $unit );
2597 2597
 		}
2598 2598
 
2599 2599
 		return floor( $total );
@@ -2613,7 +2613,7 @@  discard block
 block discarded – undo
2613 2613
 			'y' => DAY_IN_SECONDS * 365.25,
2614 2614
 		);
2615 2615
 
2616
-		return $convert[ $from ] / $convert[ $to ];
2616
+		return $convert[$from] / $convert[$to];
2617 2617
 	}
2618 2618
 
2619 2619
 	/**
@@ -2621,7 +2621,7 @@  discard block
 block discarded – undo
2621 2621
 	 */
2622 2622
 	private static function get_unit( $unit ) {
2623 2623
 		$units = self::get_time_strings();
2624
-		if ( isset( $units[ $unit ] ) || is_numeric( $unit ) ) {
2624
+		if ( isset( $units[$unit] ) || is_numeric( $unit ) ) {
2625 2625
 			return $unit;
2626 2626
 		}
2627 2627
 
@@ -2738,17 +2738,17 @@  discard block
 block discarded – undo
2738 2738
 
2739 2739
 					case 1:
2740 2740
 						$l2 = $name;
2741
-						self::add_value_to_array( $name, $l2, $this_val, $vars[ $l1 ] );
2741
+						self::add_value_to_array( $name, $l2, $this_val, $vars[$l1] );
2742 2742
 						break;
2743 2743
 
2744 2744
 					case 2:
2745 2745
 						$l3 = $name;
2746
-						self::add_value_to_array( $name, $l3, $this_val, $vars[ $l1 ][ $l2 ] );
2746
+						self::add_value_to_array( $name, $l3, $this_val, $vars[$l1][$l2] );
2747 2747
 						break;
2748 2748
 
2749 2749
 					case 3:
2750 2750
 						$l4 = $name;
2751
-						self::add_value_to_array( $name, $l4, $this_val, $vars[ $l1 ][ $l2 ][ $l3 ] );
2751
+						self::add_value_to_array( $name, $l4, $this_val, $vars[$l1][$l2][$l3] );
2752 2752
 				}
2753 2753
 
2754 2754
 				unset( $this_val, $n );
@@ -2767,8 +2767,8 @@  discard block
 block discarded – undo
2767 2767
 	public static function add_value_to_array( $name, $l1, $val, &$vars ) {
2768 2768
 		if ( $name == '' ) {
2769 2769
 			$vars[] = $val;
2770
-		} elseif ( ! isset( $vars[ $l1 ] ) ) {
2771
-			$vars[ $l1 ] = $val;
2770
+		} elseif ( ! isset( $vars[$l1] ) ) {
2771
+			$vars[$l1] = $val;
2772 2772
 		}
2773 2773
 	}
2774 2774
 
@@ -2785,7 +2785,7 @@  discard block
 block discarded – undo
2785 2785
 			'new_tab'       => __( 'This option will open the link in a new browser tab. Please note that some popup blockers may prevent this from happening, in which case the link will be displayed.', 'formidable' ),
2786 2786
 		);
2787 2787
 
2788
-		if ( ! isset( $tooltips[ $name ] ) ) {
2788
+		if ( ! isset( $tooltips[$name] ) ) {
2789 2789
 			return;
2790 2790
 		}
2791 2791
 
@@ -2795,7 +2795,7 @@  discard block
 block discarded – undo
2795 2795
 			echo ' class="frm_help"';
2796 2796
 		}
2797 2797
 
2798
-		echo ' title="' . esc_attr( $tooltips[ $name ] );
2798
+		echo ' title="' . esc_attr( $tooltips[$name] );
2799 2799
 
2800 2800
 		if ( 'open' != $class ) {
2801 2801
 			echo '"';
@@ -2854,13 +2854,13 @@  discard block
 block discarded – undo
2854 2854
 	}
2855 2855
 
2856 2856
 	private static function prepare_action_slashes( $val, $key, &$post_content ) {
2857
-		if ( ! isset( $post_content[ $key ] ) || is_numeric( $val ) ) {
2857
+		if ( ! isset( $post_content[$key] ) || is_numeric( $val ) ) {
2858 2858
 			return;
2859 2859
 		}
2860 2860
 
2861 2861
 		if ( is_array( $val ) ) {
2862 2862
 			foreach ( $val as $k1 => $v1 ) {
2863
-				self::prepare_action_slashes( $v1, $k1, $post_content[ $key ] );
2863
+				self::prepare_action_slashes( $v1, $k1, $post_content[$key] );
2864 2864
 				unset( $k1, $v1 );
2865 2865
 			}
2866 2866
 		} else {
@@ -2868,7 +2868,7 @@  discard block
 block discarded – undo
2868 2868
 			$val = stripslashes( $val );
2869 2869
 
2870 2870
 			// Add backslashes before double quotes and forward slashes only
2871
-			$post_content[ $key ] = addcslashes( $val, '"\\/' );
2871
+			$post_content[$key] = addcslashes( $val, '"\\/' );
2872 2872
 		}
2873 2873
 	}
2874 2874
 
@@ -2989,14 +2989,14 @@  discard block
 block discarded – undo
2989 2989
 				continue;
2990 2990
 			}
2991 2991
 			$key = $input['name'];
2992
-			if ( isset( $formatted[ $key ] ) ) {
2993
-				if ( is_array( $formatted[ $key ] ) ) {
2994
-					$formatted[ $key ][] = $input['value'];
2992
+			if ( isset( $formatted[$key] ) ) {
2993
+				if ( is_array( $formatted[$key] ) ) {
2994
+					$formatted[$key][] = $input['value'];
2995 2995
 				} else {
2996
-					$formatted[ $key ] = array( $formatted[ $key ], $input['value'] );
2996
+					$formatted[$key] = array( $formatted[$key], $input['value'] );
2997 2997
 				}
2998 2998
 			} else {
2999
-				$formatted[ $key ] = $input['value'];
2999
+				$formatted[$key] = $input['value'];
3000 3000
 			}
3001 3001
 		}
3002 3002
 
@@ -3693,8 +3693,8 @@  discard block
 block discarded – undo
3693 3693
 		}
3694 3694
 
3695 3695
 		foreach ( $keys as $key ) {
3696
-			if ( isset( $values[ $key ] ) ) {
3697
-				$values[ $key ] = self::kses( $values[ $key ], 'all' );
3696
+			if ( isset( $values[$key] ) ) {
3697
+				$values[$key] = self::kses( $values[$key], 'all' );
3698 3698
 			}
3699 3699
 		}
3700 3700
 
@@ -3853,7 +3853,7 @@  discard block
 block discarded – undo
3853 3853
 			return 0;
3854 3854
 		}
3855 3855
 
3856
-		return strlen( $parts[ count( $parts ) - 1 ] );
3856
+		return strlen( $parts[count( $parts ) - 1] );
3857 3857
 	}
3858 3858
 
3859 3859
 	/**
Please login to merge, or discard this patch.
stripe/controllers/FrmStrpLiteEventsController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -464,8 +464,8 @@
 block discarded – undo
464 464
 			'charge.refunded'               => 'refunded',
465 465
 		);
466 466
 
467
-		if ( isset( $events[ $this->event->type ] ) ) {
468
-			$this->status = $events[ $this->event->type ];
467
+		if ( isset( $events[$this->event->type] ) ) {
468
+			$this->status = $events[$this->event->type];
469 469
 			$this->set_payment_status();
470 470
 		} elseif ( $this->event->type === 'customer.deleted' ) {
471 471
 			$this->reset_customer();
Please login to merge, or discard this patch.
stripe/controllers/FrmTransLiteListsController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -100,7 +100,7 @@
 block discarded – undo
100 100
 			'sort'   => '',
101 101
 			'sdir'   => '',
102 102
 		) as $var => $default ) {
103
-			$values[ $var ] = FrmAppHelper::get_param( $var, $default );
103
+			$values[$var] = FrmAppHelper::get_param( $var, $default );
104 104
 		}
105 105
 
106 106
 		return $values;
Please login to merge, or discard this patch.
stripe/controllers/FrmStrpLiteActionsController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 			$gateway   = $payment_action->post_content['gateway'];
48 48
 			$is_stripe = $gateway === 'stripe' || ( is_array( $gateway ) && in_array( 'stripe', $gateway, true ) );
49 49
 			if ( ! $is_stripe || empty( $payment_action->post_content['amount'] ) ) {
50
-				unset( $payment_actions[ $k ] );
50
+				unset( $payment_actions[$k] );
51 51
 			}
52 52
 		}
53 53
 		return $payment_actions;
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 			'run_triggers' => false,
88 88
 			'show_errors'  => true,
89 89
 		);
90
-		$atts     = compact( 'action', 'entry', 'form' );
90
+		$atts = compact( 'action', 'entry', 'form' );
91 91
 
92 92
 		$amount = self::prepare_amount( $action->post_content['amount'], $atts );
93 93
 		if ( empty( $amount ) || $amount == 000 ) {
@@ -508,7 +508,7 @@  discard block
 block discarded – undo
508 508
 		$disallowed = array( ';', ':', '!important' );
509 509
 		foreach ( $settings as $k => $s ) {
510 510
 			if ( is_string( $s ) ) {
511
-				$settings[ $k ] = str_replace( $disallowed, '', $s );
511
+				$settings[$k] = str_replace( $disallowed, '', $s );
512 512
 			}
513 513
 		}
514 514
 
Please login to merge, or discard this patch.