Completed
Pull Request — master (#1580)
by Stephanie
39s
created
classes/models/FrmEntry.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 			$metas       = FrmEntryMeta::get_entry_meta_info( $entry_exist );
81 81
 			$field_metas = array();
82 82
 			foreach ( $metas as $meta ) {
83
-				$field_metas[ $meta->field_id ] = $meta->meta_value;
83
+				$field_metas[$meta->field_id] = $meta->meta_value;
84 84
 			}
85 85
 
86 86
 			$filtered_vals = array_filter( $values['item_meta'] );
@@ -136,10 +136,10 @@  discard block
 block discarded – undo
136 136
 		$reduced = array();
137 137
 		foreach ( $filter_vals as $field_id => $value ) {
138 138
 			$field                = FrmFieldFactory::get_field_object( $field_id );
139
-			$reduced[ $field_id ] = $field->get_value_to_save( $value, array( 'entry_id' => $entry_id ) );
140
-			$reduced[ $field_id ] = $field->set_value_before_save( $reduced[ $field_id ] );
141
-			if ( '' === $reduced[ $field_id ] || ( is_array( $reduced[ $field_id ] ) && 0 === count( $reduced[ $field_id ] ) ) ) {
142
-				unset( $reduced[ $field_id ] );
139
+			$reduced[$field_id] = $field->get_value_to_save( $value, array( 'entry_id' => $entry_id ) );
140
+			$reduced[$field_id] = $field->set_value_before_save( $reduced[$field_id] );
141
+			if ( '' === $reduced[$field_id] || ( is_array( $reduced[$field_id] ) && 0 === count( $reduced[$field_id] ) ) ) {
142
+				unset( $reduced[$field_id] );
143 143
 			}
144 144
 		}
145 145
 		return $reduced;
@@ -354,7 +354,7 @@  discard block
 block discarded – undo
354 354
 		$query = "SELECT it.*, fr.name as form_name, fr.form_key as form_key FROM {$wpdb->prefix}frm_items it
355 355
                   LEFT OUTER JOIN {$wpdb->prefix}frm_forms fr ON it.form_id=fr.id WHERE ";
356 356
 
357
-		$query      .= is_numeric( $id ) ? 'it.id=%d' : 'it.item_key=%s';
357
+		$query .= is_numeric( $id ) ? 'it.id=%d' : 'it.item_key=%s';
358 358
 		$query_args = array( $id );
359 359
 		$query      = $wpdb->prepare( $query, $query_args ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
360 360
 
@@ -399,7 +399,7 @@  discard block
 block discarded – undo
399 399
 	private static function prepare_entries( &$entries ) {
400 400
 		foreach ( $entries as $k => $entry ) {
401 401
 			self::prepare_entry( $entry );
402
-			$entries[ $k ] = $entry;
402
+			$entries[$k] = $entry;
403 403
 		}
404 404
 	}
405 405
 
@@ -425,19 +425,19 @@  discard block
 block discarded – undo
425 425
 			FrmFieldsHelper::prepare_field_value( $meta_val->meta_value, $meta_val->type );
426 426
 
427 427
 			if ( $meta_val->item_id == $entry->id ) {
428
-				$entry->metas[ $meta_val->field_id ] = $meta_val->meta_value;
428
+				$entry->metas[$meta_val->field_id] = $meta_val->meta_value;
429 429
 				if ( $include_key ) {
430
-					$entry->metas[ $meta_val->field_key ] = $entry->metas[ $meta_val->field_id ];
430
+					$entry->metas[$meta_val->field_key] = $entry->metas[$meta_val->field_id];
431 431
 				}
432 432
 				continue;
433 433
 			}
434 434
 
435 435
 			// include sub entries in an array
436
-			if ( ! isset( $entry->metas[ $meta_val->field_id ] ) ) {
437
-				$entry->metas[ $meta_val->field_id ] = array();
436
+			if ( ! isset( $entry->metas[$meta_val->field_id] ) ) {
437
+				$entry->metas[$meta_val->field_id] = array();
438 438
 			}
439 439
 
440
-			$entry->metas[ $meta_val->field_id ][] = $meta_val->meta_value;
440
+			$entry->metas[$meta_val->field_id][] = $meta_val->meta_value;
441 441
 
442 442
 			unset( $meta_val );
443 443
 		}
@@ -484,7 +484,7 @@  discard block
 block discarded – undo
484 484
 
485 485
 			if ( $inc_form ) {
486 486
 				$fields = 'it.*, fr.name as form_name,fr.form_key as form_key';
487
-				$table  .= 'LEFT OUTER JOIN ' . $wpdb->prefix . 'frm_forms fr ON it.form_id=fr.id ';
487
+				$table .= 'LEFT OUTER JOIN ' . $wpdb->prefix . 'frm_forms fr ON it.form_id=fr.id ';
488 488
 			}
489 489
 
490 490
 			if ( preg_match( '/ meta_([0-9]+)/', $order_by, $order_matches ) ) {
@@ -532,16 +532,16 @@  discard block
 block discarded – undo
532 532
 		}
533 533
 
534 534
 		foreach ( $metas as $m_key => $meta_val ) {
535
-			if ( ! isset( $entries[ $meta_val->item_id ] ) ) {
535
+			if ( ! isset( $entries[$meta_val->item_id] ) ) {
536 536
 				continue;
537 537
 			}
538 538
 
539
-			if ( ! isset( $entries[ $meta_val->item_id ]->metas ) ) {
540
-				$entries[ $meta_val->item_id ]->metas = array();
539
+			if ( ! isset( $entries[$meta_val->item_id]->metas ) ) {
540
+				$entries[$meta_val->item_id]->metas = array();
541 541
 			}
542 542
 
543 543
 			FrmFieldsHelper::prepare_field_value( $meta_val->meta_value, $meta_val->type );
544
-			$entries[ $meta_val->item_id ]->metas[ $meta_val->field_id ] = $meta_val->meta_value;
544
+			$entries[$meta_val->item_id]->metas[$meta_val->field_id] = $meta_val->meta_value;
545 545
 			unset( $m_key, $meta_val );
546 546
 		}
547 547
 
@@ -719,7 +719,7 @@  discard block
 block discarded – undo
719 719
 	}
720 720
 
721 721
 	private static function get_entry_value( $values, $name, $default ) {
722
-		return isset( $values[ $name ] ) ? $values[ $name ] : $default;
722
+		return isset( $values[$name] ) ? $values[$name] : $default;
723 723
 	}
724 724
 
725 725
 	/**
@@ -900,7 +900,7 @@  discard block
 block discarded – undo
900 900
 	private static function maybe_add_captcha_meta( $form_id, $entry_id ) {
901 901
 		global $frm_vars;
902 902
 		if ( array_key_exists( 'captcha_scores', $frm_vars ) && array_key_exists( $form_id, $frm_vars['captcha_scores'] ) ) {
903
-			$captcha_score_meta = array( 'captcha_score' => $frm_vars['captcha_scores'][ $form_id ] );
903
+			$captcha_score_meta = array( 'captcha_score' => $frm_vars['captcha_scores'][$form_id] );
904 904
 			FrmEntryMeta::add_entry_meta( $entry_id, 0, '', maybe_serialize( $captcha_score_meta ) );
905 905
 		}
906 906
 	}
Please login to merge, or discard this patch.
classes/helpers/FrmStringReaderHelper.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 
79 79
 		while ( $count > 0 && ! is_null( $one = $this->read_one() ) ) {
80 80
 			$value .= $one;
81
-			--$count;
81
+			-- $count;
82 82
 		}
83 83
 
84 84
 		return $this->strip_quotes( $value );
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
 	 */
93 93
 	private function read_one() {
94 94
 		if ( $this->pos <= $this->max ) {
95
-			$value = $this->string[ $this->pos ];
95
+			$value = $this->string[$this->pos];
96 96
 			$this->pos += 1;
97 97
 		} else {
98 98
 			$value = null;
Please login to merge, or discard this patch.
classes/helpers/FrmSerializedStringParserHelper.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -65,12 +65,12 @@
 block discarded – undo
65 65
 				$string->read( 1 );
66 66
 
67 67
 				$val = array();
68
-				for ( $i = 0; $i < $count; $i++ ) {
68
+				for ( $i = 0; $i < $count; $i ++ ) {
69 69
 					$array_key   = $this->do_parse( $string );
70 70
 					$array_value = $this->do_parse( $string );
71 71
 
72 72
 					if ( ! is_array( $array_key ) ) {
73
-						$val[ $array_key ] = $array_value;
73
+						$val[$array_key] = $array_value;
74 74
 					}
75 75
 				}
76 76
 
Please login to merge, or discard this patch.
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/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
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
 			'fill'   => '#4d4d4d',
200 200
 			'orange' => '#f05a24',
201 201
 		);
202
-		$atts     = array_merge( $defaults, $atts );
202
+		$atts = array_merge( $defaults, $atts );
203 203
 
204 204
 		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'] ) . '">
205 205
 			<path fill="' . esc_attr( $atts['orange'] ) . '" d="M289.6 384h140v76h-140z"/>
@@ -417,7 +417,7 @@  discard block
 block discarded – undo
417 417
 	 * @return string
418 418
 	 */
419 419
 	public static function get_server_value( $value ) {
420
-		return isset( $_SERVER[ $value ] ) ? wp_strip_all_tags( wp_unslash( $_SERVER[ $value ] ) ) : '';
420
+		return isset( $_SERVER[$value] ) ? wp_strip_all_tags( wp_unslash( $_SERVER[$value] ) ) : '';
421 421
 	}
422 422
 
423 423
 	/**
@@ -451,7 +451,7 @@  discard block
 block discarded – undo
451 451
 		$ip         = '';
452 452
 
453 453
 		foreach ( $ip_options as $key ) {
454
-			if ( ! isset( $_SERVER[ $key ] ) ) {
454
+			if ( ! isset( $_SERVER[$key] ) ) {
455 455
 				continue;
456 456
 			}
457 457
 
@@ -520,10 +520,10 @@  discard block
 block discarded – undo
520 520
 		}
521 521
 
522 522
 		if ( $src === 'get' ) {
523
-			$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
524
-			if ( ! isset( $_POST[ $param ] ) && isset( $_GET[ $param ] ) && ! is_array( $value ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
523
+			$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
524
+			if ( ! isset( $_POST[$param] ) && isset( $_GET[$param] ) && ! is_array( $value ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
525 525
 				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
526
-				$value = htmlspecialchars_decode( wp_unslash( $_GET[ $param ] ) );
526
+				$value = htmlspecialchars_decode( wp_unslash( $_GET[$param] ) );
527 527
 			}
528 528
 			self::sanitize_value( $sanitize, $value );
529 529
 		} else {
@@ -544,7 +544,7 @@  discard block
 block discarded – undo
544 544
 				}
545 545
 
546 546
 				$p     = trim( $p, ']' );
547
-				$value = isset( $value[ $p ] ) ? $value[ $p ] : $default;
547
+				$value = isset( $value[$p] ) ? $value[$p] : $default;
548 548
 			}
549 549
 		}
550 550
 
@@ -600,26 +600,26 @@  discard block
 block discarded – undo
600 600
 			'sanitize' => 'sanitize_text_field',
601 601
 			'serialized' => false,
602 602
 		);
603
-		$args     = wp_parse_args( $args, $defaults );
603
+		$args = wp_parse_args( $args, $defaults );
604 604
 
605 605
 		$value = $args['default'];
606 606
 		if ( $args['type'] === 'get' ) {
607
-			if ( $_GET && isset( $_GET[ $args['param'] ] ) ) {
607
+			if ( $_GET && isset( $_GET[$args['param']] ) ) {
608 608
 				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
609
-				$value = wp_unslash( $_GET[ $args['param'] ] );
609
+				$value = wp_unslash( $_GET[$args['param']] );
610 610
 			}
611 611
 		} elseif ( $args['type'] === 'post' ) {
612
-			if ( isset( $_POST[ $args['param'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
612
+			if ( isset( $_POST[$args['param']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
613 613
 				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
614
-				$value = wp_unslash( $_POST[ $args['param'] ] );
614
+				$value = wp_unslash( $_POST[$args['param']] );
615 615
 				if ( $args['serialized'] === true && is_serialized_string( $value ) && is_serialized( $value ) ) {
616 616
 					self::unserialize_or_decode( $value );
617 617
 				}
618 618
 			}
619 619
 		} else {
620
-			if ( isset( $_REQUEST[ $args['param'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
620
+			if ( isset( $_REQUEST[$args['param']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
621 621
 				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
622
-				$value = wp_unslash( $_REQUEST[ $args['param'] ] );
622
+				$value = wp_unslash( $_REQUEST[$args['param']] );
623 623
 			}
624 624
 		}
625 625
 
@@ -667,7 +667,7 @@  discard block
 block discarded – undo
667 667
 		if ( is_array( $value ) ) {
668 668
 			$temp_values = $value;
669 669
 			foreach ( $temp_values as $k => $v ) {
670
-				self::sanitize_value( $sanitize, $value[ $k ] );
670
+				self::sanitize_value( $sanitize, $value[$k] );
671 671
 			}
672 672
 			return;
673 673
 		}
@@ -678,8 +678,8 @@  discard block
 block discarded – undo
678 678
 	public static function sanitize_request( $sanitize_method, &$values ) {
679 679
 		$temp_values = $values;
680 680
 		foreach ( $temp_values as $k => $val ) {
681
-			if ( isset( $sanitize_method[ $k ] ) ) {
682
-				$values[ $k ] = call_user_func( $sanitize_method[ $k ], $val );
681
+			if ( isset( $sanitize_method[$k] ) ) {
682
+				$values[$k] = call_user_func( $sanitize_method[$k], $val );
683 683
 			}
684 684
 		}
685 685
 	}
@@ -739,7 +739,7 @@  discard block
 block discarded – undo
739 739
 		if ( is_array( $value ) ) {
740 740
 			$temp_values = $value;
741 741
 			foreach ( $temp_values as $k => $v ) {
742
-				self::decode_specialchars( $value[ $k ] );
742
+				self::decode_specialchars( $value[$k] );
743 743
 			}
744 744
 		} else {
745 745
 			self::decode_amp( $value );
@@ -861,7 +861,7 @@  discard block
 block discarded – undo
861 861
 	 * @return array
862 862
 	 */
863 863
 	public static function add_allowed_submit_button_tags( $allowed_html ) {
864
-		$allowed_html['input']                    = array(
864
+		$allowed_html['input'] = array(
865 865
 			'type'           => true,
866 866
 			'value'          => true,
867 867
 			'formnovalidate' => true,
@@ -884,7 +884,7 @@  discard block
 block discarded – undo
884 884
 			$allowed_html = $html;
885 885
 		} elseif ( ! empty( $allowed ) ) {
886 886
 			foreach ( (array) $allowed as $a ) {
887
-				$allowed_html[ $a ] = isset( $html[ $a ] ) ? $html[ $a ] : array();
887
+				$allowed_html[$a] = isset( $html[$a] ) ? $html[$a] : array();
888 888
 			}
889 889
 		}
890 890
 
@@ -1063,8 +1063,8 @@  discard block
 block discarded – undo
1063 1063
 		}
1064 1064
 
1065 1065
 		global $wp_query;
1066
-		if ( isset( $wp_query->query_vars[ $param ] ) ) {
1067
-			$value = $wp_query->query_vars[ $param ];
1066
+		if ( isset( $wp_query->query_vars[$param] ) ) {
1067
+			$value = $wp_query->query_vars[$param];
1068 1068
 		}
1069 1069
 
1070 1070
 		return $value;
@@ -1093,9 +1093,9 @@  discard block
 block discarded – undo
1093 1093
 			'frm_keyalt_icon'       => 'frm_key_icon',
1094 1094
 			'frm_keyalt_solid_icon' => 'frm_key_solid_icon',
1095 1095
 		);
1096
-		if ( isset( $deprecated[ $icon ] ) ) {
1097
-			$icon  = $deprecated[ $icon ];
1098
-			$class = str_replace( $icon, $deprecated[ $icon ], $class );
1096
+		if ( isset( $deprecated[$icon] ) ) {
1097
+			$icon  = $deprecated[$icon];
1098
+			$class = str_replace( $icon, $deprecated[$icon], $class );
1099 1099
 		}
1100 1100
 
1101 1101
 		if ( $icon === $class ) {
@@ -1442,7 +1442,7 @@  discard block
 block discarded – undo
1442 1442
 				'new_file_path' => self::plugin_path() . '/js',
1443 1443
 			)
1444 1444
 		);
1445
-		$new_file  = new FrmCreateFile( $file_atts );
1445
+		$new_file = new FrmCreateFile( $file_atts );
1446 1446
 
1447 1447
 		$files = array(
1448 1448
 			self::plugin_path() . '/js/formidable.min.js',
@@ -1461,7 +1461,7 @@  discard block
 block discarded – undo
1461 1461
 				'new_file_path' => self::plugin_path() . '/js',
1462 1462
 			)
1463 1463
 		);
1464
-		$new_file  = new FrmCreateFile( $file_atts );
1464
+		$new_file = new FrmCreateFile( $file_atts );
1465 1465
 		$files = array(
1466 1466
 			FrmStrpLiteAppHelper::plugin_path() . 'js/frmstrp.min.js',
1467 1467
 		);
@@ -1952,8 +1952,8 @@  discard block
 block discarded – undo
1952 1952
 			return $error;
1953 1953
 		}
1954 1954
 
1955
-		$nonce_value = ( $_REQUEST && isset( $_REQUEST[ $nonce_name ] ) ) ? sanitize_text_field( wp_unslash( $_REQUEST[ $nonce_name ] ) ) : '';
1956
-		if ( $_REQUEST && ( ! isset( $_REQUEST[ $nonce_name ] ) || ! wp_verify_nonce( $nonce_value, $nonce ) ) ) {
1955
+		$nonce_value = ( $_REQUEST && isset( $_REQUEST[$nonce_name] ) ) ? sanitize_text_field( wp_unslash( $_REQUEST[$nonce_name] ) ) : '';
1956
+		if ( $_REQUEST && ( ! isset( $_REQUEST[$nonce_name] ) || ! wp_verify_nonce( $nonce_value, $nonce ) ) ) {
1957 1957
 			$frm_settings = self::get_settings();
1958 1958
 			$error        = $frm_settings->admin_permission;
1959 1959
 		}
@@ -1988,7 +1988,7 @@  discard block
 block discarded – undo
1988 1988
 			} else {
1989 1989
 				foreach ( $value as $k => $v ) {
1990 1990
 					if ( ! is_array( $v ) ) {
1991
-						$value[ $k ] = call_user_func( $original_function, $v );
1991
+						$value[$k] = call_user_func( $original_function, $v );
1992 1992
 					}
1993 1993
 				}
1994 1994
 			}
@@ -2013,7 +2013,7 @@  discard block
 block discarded – undo
2013 2013
 				$return = array_merge( $return, self::array_flatten( $value, $keys ) );
2014 2014
 			} else {
2015 2015
 				if ( $keys === 'keep' ) {
2016
-					$return[ $key ] = $value;
2016
+					$return[$key] = $value;
2017 2017
 				} else {
2018 2018
 					$return[] = $value;
2019 2019
 				}
@@ -2066,11 +2066,11 @@  discard block
 block discarded – undo
2066 2066
 		}
2067 2067
 
2068 2068
 		$ver = $default;
2069
-		if ( ! isset( $wp_scripts->registered[ $handle ] ) ) {
2069
+		if ( ! isset( $wp_scripts->registered[$handle] ) ) {
2070 2070
 			return $ver;
2071 2071
 		}
2072 2072
 
2073
-		$query = $wp_scripts->registered[ $handle ];
2073
+		$query = $wp_scripts->registered[$handle];
2074 2074
 		if ( is_object( $query ) && ! empty( $query->ver ) ) {
2075 2075
 			$ver = $query->ver;
2076 2076
 		}
@@ -2176,7 +2176,7 @@  discard block
 block discarded – undo
2176 2176
 			$suffix = 2;
2177 2177
 			do {
2178 2178
 				$key_check = $key . $separator . $suffix;
2179
-				++$suffix;
2179
+				++ $suffix;
2180 2180
 			} while ( in_array( $key_check, $similar_keys, true ) );
2181 2181
 
2182 2182
 			$key = $key_check;
@@ -2284,7 +2284,7 @@  discard block
 block discarded – undo
2284 2284
 
2285 2285
 		foreach ( array( 'name', 'description' ) as $var ) {
2286 2286
 			$default_val    = isset( $record->{$var} ) ? $record->{$var} : '';
2287
-			$values[ $var ] = self::get_param( $var, $default_val, 'get', 'wp_kses_post' );
2287
+			$values[$var] = self::get_param( $var, $default_val, 'get', 'wp_kses_post' );
2288 2288
 			unset( $var, $default_val );
2289 2289
 		}
2290 2290
 
@@ -2342,9 +2342,9 @@  discard block
 block discarded – undo
2342 2342
 			}
2343 2343
 		}//end if
2344 2344
 
2345
-		$field_type = isset( $post_values['field_options'][ 'type_' . $field->id ] ) ? $post_values['field_options'][ 'type_' . $field->id ] : $field->type;
2346
-		if ( isset( $post_values['item_meta'][ $field->id ] ) ) {
2347
-			$new_value = $post_values['item_meta'][ $field->id ];
2345
+		$field_type = isset( $post_values['field_options']['type_' . $field->id] ) ? $post_values['field_options']['type_' . $field->id] : $field->type;
2346
+		if ( isset( $post_values['item_meta'][$field->id] ) ) {
2347
+			$new_value = $post_values['item_meta'][$field->id];
2348 2348
 			self::unserialize_or_decode( $new_value );
2349 2349
 		} else {
2350 2350
 			$new_value = $meta_value;
@@ -2365,7 +2365,7 @@  discard block
 block discarded – undo
2365 2365
 
2366 2366
 		$field_array = array_merge( (array) $field->field_options, $field_array );
2367 2367
 
2368
-		$values['fields'][ $field->id ] = $field_array;
2368
+		$values['fields'][$field->id] = $field_array;
2369 2369
 	}
2370 2370
 
2371 2371
 	/**
@@ -2415,11 +2415,11 @@  discard block
 block discarded – undo
2415 2415
 		}
2416 2416
 
2417 2417
 		foreach ( $form->options as $opt => $value ) {
2418
-			if ( isset( $post_values[ $opt ] ) ) {
2419
-				$values[ $opt ] = $post_values[ $opt ];
2420
-				self::unserialize_or_decode( $values[ $opt ] );
2418
+			if ( isset( $post_values[$opt] ) ) {
2419
+				$values[$opt] = $post_values[$opt];
2420
+				self::unserialize_or_decode( $values[$opt] );
2421 2421
 			} else {
2422
-				$values[ $opt ] = $value;
2422
+				$values[$opt] = $value;
2423 2423
 			}
2424 2424
 		}
2425 2425
 
@@ -2433,8 +2433,8 @@  discard block
 block discarded – undo
2433 2433
 		$form_defaults = FrmFormsHelper::get_default_opts();
2434 2434
 
2435 2435
 		foreach ( $form_defaults as $opt => $default ) {
2436
-			if ( ! isset( $values[ $opt ] ) || $values[ $opt ] == '' ) {
2437
-				$values[ $opt ] = ( $post_values && isset( $post_values['options'][ $opt ] ) ) ? $post_values['options'][ $opt ] : $default;
2436
+			if ( ! isset( $values[$opt] ) || $values[$opt] == '' ) {
2437
+				$values[$opt] = ( $post_values && isset( $post_values['options'][$opt] ) ) ? $post_values['options'][$opt] : $default;
2438 2438
 			}
2439 2439
 
2440 2440
 			unset( $opt, $default );
@@ -2445,8 +2445,8 @@  discard block
 block discarded – undo
2445 2445
 		}
2446 2446
 
2447 2447
 		foreach ( array( 'before', 'after', 'submit' ) as $h ) {
2448
-			if ( ! isset( $values[ $h . '_html' ] ) ) {
2449
-				$values[ $h . '_html' ] = ( isset( $post_values['options'][ $h . '_html' ] ) ? $post_values['options'][ $h . '_html' ] : FrmFormsHelper::get_default_html( $h ) );
2448
+			if ( ! isset( $values[$h . '_html'] ) ) {
2449
+				$values[$h . '_html'] = ( isset( $post_values['options'][$h . '_html'] ) ? $post_values['options'][$h . '_html'] : FrmFormsHelper::get_default_html( $h ) );
2450 2450
 			}
2451 2451
 			unset( $h );
2452 2452
 		}
@@ -2624,25 +2624,25 @@  discard block
 block discarded – undo
2624 2624
 		if ( ! is_numeric( $levels ) ) {
2625 2625
 			// Show time in specified unit.
2626 2626
 			$levels = self::get_unit( $levels );
2627
-			if ( isset( $time_strings[ $levels ] ) ) {
2627
+			if ( isset( $time_strings[$levels] ) ) {
2628 2628
 				$diff = array(
2629 2629
 					$levels => self::time_format( $levels, $diff ),
2630 2630
 				);
2631 2631
 				$time_strings = array(
2632
-					$levels => $time_strings[ $levels ],
2632
+					$levels => $time_strings[$levels],
2633 2633
 				);
2634 2634
 			}
2635 2635
 			$levels = 1;
2636 2636
 		}
2637 2637
 
2638 2638
 		foreach ( $time_strings as $k => $v ) {
2639
-			if ( isset( $diff[ $k ] ) && $diff[ $k ] ) {
2640
-				$time_strings[ $k ] = $diff[ $k ] . ' ' . ( $diff[ $k ] > 1 ? $v[1] : $v[0] );
2641
-			} elseif ( isset( $diff[ $k ] ) && count( $time_strings ) === 1 ) {
2639
+			if ( isset( $diff[$k] ) && $diff[$k] ) {
2640
+				$time_strings[$k] = $diff[$k] . ' ' . ( $diff[$k] > 1 ? $v[1] : $v[0] );
2641
+			} elseif ( isset( $diff[$k] ) && count( $time_strings ) === 1 ) {
2642 2642
 				// Account for 0.
2643
-				$time_strings[ $k ] = $diff[ $k ] . ' ' . $v[1];
2643
+				$time_strings[$k] = $diff[$k] . ' ' . $v[1];
2644 2644
 			} else {
2645
-				unset( $time_strings[ $k ] );
2645
+				unset( $time_strings[$k] );
2646 2646
 			}
2647 2647
 		}
2648 2648
 
@@ -2661,8 +2661,8 @@  discard block
 block discarded – undo
2661 2661
 			'y' => 'y',
2662 2662
 			'd' => 'days',
2663 2663
 		);
2664
-		if ( isset( $return[ $unit ] ) ) {
2665
-			return $diff[ $return[ $unit ] ];
2664
+		if ( isset( $return[$unit] ) ) {
2665
+			return $diff[$return[$unit]];
2666 2666
 		}
2667 2667
 
2668 2668
 		$total = $diff['days'] * self::convert_time( 'd', $unit );
@@ -2670,11 +2670,11 @@  discard block
 block discarded – undo
2670 2670
 		$times = array( 'h', 'i', 's' );
2671 2671
 
2672 2672
 		foreach ( $times as $time ) {
2673
-			if ( ! isset( $diff[ $time ] ) ) {
2673
+			if ( ! isset( $diff[$time] ) ) {
2674 2674
 				continue;
2675 2675
 			}
2676 2676
 
2677
-			$total += $diff[ $time ] * self::convert_time( $time, $unit );
2677
+			$total += $diff[$time] * self::convert_time( $time, $unit );
2678 2678
 		}
2679 2679
 
2680 2680
 		return floor( $total );
@@ -2694,7 +2694,7 @@  discard block
 block discarded – undo
2694 2694
 			'y' => DAY_IN_SECONDS * 365.25,
2695 2695
 		);
2696 2696
 
2697
-		return $convert[ $from ] / $convert[ $to ];
2697
+		return $convert[$from] / $convert[$to];
2698 2698
 	}
2699 2699
 
2700 2700
 	/**
@@ -2702,7 +2702,7 @@  discard block
 block discarded – undo
2702 2702
 	 */
2703 2703
 	private static function get_unit( $unit ) {
2704 2704
 		$units = self::get_time_strings();
2705
-		if ( isset( $units[ $unit ] ) || is_numeric( $unit ) ) {
2705
+		if ( isset( $units[$unit] ) || is_numeric( $unit ) ) {
2706 2706
 			return $unit;
2707 2707
 		}
2708 2708
 
@@ -2819,17 +2819,17 @@  discard block
 block discarded – undo
2819 2819
 
2820 2820
 					case 1:
2821 2821
 						$l2 = $name;
2822
-						self::add_value_to_array( $name, $l2, $this_val, $vars[ $l1 ] );
2822
+						self::add_value_to_array( $name, $l2, $this_val, $vars[$l1] );
2823 2823
 						break;
2824 2824
 
2825 2825
 					case 2:
2826 2826
 						$l3 = $name;
2827
-						self::add_value_to_array( $name, $l3, $this_val, $vars[ $l1 ][ $l2 ] );
2827
+						self::add_value_to_array( $name, $l3, $this_val, $vars[$l1][$l2] );
2828 2828
 						break;
2829 2829
 
2830 2830
 					case 3:
2831 2831
 						$l4 = $name;
2832
-						self::add_value_to_array( $name, $l4, $this_val, $vars[ $l1 ][ $l2 ][ $l3 ] );
2832
+						self::add_value_to_array( $name, $l4, $this_val, $vars[$l1][$l2][$l3] );
2833 2833
 				}
2834 2834
 
2835 2835
 				unset( $this_val, $n );
@@ -2848,8 +2848,8 @@  discard block
 block discarded – undo
2848 2848
 	public static function add_value_to_array( $name, $l1, $val, &$vars ) {
2849 2849
 		if ( $name == '' ) {
2850 2850
 			$vars[] = $val;
2851
-		} elseif ( ! isset( $vars[ $l1 ] ) ) {
2852
-			$vars[ $l1 ] = $val;
2851
+		} elseif ( ! isset( $vars[$l1] ) ) {
2852
+			$vars[$l1] = $val;
2853 2853
 		}
2854 2854
 	}
2855 2855
 
@@ -2866,7 +2866,7 @@  discard block
 block discarded – undo
2866 2866
 			'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' ),
2867 2867
 		);
2868 2868
 
2869
-		if ( ! isset( $tooltips[ $name ] ) ) {
2869
+		if ( ! isset( $tooltips[$name] ) ) {
2870 2870
 			return;
2871 2871
 		}
2872 2872
 
@@ -2876,7 +2876,7 @@  discard block
 block discarded – undo
2876 2876
 			echo ' class="frm_help"';
2877 2877
 		}
2878 2878
 
2879
-		echo ' title="' . esc_attr( $tooltips[ $name ] );
2879
+		echo ' title="' . esc_attr( $tooltips[$name] );
2880 2880
 
2881 2881
 		if ( 'open' != $class ) {
2882 2882
 			echo '"';
@@ -2935,13 +2935,13 @@  discard block
 block discarded – undo
2935 2935
 	}
2936 2936
 
2937 2937
 	private static function prepare_action_slashes( $val, $key, &$post_content ) {
2938
-		if ( ! isset( $post_content[ $key ] ) || is_numeric( $val ) ) {
2938
+		if ( ! isset( $post_content[$key] ) || is_numeric( $val ) ) {
2939 2939
 			return;
2940 2940
 		}
2941 2941
 
2942 2942
 		if ( is_array( $val ) ) {
2943 2943
 			foreach ( $val as $k1 => $v1 ) {
2944
-				self::prepare_action_slashes( $v1, $k1, $post_content[ $key ] );
2944
+				self::prepare_action_slashes( $v1, $k1, $post_content[$key] );
2945 2945
 				unset( $k1, $v1 );
2946 2946
 			}
2947 2947
 		} else {
@@ -2949,7 +2949,7 @@  discard block
 block discarded – undo
2949 2949
 			$val = stripslashes( $val );
2950 2950
 
2951 2951
 			// Add backslashes before double quotes and forward slashes only
2952
-			$post_content[ $key ] = addcslashes( $val, '"\\/' );
2952
+			$post_content[$key] = addcslashes( $val, '"\\/' );
2953 2953
 		}
2954 2954
 	}
2955 2955
 
@@ -3070,14 +3070,14 @@  discard block
 block discarded – undo
3070 3070
 				continue;
3071 3071
 			}
3072 3072
 			$key = $input['name'];
3073
-			if ( isset( $formatted[ $key ] ) ) {
3074
-				if ( is_array( $formatted[ $key ] ) ) {
3075
-					$formatted[ $key ][] = $input['value'];
3073
+			if ( isset( $formatted[$key] ) ) {
3074
+				if ( is_array( $formatted[$key] ) ) {
3075
+					$formatted[$key][] = $input['value'];
3076 3076
 				} else {
3077
-					$formatted[ $key ] = array( $formatted[ $key ], $input['value'] );
3077
+					$formatted[$key] = array( $formatted[$key], $input['value'] );
3078 3078
 				}
3079 3079
 			} else {
3080
-				$formatted[ $key ] = $input['value'];
3080
+				$formatted[$key] = $input['value'];
3081 3081
 			}
3082 3082
 		}
3083 3083
 
@@ -3777,8 +3777,8 @@  discard block
 block discarded – undo
3777 3777
 		}
3778 3778
 
3779 3779
 		foreach ( $keys as $key ) {
3780
-			if ( isset( $values[ $key ] ) ) {
3781
-				$values[ $key ] = self::kses( $values[ $key ], 'all' );
3780
+			if ( isset( $values[$key] ) ) {
3781
+				$values[$key] = self::kses( $values[$key], 'all' );
3782 3782
 			}
3783 3783
 		}
3784 3784
 
@@ -3937,7 +3937,7 @@  discard block
 block discarded – undo
3937 3937
 			return 0;
3938 3938
 		}
3939 3939
 
3940
-		return strlen( $parts[ count( $parts ) - 1 ] );
3940
+		return strlen( $parts[count( $parts ) - 1] );
3941 3941
 	}
3942 3942
 
3943 3943
 	/**
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.