Completed
Pull Request — master (#1580)
by Stephanie
47s
created
stripe/controllers/FrmStrpLiteActionsController.php 1 patch
Spacing   +8 added lines, -8 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;
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 			'run_triggers' => false,
85 85
 			'show_errors'  => true,
86 86
 		);
87
-		$atts     = compact( 'action', 'entry', 'form' );
87
+		$atts = compact( 'action', 'entry', 'form' );
88 88
 
89 89
 		$amount = self::prepare_amount( $action->post_content['amount'], $atts );
90 90
 		if ( empty( $amount ) || $amount == 000 ) {
@@ -502,7 +502,7 @@  discard block
 block discarded – undo
502 502
 		$disallowed = array( ';', ':', '!important' );
503 503
 		foreach ( $settings as $k => $s ) {
504 504
 			if ( is_string( $s ) ) {
505
-				$settings[ $k ] = str_replace( $disallowed, '', $s );
505
+				$settings[$k] = str_replace( $disallowed, '', $s );
506 506
 			}
507 507
 		}
508 508
 
@@ -574,18 +574,18 @@  discard block
 block discarded – undo
574 574
 	 * @return array
575 575
 	 */
576 576
 	public static function remove_cc_validation( $errors, $field, $values ) {
577
-		$has_processed = isset( $_POST[ 'frmintent' . $field->form_id ] ); // phpcs:ignore WordPress.Security.NonceVerification.Missing
577
+		$has_processed = isset( $_POST['frmintent' . $field->form_id] ); // phpcs:ignore WordPress.Security.NonceVerification.Missing
578 578
 		if ( ! $has_processed ) {
579 579
 			return $errors;
580 580
 		}
581 581
 
582 582
 		$field_id = isset( $field->temp_id ) ? $field->temp_id : $field->id;
583 583
 
584
-		if ( isset( $errors[ 'field' . $field_id . '-cc' ] ) ) {
585
-			unset( $errors[ 'field' . $field_id . '-cc' ] );
584
+		if ( isset( $errors['field' . $field_id . '-cc'] ) ) {
585
+			unset( $errors['field' . $field_id . '-cc'] );
586 586
 		}
587
-		if ( isset( $errors[ 'field' . $field_id ] ) ) {
588
-			unset( $errors[ 'field' . $field_id ] );
587
+		if ( isset( $errors['field' . $field_id] ) ) {
588
+			unset( $errors['field' . $field_id] );
589 589
 		}
590 590
 
591 591
 		return $errors;
Please login to merge, or discard this patch.
classes/models/FrmEntryFormatter.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -164,8 +164,8 @@  discard block
 block discarded – undo
164 164
 
165 165
 		$conditionally_add = array( 'include_fields', 'fields', 'exclude_fields', 'entry' );
166 166
 		foreach ( $conditionally_add as $index ) {
167
-			if ( isset( $atts[ $index ] ) ) {
168
-				$entry_atts[ $index ] = $atts[ $index ];
167
+			if ( isset( $atts[$index] ) ) {
168
+				$entry_atts[$index] = $atts[$index];
169 169
 			}
170 170
 		}
171 171
 
@@ -351,8 +351,8 @@  discard block
 block discarded – undo
351 351
 
352 352
 		$unset = array( 'id', 'form_id', 'format' );
353 353
 		foreach ( $unset as $param ) {
354
-			if ( isset( $atts[ $param ] ) ) {
355
-				unset( $atts[ $param ] );
354
+			if ( isset( $atts[$param] ) ) {
355
+				unset( $atts[$param] );
356 356
 			}
357 357
 		}
358 358
 
@@ -523,11 +523,11 @@  discard block
 block discarded – undo
523 523
 
524 524
 			$displayed_value = $this->prepare_display_value_for_array( $field_value->get_displayed_value() );
525 525
 
526
-			$output[ $this->get_key_or_id( $field_value ) ] = $displayed_value;
526
+			$output[$this->get_key_or_id( $field_value )] = $displayed_value;
527 527
 
528 528
 			$has_separate_value = (bool) $field_value->get_field_option( 'separate_value' );
529 529
 			if ( $has_separate_value || $displayed_value !== $field_value->get_saved_value() ) {
530
-				$output[ $this->get_key_or_id( $field_value ) . '-value' ] = $field_value->get_saved_value();
530
+				$output[$this->get_key_or_id( $field_value ) . '-value'] = $field_value->get_saved_value();
531 531
 			}
532 532
 		}
533 533
 	}
@@ -917,7 +917,7 @@  discard block
 block discarded – undo
917 917
 
918 918
 			if ( is_array( $value ) ) {
919 919
 				foreach ( $value as $key => $single_value ) {
920
-					$value[ $key ] = $this->strip_html( $single_value );
920
+					$value[$key] = $this->strip_html( $single_value );
921 921
 				}
922 922
 			} elseif ( $this->is_plain_text && ! is_array( $value ) ) {
923 923
 				if ( strpos( $value, '<img' ) !== false ) {
Please login to merge, or discard this patch.
classes/controllers/FrmFormTemplatesController.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -330,11 +330,11 @@  discard block
 block discarded – undo
330 330
 
331 331
 		// Perform add or remove operation.
332 332
 		if ( 'add' === $operation ) {
333
-			self::$favorite_templates[ $key ][] = $template_id;
333
+			self::$favorite_templates[$key][] = $template_id;
334 334
 		} elseif ( 'remove' === $operation ) {
335
-			$position = array_search( $template_id, self::$favorite_templates[ $key ], true );
335
+			$position = array_search( $template_id, self::$favorite_templates[$key], true );
336 336
 			if ( $position !== false ) {
337
-				unset( self::$favorite_templates[ $key ][ $position ] );
337
+				unset( self::$favorite_templates[$key][$position] );
338 338
 			}
339 339
 		}
340 340
 
@@ -463,7 +463,7 @@  discard block
 block discarded – undo
463 463
 		foreach ( self::$templates as $key => &$template ) {
464 464
 			// Skip the template if the categories are not set.
465 465
 			if ( ! isset( $template['categories'] ) ) {
466
-				unset( self::$templates[ $key ] );
466
+				unset( self::$templates[$key] );
467 467
 				continue;
468 468
 			}
469 469
 
@@ -477,14 +477,14 @@  discard block
 block discarded – undo
477 477
 				// Add the slug to the new array.
478 478
 				$template['category_slugs'][] = $category_slug;
479 479
 
480
-				if ( ! isset( self::$categories[ $category_slug ] ) ) {
481
-					self::$categories[ $category_slug ] = array(
480
+				if ( ! isset( self::$categories[$category_slug] ) ) {
481
+					self::$categories[$category_slug] = array(
482 482
 						'name'  => $category,
483 483
 						'count' => 0,
484 484
 					);
485 485
 				}
486 486
 
487
-				self::$categories[ $category_slug ]['count']++;
487
+				self::$categories[$category_slug]['count'] ++;
488 488
 			}
489 489
 
490 490
 			// Mark the template as favorite if it's in the favorite templates list.
@@ -499,7 +499,7 @@  discard block
 block discarded – undo
499 499
 		$redundant_cats = array_merge( array( 'PayPal', 'Stripe', 'Twilio' ), FrmFormsHelper::ignore_template_categories() );
500 500
 		foreach ( $redundant_cats as $redundant_cat ) {
501 501
 			$category_slug = sanitize_title( $redundant_cat );
502
-			unset( self::$categories[ $category_slug ] );
502
+			unset( self::$categories[$category_slug] );
503 503
 		}
504 504
 
505 505
 		// Sort the categories by keys alphabetically.
@@ -524,7 +524,7 @@  discard block
 block discarded – undo
524 524
 				'count' => 0,
525 525
 			);
526 526
 		}
527
-		$special_categories['all-templates']  = array(
527
+		$special_categories['all-templates'] = array(
528 528
 			'name'  => __( 'All Templates', 'formidable' ),
529 529
 			'count' => self::get_template_count(),
530 530
 		);
@@ -552,9 +552,9 @@  discard block
 block discarded – undo
552 552
 	 */
553 553
 	private static function assign_featured_templates() {
554 554
 		foreach ( self::FEATURED_TEMPLATES_KEYS as $key ) {
555
-			if ( isset( self::$templates[ $key ] ) ) {
556
-				self::$templates[ $key ]['is_featured'] = true;
557
-				self::$featured_templates[]             = self::$templates[ $key ];
555
+			if ( isset( self::$templates[$key] ) ) {
556
+				self::$templates[$key]['is_featured'] = true;
557
+				self::$featured_templates[]             = self::$templates[$key];
558 558
 			}
559 559
 		}
560 560
 	}
Please login to merge, or discard this patch.
classes/views/frm-fields/back-end/html-content.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@
 block discarded – undo
9 9
 		<?php esc_html_e( 'Content', 'formidable' ); ?>
10 10
 	</label>
11 11
 	<?php
12
-	$e_args  = array(
12
+	$e_args = array(
13 13
 		'textarea_name' => 'field_options[description_' . absint( $field['id'] ) . ']',
14 14
 		'textarea_rows' => 8,
15 15
 	);
Please login to merge, or discard this patch.
classes/helpers/FrmDashboardHelper.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -89,8 +89,8 @@
 block discarded – undo
89 89
 	public function __construct( $data ) {
90 90
 		$sections = array( 'counters', 'license', 'payments', 'entries', 'inbox', 'video', 'payments' );
91 91
 		foreach ( $sections as $section ) {
92
-			if ( isset( $data[ $section ] ) ) {
93
-				$this->view[ $section ] = $data[ $section ];
92
+			if ( isset( $data[$section] ) ) {
93
+				$this->view[$section] = $data[$section];
94 94
 			}
95 95
 		}
96 96
 	}
Please login to merge, or discard this patch.
stripe/controllers/FrmStrpLiteAppController.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -148,13 +148,13 @@  discard block
 block discarded – undo
148 148
 
149 149
 		$is_setup_intent = 0 === strpos( $intent->id, 'seti_' );
150 150
 		if ( $is_setup_intent ) {
151
-			$errors[ 'field' . $cc_field_id ] = is_object( $intent->last_setup_error ) ? $intent->last_setup_error->message : '';
151
+			$errors['field' . $cc_field_id] = is_object( $intent->last_setup_error ) ? $intent->last_setup_error->message : '';
152 152
 		} else {
153
-			$errors[ 'field' . $cc_field_id ] = is_object( $intent->last_payment_error ) ? $intent->last_payment_error->message : '';
153
+			$errors['field' . $cc_field_id] = is_object( $intent->last_payment_error ) ? $intent->last_payment_error->message : '';
154 154
 		}
155 155
 
156
-		if ( ! $errors[ 'field' . $cc_field_id ] ) {
157
-			$errors[ 'field' . $cc_field_id ] = 'Payment was not successfully processed.';
156
+		if ( ! $errors['field' . $cc_field_id] ) {
157
+			$errors['field' . $cc_field_id] = 'Payment was not successfully processed.';
158 158
 		}
159 159
 
160 160
 		global $frm_vars;
@@ -182,10 +182,10 @@  discard block
 block discarded – undo
182 182
 		$save_draft = ! empty( $form->options['save_draft'] );
183 183
 
184 184
 		global $frm_vars;
185
-		$frm_vars['created_entries'][ $form_id ]['errors'] = $errors;
185
+		$frm_vars['created_entries'][$form_id]['errors'] = $errors;
186 186
 
187 187
 		// Set to true to get FrmProFieldsHelper::get_page_with_error() run.
188
-		$_POST[ 'frm_page_order_' . $form_id ] = true;
188
+		$_POST['frm_page_order_' . $form_id] = true;
189 189
 
190 190
 		if ( ! $save_draft ) {
191 191
 			// If draft saving is not on, delete the entry.
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
 		}
195 195
 
196 196
 		// If draft saving is on, load the draft entry.
197
-		$frm_vars['created_entries'][ $form_id ]['entry_id'] = $entry_id;
197
+		$frm_vars['created_entries'][$form_id]['entry_id'] = $entry_id;
198 198
 		add_action(
199 199
 			'frm_filter_final_form',
200 200
 			/**
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
@@ -149,8 +149,8 @@  discard block
 block discarded – undo
149 149
 		$field_val = '';
150 150
 		if ( is_object( $this->field ) ) {
151 151
 			$field_val = $this->field->{$column};
152
-		} elseif ( is_array( $this->field ) && isset( $this->field[ $column ] ) ) {
153
-			$field_val = $this->field[ $column ];
152
+		} elseif ( is_array( $this->field ) && isset( $this->field[$column] ) ) {
153
+			$field_val = $this->field[$column];
154 154
 		}
155 155
 
156 156
 		return $field_val;
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
 		if ( is_object( $this->field ) ) {
165 165
 			$this->field->{$column} = $value;
166 166
 		} elseif ( is_array( $this->field ) ) {
167
-			$this->field[ $column ] = $value;
167
+			$this->field[$column] = $value;
168 168
 		}
169 169
 	}
170 170
 
@@ -556,7 +556,7 @@  discard block
 block discarded – undo
556 556
 			printf(
557 557
 				/* translators: %s: Field type */
558 558
 				esc_html__( '%s Options', 'formidable' ),
559
-				esc_html( $all_field_types[ $args['display']['type'] ]['name'] )
559
+				esc_html( $all_field_types[$args['display']['type']]['name'] )
560 560
 			);
561 561
 			FrmAppHelper::icon_by_class( 'frmfont frm_arrowdown6_icon', array( 'aria-hidden' => 'true' ) );
562 562
 			?>
@@ -664,8 +664,8 @@  discard block
 block discarded – undo
664 664
 
665 665
 		$fields = array_merge( $fields, $pro_fields );
666 666
 
667
-		if ( isset( $fields[ $this->type ] ) ) {
668
-			$name = is_array( $fields[ $this->type ] ) ? $fields[ $this->type ]['name'] : $fields[ $this->type ];
667
+		if ( isset( $fields[$this->type] ) ) {
668
+			$name = is_array( $fields[$this->type] ) ? $fields[$this->type]['name'] : $fields[$this->type];
669 669
 		}
670 670
 
671 671
 		return $name;
@@ -682,7 +682,7 @@  discard block
 block discarded – undo
682 682
 	 * @return array
683 683
 	 */
684 684
 	public function get_default_field_options() {
685
-		$opts        = array(
685
+		$opts = array(
686 686
 			'size'               => '',
687 687
 			'max'                => '',
688 688
 			'label'              => '',
@@ -1078,7 +1078,7 @@  discard block
 block discarded – undo
1078 1078
 			}
1079 1079
 		} else {
1080 1080
 			$args['save_array'] = $this->is_readonly_array();
1081
-			$hidden             .= $this->show_single_hidden( $selected_value, $args );
1081
+			$hidden .= $this->show_single_hidden( $selected_value, $args );
1082 1082
 		}
1083 1083
 
1084 1084
 		return $hidden;
@@ -1087,7 +1087,7 @@  discard block
 block discarded – undo
1087 1087
 	protected function show_single_hidden( $selected, $args ) {
1088 1088
 		if ( $args['save_array'] ) {
1089 1089
 			$args['field_name'] .= '[]';
1090
-			$id                 = '';
1090
+			$id = '';
1091 1091
 		} else {
1092 1092
 			$id = ' id="' . esc_attr( $args['html_id'] ) . '"';
1093 1093
 		}
@@ -1103,8 +1103,8 @@  discard block
 block discarded – undo
1103 1103
 		$selected = $values['field_value'];
1104 1104
 
1105 1105
 		if ( isset( $values['combo_name'] ) ) {
1106
-			$options  = $options[ $values['combo_name'] ];
1107
-			$selected = ( is_array( $selected ) && isset( $selected[ $values['combo_name'] ] ) ) ? $selected[ $values['combo_name'] ] : '';
1106
+			$options  = $options[$values['combo_name']];
1107
+			$selected = ( is_array( $selected ) && isset( $selected[$values['combo_name']] ) ) ? $selected[$values['combo_name']] : '';
1108 1108
 		}
1109 1109
 
1110 1110
 		$input = $this->select_tag( $values );
@@ -1155,7 +1155,7 @@  discard block
 block discarded – undo
1155 1155
 	}
1156 1156
 
1157 1157
 	protected function fill_display_field_values( $args = array() ) {
1158
-		$defaults        = array(
1158
+		$defaults = array(
1159 1159
 			'field_name'    => 'item_meta[' . $this->get_field_column( 'id' ) . ']',
1160 1160
 			'field_id'      => $this->get_field_column( 'id' ),
1161 1161
 			'field_plus_id' => '',
@@ -1208,7 +1208,7 @@  discard block
 block discarded – undo
1208 1208
 			}
1209 1209
 		}
1210 1210
 
1211
-		if ( isset( $args['errors'][ 'field' . $args['field_id'] ] ) && ! $custom_error_fields ) {
1211
+		if ( isset( $args['errors']['field' . $args['field_id']] ) && ! $custom_error_fields ) {
1212 1212
 			if ( $error_comes_first ) {
1213 1213
 				array_unshift( $describedby, 'frm_error_' . $args['html_id'] );
1214 1214
 			} else {
@@ -1287,11 +1287,11 @@  discard block
 block discarded – undo
1287 1287
 
1288 1288
 		$field_id = $this->get_field_column( 'id' );
1289 1289
 		if ( ! array_key_exists( $field_id, $frm_validated_unique_values ) ) {
1290
-			$frm_validated_unique_values[ $field_id ] = array();
1290
+			$frm_validated_unique_values[$field_id] = array();
1291 1291
 			return false;
1292 1292
 		}
1293 1293
 
1294
-		$already_validated_this_value = in_array( $value, $frm_validated_unique_values[ $field_id ], true );
1294
+		$already_validated_this_value = in_array( $value, $frm_validated_unique_values[$field_id], true );
1295 1295
 		return $already_validated_this_value;
1296 1296
 	}
1297 1297
 
@@ -1316,7 +1316,7 @@  discard block
 block discarded – undo
1316 1316
 	private function value_validated_as_unique( $value ) {
1317 1317
 		global $frm_validated_unique_values;
1318 1318
 		$field_id                                   = $this->get_field_column( 'id' );
1319
-		$frm_validated_unique_values[ $field_id ][] = $value;
1319
+		$frm_validated_unique_values[$field_id][] = $value;
1320 1320
 	}
1321 1321
 
1322 1322
 	public function get_value_to_save( $value, $atts ) {
@@ -1353,8 +1353,8 @@  discard block
 block discarded – undo
1353 1353
 		$value = $this->prepare_display_value( $value, $atts );
1354 1354
 
1355 1355
 		if ( is_array( $value ) ) {
1356
-			if ( isset( $atts['show'] ) && $atts['show'] && isset( $value[ $atts['show'] ] ) ) {
1357
-				$value = $value[ $atts['show'] ];
1356
+			if ( isset( $atts['show'] ) && $atts['show'] && isset( $value[$atts['show']] ) ) {
1357
+				$value = $value[$atts['show']];
1358 1358
 			} elseif ( ! isset( $atts['return_array'] ) || ! $atts['return_array'] ) {
1359 1359
 				$sep   = isset( $atts['sep'] ) ? $atts['sep'] : ', ';
1360 1360
 				$value = implode( $sep, $value );
@@ -1484,8 +1484,8 @@  discard block
 block discarded – undo
1484 1484
 		$saved_entries = $atts['ids'];
1485 1485
 		$new_value     = array();
1486 1486
 		foreach ( (array) $value as $old_child_id ) {
1487
-			if ( isset( $saved_entries[ $old_child_id ] ) ) {
1488
-				$new_value[] = $saved_entries[ $old_child_id ];
1487
+			if ( isset( $saved_entries[$old_child_id] ) ) {
1488
+				$new_value[] = $saved_entries[$old_child_id];
1489 1489
 			}
1490 1490
 		}
1491 1491
 
Please login to merge, or discard this patch.
classes/models/FrmYoutubeFeedApi.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -40,8 +40,8 @@
 block discarded – undo
40 40
 	 */
41 41
 	public function get_video( $type = 'welcome' ) {
42 42
 		$videos = $this->get_api_info();
43
-		if ( isset( $videos[ $type ] ) ) {
44
-			return $videos[ $type ];
43
+		if ( isset( $videos[$type] ) ) {
44
+			return $videos[$type];
45 45
 		}
46 46
 		return array();
47 47
 	}
Please login to merge, or discard this patch.
classes/views/xml/posts_xml.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -113,8 +113,8 @@
 block discarded – undo
113 113
 	$label = ( 'category' === $term->taxonomy || 'tag' === $term->taxonomy ) ? $term->taxonomy : 'term';
114 114
 	?>
115 115
 	<term><term_id><?php echo esc_html( $term->term_id ); ?></term_id><term_taxonomy><?php echo esc_html( $term->taxonomy ); ?></term_taxonomy><?php
116
-	if ( ! empty( $parent_slugs[ $term->parent ] ) ) {
117
-		echo '<term_parent>' . esc_html( $parent_slugs[ $term->parent ] ) . '</term_parent>';
116
+	if ( ! empty( $parent_slugs[$term->parent] ) ) {
117
+		echo '<term_parent>' . esc_html( $parent_slugs[$term->parent] ) . '</term_parent>';
118 118
 	}
119 119
 	if ( ! empty( $term->name ) ) {
120 120
 		echo '<term_name>' . FrmXMLHelper::cdata( $term->name ) . '</term_name>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
Please login to merge, or discard this patch.