Completed
Pull Request — master (#1415)
by Stephanie
29s
created
classes/models/FrmFormAction.php 1 patch
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -208,9 +208,9 @@  discard block
 block discarded – undo
208 208
 		$groups = FrmFormActionsController::form_action_groups();
209 209
 		$group  = 'misc';
210 210
 
211
-		if ( isset( $action_options['group'] ) && isset( $groups[ $action_options['group'] ] ) ) {
211
+		if ( isset( $action_options['group'] ) && isset( $groups[$action_options['group']] ) ) {
212 212
 			$group = $action_options['group'];
213
-		} elseif ( isset( $groups[ $this->id_base ] ) ) {
213
+		} elseif ( isset( $groups[$this->id_base] ) ) {
214 214
 			$group = $this->id_base;
215 215
 		} else {
216 216
 			foreach ( $groups as $name => $check_group ) {
@@ -221,8 +221,8 @@  discard block
 block discarded – undo
221 221
 			}
222 222
 		}
223 223
 
224
-		$groups[ $group ]['id'] = $group;
225
-		return $groups[ $group ];
224
+		$groups[$group]['id'] = $group;
225
+		return $groups[$group];
226 226
 	}
227 227
 
228 228
 	/**
@@ -333,7 +333,7 @@  discard block
 block discarded – undo
333 333
 	 * @return integer $post_id
334 334
 	 */
335 335
 	public function maybe_create_action( $action, $forms ) {
336
-		if ( isset( $action['ID'] ) && is_numeric( $action['ID'] ) && isset( $forms[ $action['menu_order'] ] ) && $forms[ $action['menu_order'] ] == 'updated' ) {
336
+		if ( isset( $action['ID'] ) && is_numeric( $action['ID'] ) && isset( $forms[$action['menu_order']] ) && $forms[$action['menu_order']] == 'updated' ) {
337 337
 			// Update action only
338 338
 			$action['post_content'] = FrmAppHelper::maybe_json_decode( $action['post_content'] );
339 339
 			$post_id                = $this->save_settings( $action );
@@ -356,18 +356,18 @@  discard block
 block discarded – undo
356 356
 		$switch             = $this->get_global_switch_fields();
357 357
 
358 358
 		foreach ( (array) $action->post_content as $key => $val ) {
359
-			if ( is_numeric( $val ) && isset( $frm_duplicate_ids[ $val ] ) ) {
360
-				$action->post_content[ $key ] = $frm_duplicate_ids[ $val ];
359
+			if ( is_numeric( $val ) && isset( $frm_duplicate_ids[$val] ) ) {
360
+				$action->post_content[$key] = $frm_duplicate_ids[$val];
361 361
 			} elseif ( ! is_array( $val ) ) {
362
-				$action->post_content[ $key ] = FrmFieldsHelper::switch_field_ids( $val );
363
-			} elseif ( isset( $switch[ $key ] ) && is_array( $switch[ $key ] ) ) {
362
+				$action->post_content[$key] = FrmFieldsHelper::switch_field_ids( $val );
363
+			} elseif ( isset( $switch[$key] ) && is_array( $switch[$key] ) ) {
364 364
 				// loop through each value if empty
365
-				if ( empty( $switch[ $key ] ) ) {
366
-					$switch[ $key ] = array_keys( $val );
365
+				if ( empty( $switch[$key] ) ) {
366
+					$switch[$key] = array_keys( $val );
367 367
 				}
368 368
 
369
-				foreach ( $switch[ $key ] as $subkey ) {
370
-					$action->post_content[ $key ] = $this->duplicate_array_walk( $action->post_content[ $key ], $subkey, $val );
369
+				foreach ( $switch[$key] as $subkey ) {
370
+					$action->post_content[$key] = $this->duplicate_array_walk( $action->post_content[$key], $subkey, $val );
371 371
 				}
372 372
 			}
373 373
 
@@ -385,20 +385,20 @@  discard block
 block discarded – undo
385 385
 			foreach ( $subkey as $subkey2 ) {
386 386
 				foreach ( (array) $val as $ck => $cv ) {
387 387
 					if ( is_array( $cv ) ) {
388
-						$action[ $ck ] = $this->duplicate_array_walk( $action[ $ck ], $subkey2, $cv );
389
-					} elseif ( isset( $cv[ $subkey ] ) && is_numeric( $cv[ $subkey ] ) && isset( $frm_duplicate_ids[ $cv[ $subkey ] ] ) ) {
390
-						$action[ $ck ][ $subkey ] = $frm_duplicate_ids[ $cv[ $subkey ] ];
388
+						$action[$ck] = $this->duplicate_array_walk( $action[$ck], $subkey2, $cv );
389
+					} elseif ( isset( $cv[$subkey] ) && is_numeric( $cv[$subkey] ) && isset( $frm_duplicate_ids[$cv[$subkey]] ) ) {
390
+						$action[$ck][$subkey] = $frm_duplicate_ids[$cv[$subkey]];
391 391
 					}
392 392
 				}
393 393
 			}
394 394
 		} else {
395 395
 			foreach ( (array) $val as $ck => $cv ) {
396 396
 				if ( is_array( $cv ) ) {
397
-					$action[ $ck ] = $this->duplicate_array_walk( $action[ $ck ], $subkey, $cv );
398
-				} elseif ( $ck == $subkey && isset( $frm_duplicate_ids[ $cv ] ) ) {
399
-					$action[ $ck ] = $frm_duplicate_ids[ $cv ];
397
+					$action[$ck] = $this->duplicate_array_walk( $action[$ck], $subkey, $cv );
398
+				} elseif ( $ck == $subkey && isset( $frm_duplicate_ids[$cv] ) ) {
399
+					$action[$ck] = $frm_duplicate_ids[$cv];
400 400
 				} elseif ( $ck == $subkey ) {
401
-					$action[ $ck ] = $this->maybe_switch_field_ids( $action[ $ck ] );
401
+					$action[$ck] = $this->maybe_switch_field_ids( $action[$ck] );
402 402
 				}
403 403
 			}
404 404
 		}//end if
@@ -422,10 +422,10 @@  discard block
 block discarded – undo
422 422
 		}
423 423
 
424 424
 		// phpcs:ignore WordPress.Security.NonceVerification.Missing
425
-		if ( isset( $_POST[ $this->option_name ] ) && is_array( $_POST[ $this->option_name ] ) ) {
425
+		if ( isset( $_POST[$this->option_name] ) && is_array( $_POST[$this->option_name] ) ) {
426 426
 			// Sanitizing removes scripts and <email> type of values.
427 427
 			// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
428
-			$settings = wp_unslash( $_POST[ $this->option_name ] );
428
+			$settings = wp_unslash( $_POST[$this->option_name] );
429 429
 		} else {
430 430
 			return;
431 431
 		}
@@ -435,7 +435,7 @@  discard block
 block discarded – undo
435 435
 		foreach ( $settings as $number => $new_instance ) {
436 436
 			$this->_set( $number );
437 437
 
438
-			$old_instance = isset( $all_instances[ $number ] ) ? $all_instances[ $number ] : array();
438
+			$old_instance = isset( $all_instances[$number] ) ? $all_instances[$number] : array();
439 439
 
440 440
 			if ( ! isset( $new_instance['post_status'] ) ) {
441 441
 				$new_instance['post_status'] = 'draft';
@@ -473,7 +473,7 @@  discard block
 block discarded – undo
473 473
 			$instance['post_content'] = apply_filters( 'frm_before_save_' . $this->id_base . '_action', $instance['post_content'], $instance, $new_instance, $old_instance, $this );
474 474
 
475 475
 			if ( false !== $instance ) {
476
-				$all_instances[ $number ] = $instance;
476
+				$all_instances[$number] = $instance;
477 477
 			}
478 478
 
479 479
 			$action_ids[] = $this->save_settings( $instance );
@@ -555,12 +555,12 @@  discard block
 block discarded – undo
555 555
 			// some plugins/themes are formatting the post_excerpt
556 556
 			$action->post_excerpt = sanitize_title( $action->post_excerpt );
557 557
 
558
-			if ( ! isset( $action_controls[ $action->post_excerpt ] ) ) {
558
+			if ( ! isset( $action_controls[$action->post_excerpt] ) ) {
559 559
 				continue;
560 560
 			}
561 561
 
562
-			$action                  = $action_controls[ $action->post_excerpt ]->prepare_action( $action );
563
-			$settings[ $action->ID ] = $action;
562
+			$action                  = $action_controls[$action->post_excerpt]->prepare_action( $action );
563
+			$settings[$action->ID] = $action;
564 564
 
565 565
 			if ( count( $settings ) >= $limit ) {
566 566
 				break;
@@ -593,7 +593,7 @@  discard block
 block discarded – undo
593 593
 			'limit'       => 99,
594 594
 			'post_status' => $default_status,
595 595
 		);
596
-		$args     = wp_parse_args( $args, $defaults );
596
+		$args = wp_parse_args( $args, $defaults );
597 597
 	}
598 598
 
599 599
 	/**
@@ -659,7 +659,7 @@  discard block
 block discarded – undo
659 659
 
660 660
 			$action = $this->prepare_action( $action );
661 661
 
662
-			$settings[ $action->ID ] = $action;
662
+			$settings[$action->ID] = $action;
663 663
 		}
664 664
 
665 665
 		if ( 1 === $limit ) {
@@ -702,10 +702,10 @@  discard block
 block discarded – undo
702 702
 
703 703
 		foreach ( $default_values as $k => $vals ) {
704 704
 			if ( is_array( $vals ) && ! empty( $vals ) ) {
705
-				if ( 'event' === $k && ! $this->action_options['force_event'] && ! empty( $action->post_content[ $k ] ) ) {
705
+				if ( 'event' === $k && ! $this->action_options['force_event'] && ! empty( $action->post_content[$k] ) ) {
706 706
 					continue;
707 707
 				}
708
-				$action->post_content[ $k ] = wp_parse_args( $action->post_content[ $k ], $vals );
708
+				$action->post_content[$k] = wp_parse_args( $action->post_content[$k], $vals );
709 709
 			}
710 710
 		}
711 711
 
@@ -788,14 +788,14 @@  discard block
 block discarded – undo
788 788
 	 * Migrate settings from form->options into new action.
789 789
 	 */
790 790
 	public function migrate_to_2( $form, $update = 'update' ) {
791
-		$action        = $this->prepare_new( $form->id );
791
+		$action = $this->prepare_new( $form->id );
792 792
 		FrmAppHelper::unserialize_or_decode( $form->options );
793 793
 
794 794
 		// fill with existing options
795 795
 		foreach ( $action->post_content as $name => $val ) {
796
-			if ( isset( $form->options[ $name ] ) ) {
797
-				$action->post_content[ $name ] = $form->options[ $name ];
798
-				unset( $form->options[ $name ] );
796
+			if ( isset( $form->options[$name] ) ) {
797
+				$action->post_content[$name] = $form->options[$name];
798
+				unset( $form->options[$name] );
799 799
 			}
800 800
 		}
801 801
 
@@ -861,7 +861,7 @@  discard block
 block discarded – undo
861 861
 				$stop = $stop ? false : true;
862 862
 			}
863 863
 
864
-			$met[ $stop ] = $stop;
864
+			$met[$stop] = $stop;
865 865
 		}//end foreach
866 866
 
867 867
 		if ( $notification['conditions']['any_all'] == 'all' && ! empty( $met ) && isset( $met[0] ) && isset( $met[1] ) ) {
@@ -915,8 +915,8 @@  discard block
 block discarded – undo
915 915
 	private static function get_value_from_entry( $entry, $field_id ) {
916 916
 		$observed_value = '';
917 917
 
918
-		if ( isset( $entry->metas[ $field_id ] ) ) {
919
-			$observed_value = $entry->metas[ $field_id ];
918
+		if ( isset( $entry->metas[$field_id] ) ) {
919
+			$observed_value = $entry->metas[$field_id];
920 920
 		} elseif ( $entry->post_id && FrmAppHelper::pro_is_installed() ) {
921 921
 			$field          = FrmField::getOne( $field_id );
922 922
 			$observed_value = FrmProEntryMetaHelper::get_post_or_meta_value(
Please login to merge, or discard this patch.
classes/models/FrmEmailStats.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 	 * @param array $stats Statistics section data.
141 141
 	 */
142 142
 	protected function add_payments_data( &$stats ) {
143
-		$payment_data  = FrmEmailSummaryHelper::get_payments_data( $this->from_date, $this->to_date );
143
+		$payment_data = FrmEmailSummaryHelper::get_payments_data( $this->from_date, $this->to_date );
144 144
 		$stats['payments_count'] = array(
145 145
 			'label'   => __( 'Payments collected', 'formidable' ),
146 146
 			'count'   => $payment_data['count'],
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 
150 150
 		// Build total for each currency.
151 151
 		foreach ( $payment_data['total'] as $currency => $amount ) {
152
-			$stats[ 'payments_total_' . $currency ] = array(
152
+			$stats['payments_total_' . $currency] = array(
153 153
 				// translators: currency name.
154 154
 				'label'   => sprintf( __( 'Total %s', 'formidable' ), strtoupper( $currency ) ),
155 155
 				'count'   => $amount,
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
 		}
160 160
 
161 161
 		if ( $this->has_comparison ) {
162
-			$prev_payment_data  = FrmEmailSummaryHelper::get_payments_data( $this->prev_from_date, $this->prev_to_date );
162
+			$prev_payment_data = FrmEmailSummaryHelper::get_payments_data( $this->prev_from_date, $this->prev_to_date );
163 163
 
164 164
 			if ( ! $payment_data['count'] && ! $prev_payment_data['count'] ) {
165 165
 				// Maybe this site doesn't collect payment, hide these sections.
@@ -171,23 +171,23 @@  discard block
 block discarded – undo
171 171
 
172 172
 			// Compare total for each currency.
173 173
 			foreach ( $payment_data['total'] as $currency => $amount ) {
174
-				if ( ! isset( $prev_payment_data['total'][ $currency ] ) ) {
175
-					$stats[ 'payments_total_' . $currency ]['compare'] = 1;
174
+				if ( ! isset( $prev_payment_data['total'][$currency] ) ) {
175
+					$stats['payments_total_' . $currency]['compare'] = 1;
176 176
 					continue;
177 177
 				}
178 178
 
179
-				$stats[ 'payments_total_' . $currency ]['compare'] = $this->get_compare_diff( $amount, $prev_payment_data['total'][ $currency ] );
180
-				unset( $prev_payment_data['total'][ $currency ] );
179
+				$stats['payments_total_' . $currency]['compare'] = $this->get_compare_diff( $amount, $prev_payment_data['total'][$currency] );
180
+				unset( $prev_payment_data['total'][$currency] );
181 181
 			}
182 182
 
183 183
 			// If prev month has more currencies.
184 184
 			foreach ( $prev_payment_data['total'] as $currency => $amount ) {
185
-				$stats[ 'payments_total_' . $currency ] = array(
185
+				$stats['payments_total_' . $currency] = array(
186 186
 					// translators: currency name.
187 187
 					'label'   => sprintf( __( 'Total %s', 'formidable' ), strtoupper( $currency ) ),
188 188
 					'count'   => 0,
189 189
 					'display' => $this->get_formatted_price( 0, $currency ),
190
-					'compare' => -1,
190
+					'compare' => - 1,
191 191
 				);
192 192
 			}
193 193
 		}//end if
Please login to merge, or discard this patch.
classes/models/FrmFieldFormHtml.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -44,8 +44,8 @@  discard block
 block discarded – undo
44 44
 	 * @param array  $atts
45 45
 	 */
46 46
 	private function _set( $param, $atts ) {
47
-		if ( isset( $atts[ $param ] ) ) {
48
-			$this->{$param} = $atts[ $param ];
47
+		if ( isset( $atts[$param] ) ) {
48
+			$this->{$param} = $atts[$param];
49 49
 		}
50 50
 	}
51 51
 
@@ -89,8 +89,8 @@  discard block
 block discarded – undo
89 89
 
90 90
 		$exclude = array( 'field_obj', 'html' );
91 91
 		foreach ( $exclude as $ex ) {
92
-			if ( isset( $atts[ $ex ] ) ) {
93
-				unset( $this->pass_args[ $ex ] );
92
+			if ( isset( $atts[$ex] ) ) {
93
+				unset( $this->pass_args[$ex] );
94 94
 			}
95 95
 		}
96 96
 	}
@@ -102,8 +102,8 @@  discard block
 block discarded – undo
102 102
 	 * @param array $set
103 103
 	 */
104 104
 	private function set_from_field( $atts, $set ) {
105
-		if ( isset( $atts[ $set['param'] ] ) ) {
106
-			$this->{$set['param']} = $atts[ $set['param'] ];
105
+		if ( isset( $atts[$set['param']] ) ) {
106
+			$this->{$set['param']} = $atts[$set['param']];
107 107
 		} else {
108 108
 			$this->{$set['param']} = $this->field_obj->get_field_column( $set['default'] );
109 109
 		}
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
 	 */
231 231
 	private function replace_error_shortcode() {
232 232
 		$this->maybe_add_error_id();
233
-		$error = isset( $this->pass_args['errors'][ 'field' . $this->field_id ] ) ? $this->pass_args['errors'][ 'field' . $this->field_id ] : false;
233
+		$error = isset( $this->pass_args['errors']['field' . $this->field_id] ) ? $this->pass_args['errors']['field' . $this->field_id] : false;
234 234
 
235 235
 		if ( ! empty( $error ) && false === strpos( $this->html, 'role="alert"' ) && FrmAppHelper::should_include_alert_role_on_field_errors() ) {
236 236
 			$error_body = self::get_error_body( $this->html );
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
 	 * @since 3.06.02
272 272
 	 */
273 273
 	private function maybe_add_error_id() {
274
-		if ( ! isset( $this->pass_args['errors'][ 'field' . $this->field_id ] ) ) {
274
+		if ( ! isset( $this->pass_args['errors']['field' . $this->field_id] ) ) {
275 275
 			return;
276 276
 		}
277 277
 
@@ -351,7 +351,7 @@  discard block
 block discarded – undo
351 351
 		preg_match_all( "/\[(input|deletelink)\b(.*?)(?:(\/))?\]/s", $this->html, $shortcodes, PREG_PATTERN_ORDER );
352 352
 
353 353
 		foreach ( $shortcodes[0] as $short_key => $tag ) {
354
-			$shortcode_atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[2][ $short_key ] );
354
+			$shortcode_atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[2][$short_key] );
355 355
 			$tag            = FrmShortcodeHelper::get_shortcode_tag( $shortcodes, $short_key );
356 356
 
357 357
 			$replace_with = '';
@@ -362,7 +362,7 @@  discard block
 block discarded – undo
362 362
 				$replace_with = $this->replace_input_shortcode( $shortcode_atts );
363 363
 			}
364 364
 
365
-			$this->html = str_replace( $shortcodes[0][ $short_key ], $replace_with, $this->html );
365
+			$this->html = str_replace( $shortcodes[0][$short_key], $replace_with, $this->html );
366 366
 		}
367 367
 	}
368 368
 
@@ -394,7 +394,7 @@  discard block
 block discarded – undo
394 394
 			unset( $shortcode_atts['class'] );
395 395
 		}
396 396
 
397
-		$shortcode_atts['aria-invalid'] = isset( $this->pass_args['errors'][ 'field' . $this->field_id ] ) ? 'true' : 'false';
397
+		$shortcode_atts['aria-invalid'] = isset( $this->pass_args['errors']['field' . $this->field_id] ) ? 'true' : 'false';
398 398
 
399 399
 		$this->field_obj->set_field_column( 'shortcodes', $shortcode_atts );
400 400
 
@@ -446,7 +446,7 @@  discard block
 block discarded – undo
446 446
 	 */
447 447
 	private function get_field_div_classes() {
448 448
 		// Add error class
449
-		$classes = isset( $this->pass_args['errors'][ 'field' . $this->field_id ] ) ? ' frm_blank_field' : '';
449
+		$classes = isset( $this->pass_args['errors']['field' . $this->field_id] ) ? ' frm_blank_field' : '';
450 450
 
451 451
 		// Add label position class
452 452
 		$settings = $this->field_obj->display_field_settings();
Please login to merge, or discard this patch.
classes/models/fields/FrmFieldNumber.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 
71 71
 		// Validate the number format.
72 72
 		if ( ! is_numeric( $args['value'] ) && '' !== $args['value'] ) {
73
-			$errors[ 'field' . $args['id'] ] = FrmFieldsHelper::get_error_msg( $this->field, 'invalid' );
73
+			$errors['field' . $args['id']] = FrmFieldsHelper::get_error_msg( $this->field, 'invalid' );
74 74
 		}
75 75
 
76 76
 		// validate number settings
@@ -82,9 +82,9 @@  discard block
 block discarded – undo
82 82
 			if ( $frm_settings->use_html && $maxnum !== '' && $minnum !== '' ) {
83 83
 				$value = (float) $args['value'];
84 84
 				if ( $value < $minnum ) {
85
-					$errors[ 'field' . $args['id'] ] = __( 'Please select a higher number', 'formidable' );
85
+					$errors['field' . $args['id']] = __( 'Please select a higher number', 'formidable' );
86 86
 				} elseif ( $value > $maxnum ) {
87
-					$errors[ 'field' . $args['id'] ] = __( 'Please select a lower number', 'formidable' );
87
+					$errors['field' . $args['id']] = __( 'Please select a lower number', 'formidable' );
88 88
 				}
89 89
 			}
90 90
 
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
 	 * @return void
106 106
 	 */
107 107
 	private function validate_step( &$errors, $args ) {
108
-		if ( isset( $errors[ 'field' . $args['id'] ] ) ) {
108
+		if ( isset( $errors['field' . $args['id']] ) ) {
109 109
 			// Don't need to check if value is invalid before.
110 110
 			return;
111 111
 		}
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 			return;
121 121
 		}
122 122
 
123
-		$errors[ 'field' . $args['id'] ] = sprintf(
123
+		$errors['field' . $args['id']] = sprintf(
124 124
 			// Translators: %1$s: the first nearest value; %2$s: the second nearest value.
125 125
 			__( 'Please enter a valid value. Two nearest valid values are %1$s and %2$s', 'formidable' ),
126 126
 			floatval( $result[0] ),
Please login to merge, or discard this patch.
classes/models/FrmSolution.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
 	 */
184 184
 	public function add_settings( $sections ) {
185 185
 		wp_enqueue_style( 'formidable-pro-fields' );
186
-		$sections[ $this->plugin_slug ] = array(
186
+		$sections[$this->plugin_slug] = array(
187 187
 			'class'    => $this,
188 188
 			'function' => 'settings_page',
189 189
 			'name'     => $this->plugin_name(),
@@ -349,9 +349,9 @@  discard block
 block discarded – undo
349 349
 			// Set the current step.
350 350
 			if ( ! isset( $step['current'] ) ) {
351 351
 				if ( $step['complete'] ) {
352
-					$steps[ $k ]['current'] = false;
352
+					$steps[$k]['current'] = false;
353 353
 				} else {
354
-					$steps[ $k ]['current'] = ! $has_current;
354
+					$steps[$k]['current'] = ! $has_current;
355 355
 					$has_current = true;
356 356
 				}
357 357
 			} elseif ( $step['current'] ) {
@@ -361,10 +361,10 @@  discard block
 block discarded – undo
361 361
 			// Set disabled buttons.
362 362
 			$class = isset( $step['button_class'] ) ? $step['button_class'] : '';
363 363
 			$class .= ' button-primary frm-button-primary';
364
-			if ( ! $steps[ $k ]['current'] ) {
364
+			if ( ! $steps[$k]['current'] ) {
365 365
 				$class .= ' frm_grey disabled';
366 366
 			}
367
-			$steps[ $k ]['button_class'] = $class;
367
+			$steps[$k]['button_class'] = $class;
368 368
 		}//end foreach
369 369
 
370 370
 		return $steps;
@@ -391,7 +391,7 @@  discard block
 block discarded – undo
391 391
 			if ( $plugin['status'] === 'active' ) {
392 392
 				continue;
393 393
 			}
394
-			$links[ $plugin_key ] = $plugin;
394
+			$links[$plugin_key] = $plugin;
395 395
 			if ( isset( $plugin['url'] ) ) {
396 396
 				$rel[] = $plugin['url'];
397 397
 			} else {
@@ -520,7 +520,7 @@  discard block
 block discarded – undo
520 520
 		$addons = $api->get_api_info();
521 521
 
522 522
 		$id = $this->download_id();
523
-		$has_file = isset( $addons[ $id ] ) && isset( $addons[ $id ]['beta'] );
523
+		$has_file = isset( $addons[$id] ) && isset( $addons[$id]['beta'] );
524 524
 
525 525
 		if ( ! $step['current'] ) {
526 526
 			?>
@@ -535,10 +535,10 @@  discard block
 block discarded – undo
535 535
 
536 536
 		if ( ! $has_file ) {
537 537
 			echo '<p class="frm_error_style">' . esc_html__( 'We didn\'t find anything to import. Please contact our team.', 'formidable' ) . '</p>';
538
-		} elseif ( ! isset( $addons[ $id ]['beta']['package'] ) ) {
538
+		} elseif ( ! isset( $addons[$id]['beta']['package'] ) ) {
539 539
 			echo '<p class="frm_error_style">' . esc_html__( 'Looks like you may not have a current subscription for this solution. Please check your account.', 'formidable' ) . '</p>';
540 540
 		} else {
541
-			$xml = $addons[ $id ]['beta']['package'];
541
+			$xml = $addons[$id]['beta']['package'];
542 542
 			if ( is_array( $xml ) ) {
543 543
 				$xml = reset( $xml );
544 544
 			}
@@ -705,7 +705,7 @@  discard block
 block discarded – undo
705 705
 		foreach ( $forms as $form ) {
706 706
 			$was_imported = isset( $form['form'] ) ? FrmForm::get_id_by_key( $form['form'] ) : false;
707 707
 			if ( $was_imported ) {
708
-				$imported[ $form['form'] ] = $was_imported;
708
+				$imported[$form['form']] = $was_imported;
709 709
 			}
710 710
 		}
711 711
 
Please login to merge, or discard this patch.
classes/models/FrmField.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
 		$values = FrmAppHelper::maybe_filter_array( $values, array( 'name', 'description' ) );
273 273
 
274 274
 		foreach ( array( 'name', 'description', 'type', 'default_value' ) as $col ) {
275
-			$new_values[ $col ] = $values[ $col ];
275
+			$new_values[$col] = $values[$col];
276 276
 		}
277 277
 
278 278
 		$new_values['options']       = self::maybe_filter_options( $values['options'] );
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
 		$new_values['created_at']    = current_time( 'mysql', 1 );
284 284
 
285 285
 		if ( isset( $values['id'] ) ) {
286
-			$frm_duplicate_ids[ $values['field_key'] ] = $new_values['field_key'];
286
+			$frm_duplicate_ids[$values['field_key']] = $new_values['field_key'];
287 287
 			$new_values                                = apply_filters( 'frm_duplicated_field', $new_values );
288 288
 		}
289 289
 
@@ -292,9 +292,9 @@  discard block
 block discarded – undo
292 292
 		foreach ( $new_values as $k => $v ) {
293 293
 			if ( is_array( $v ) ) {
294 294
 				if ( $k === 'default_value' ) {
295
-					$new_values[ $k ] = FrmAppHelper::maybe_json_encode( $v );
295
+					$new_values[$k] = FrmAppHelper::maybe_json_encode( $v );
296 296
 				} else {
297
-					$new_values[ $k ] = serialize( $v );
297
+					$new_values[$k] = serialize( $v );
298 298
 				}
299 299
 			}
300 300
 			unset( $k, $v );
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
 		}
315 315
 
316 316
 		if ( isset( $values['id'] ) ) {
317
-			$frm_duplicate_ids[ $values['id'] ] = $new_id;
317
+			$frm_duplicate_ids[$values['id']] = $new_id;
318 318
 		}
319 319
 
320 320
 		return $new_id;
@@ -374,7 +374,7 @@  discard block
 block discarded – undo
374 374
 	public static function duplicate( $old_form_id, $form_id, $copy_keys = false, $blog_id = false ) {
375 375
 		global $frm_duplicate_ids;
376 376
 
377
-		$where  = array(
377
+		$where = array(
378 378
 			array(
379 379
 				'or'                => 1,
380 380
 				'fi.form_id'        => $old_form_id,
@@ -420,8 +420,8 @@  discard block
 block discarded – undo
420 420
 
421 421
 			$values                                 = apply_filters( 'frm_duplicated_field', $values );
422 422
 			$new_id                                 = self::create( $values );
423
-			$frm_duplicate_ids[ $field->id ]        = $new_id;
424
-			$frm_duplicate_ids[ $field->field_key ] = $new_id;
423
+			$frm_duplicate_ids[$field->id]        = $new_id;
424
+			$frm_duplicate_ids[$field->field_key] = $new_id;
425 425
 			unset( $field );
426 426
 		}//end foreach
427 427
 	}
@@ -459,11 +459,11 @@  discard block
 block discarded – undo
459 459
 
460 460
 		// serialize array values
461 461
 		foreach ( array( 'field_options', 'options' ) as $opt ) {
462
-			if ( isset( $values[ $opt ] ) && is_array( $values[ $opt ] ) ) {
462
+			if ( isset( $values[$opt] ) && is_array( $values[$opt] ) ) {
463 463
 				if ( 'field_options' === $opt ) {
464
-					$values[ $opt ] = self::maybe_filter_options( $values[ $opt ] );
464
+					$values[$opt] = self::maybe_filter_options( $values[$opt] );
465 465
 				}
466
-				$values[ $opt ] = serialize( $values[ $opt ] );
466
+				$values[$opt] = serialize( $values[$opt] );
467 467
 			}
468 468
 		}
469 469
 		if ( isset( $values['default_value'] ) && is_array( $values['default_value'] ) ) {
@@ -615,7 +615,7 @@  discard block
 block discarded – undo
615 615
 				'id'        => $id,
616 616
 				'field_key' => $id,
617 617
 			);
618
-			$type  = FrmDb::get_var( 'frm_fields', $where, $col );
618
+			$type = FrmDb::get_var( 'frm_fields', $where, $col );
619 619
 		}
620 620
 
621 621
 		return $type;
@@ -641,7 +641,7 @@  discard block
 block discarded – undo
641 641
 					continue;
642 642
 				}
643 643
 
644
-				$fields[ $result->id ] = $result;
644
+				$fields[$result->id] = $result;
645 645
 				$count ++;
646 646
 				if ( $limit == 1 ) {
647 647
 					$fields = $result;
@@ -687,7 +687,7 @@  discard block
 block discarded – undo
687 687
 			$count  = 0;
688 688
 			foreach ( $results as $result ) {
689 689
 				$count ++;
690
-				$fields[ $result->id ] = $result;
690
+				$fields[$result->id] = $result;
691 691
 				if ( ! empty( $limit ) && $count >= $limit ) {
692 692
 					break;
693 693
 				}
@@ -756,7 +756,7 @@  discard block
 block discarded – undo
756 756
 			}
757 757
 
758 758
 			if ( ! empty( $sub_fields ) ) {
759
-				$index        = $k + $index_offset;
759
+				$index = $k + $index_offset;
760 760
 				$index_offset += count( $sub_fields );
761 761
 				array_splice( $results, $index, 0, $sub_fields );
762 762
 			}
@@ -801,7 +801,7 @@  discard block
 block discarded – undo
801 801
 		$query_type = ( $limit == ' LIMIT 1' || $limit == 1 ) ? 'row' : 'results';
802 802
 
803 803
 		if ( is_array( $where ) ) {
804
-			$args    = array(
804
+			$args = array(
805 805
 				'order_by' => $order_by,
806 806
 				'limit'    => $limit,
807 807
 			);
@@ -832,9 +832,9 @@  discard block
 block discarded – undo
832 832
 				FrmDb::set_cache( $result->field_key, $result, 'frm_field' );
833 833
 
834 834
 				self::prepare_options( $result );
835
-				$results[ $r_key ]->field_options = $result->field_options;
836
-				$results[ $r_key ]->options       = $result->options;
837
-				$results[ $r_key ]->default_value = $result->default_value;
835
+				$results[$r_key]->field_options = $result->field_options;
836
+				$results[$r_key]->options       = $result->options;
837
+				$results[$r_key]->default_value = $result->default_value;
838 838
 
839 839
 				unset( $r_key, $result );
840 840
 			}
@@ -1037,23 +1037,23 @@  discard block
 block discarded – undo
1037 1037
 	}
1038 1038
 
1039 1039
 	public static function is_option_true_in_array( $field, $option ) {
1040
-		return isset( $field[ $option ] ) && $field[ $option ];
1040
+		return isset( $field[$option] ) && $field[$option];
1041 1041
 	}
1042 1042
 
1043 1043
 	public static function is_option_true_in_object( $field, $option ) {
1044
-		return isset( $field->field_options[ $option ] ) && $field->field_options[ $option ];
1044
+		return isset( $field->field_options[$option] ) && $field->field_options[$option];
1045 1045
 	}
1046 1046
 
1047 1047
 	public static function is_option_empty_in_array( $field, $option ) {
1048
-		return ! isset( $field[ $option ] ) || empty( $field[ $option ] );
1048
+		return ! isset( $field[$option] ) || empty( $field[$option] );
1049 1049
 	}
1050 1050
 
1051 1051
 	public static function is_option_empty_in_object( $field, $option ) {
1052
-		return ! isset( $field->field_options[ $option ] ) || empty( $field->field_options[ $option ] );
1052
+		return ! isset( $field->field_options[$option] ) || empty( $field->field_options[$option] );
1053 1053
 	}
1054 1054
 
1055 1055
 	public static function is_option_value_in_object( $field, $option ) {
1056
-		return isset( $field->field_options[ $option ] ) && $field->field_options[ $option ] != '';
1056
+		return isset( $field->field_options[$option] ) && $field->field_options[$option] != '';
1057 1057
 	}
1058 1058
 
1059 1059
 	/**
@@ -1071,10 +1071,10 @@  discard block
 block discarded – undo
1071 1071
 
1072 1072
 	public static function get_option_in_array( $field, $option ) {
1073 1073
 
1074
-		if ( isset( $field[ $option ] ) ) {
1075
-			$this_option = $field[ $option ];
1076
-		} elseif ( isset( $field['field_options'] ) && is_array( $field['field_options'] ) && isset( $field['field_options'][ $option ] ) ) {
1077
-			$this_option = $field['field_options'][ $option ];
1074
+		if ( isset( $field[$option] ) ) {
1075
+			$this_option = $field[$option];
1076
+		} elseif ( isset( $field['field_options'] ) && is_array( $field['field_options'] ) && isset( $field['field_options'][$option] ) ) {
1077
+			$this_option = $field['field_options'][$option];
1078 1078
 		} else {
1079 1079
 			$this_option = '';
1080 1080
 		}
@@ -1083,7 +1083,7 @@  discard block
 block discarded – undo
1083 1083
 	}
1084 1084
 
1085 1085
 	public static function get_option_in_object( $field, $option ) {
1086
-		return isset( $field->field_options[ $option ] ) ? $field->field_options[ $option ] : '';
1086
+		return isset( $field->field_options[$option] ) ? $field->field_options[$option] : '';
1087 1087
 	}
1088 1088
 
1089 1089
 	/**
Please login to merge, or discard this patch.
classes/models/FrmForm.php 1 patch
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
 			}
210 210
 
211 211
 			if ( $new_val !== $value ) {
212
-				$new_values[ $key ] = $new_val;
212
+				$new_values[$key] = $new_val;
213 213
 			}
214 214
 		}//end foreach
215 215
 
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
 
241 241
 		foreach ( $values as $value_key => $value ) {
242 242
 			if ( $value_key && in_array( $value_key, $form_fields ) ) {
243
-				$new_values[ $value_key ] = $value;
243
+				$new_values[$value_key] = $value;
244 244
 			}
245 245
 		}
246 246
 
@@ -323,15 +323,15 @@  discard block
 block discarded – undo
323 323
 		$existing_keys = array_keys( $values['item_meta'] );
324 324
 		foreach ( $all_fields as $fid ) {
325 325
 			if ( ! in_array( $fid->id, $existing_keys ) && ( isset( $values['frm_fields_submitted'] ) && in_array( $fid->id, $values['frm_fields_submitted'] ) ) || isset( $values['options'] ) ) {
326
-				$values['item_meta'][ $fid->id ] = '';
326
+				$values['item_meta'][$fid->id] = '';
327 327
 			}
328
-			$field_array[ $fid->id ] = $fid;
328
+			$field_array[$fid->id] = $fid;
329 329
 		}
330 330
 		unset( $all_fields );
331 331
 
332 332
 		foreach ( $values['item_meta'] as $field_id => $default_value ) {
333
-			if ( isset( $field_array[ $field_id ] ) ) {
334
-				$field = $field_array[ $field_id ];
333
+			if ( isset( $field_array[$field_id] ) ) {
334
+				$field = $field_array[$field_id];
335 335
 			} else {
336 336
 				$field = FrmField::getOne( $field_id );
337 337
 			}
@@ -340,7 +340,7 @@  discard block
 block discarded – undo
340 340
 				continue;
341 341
 			}
342 342
 
343
-			$is_settings_page = ( isset( $values['options'] ) || isset( $values['field_options'][ 'custom_html_' . $field_id ] ) );
343
+			$is_settings_page = ( isset( $values['options'] ) || isset( $values['field_options']['custom_html_' . $field_id] ) );
344 344
 			if ( $is_settings_page ) {
345 345
 				self::get_settings_page_html( $values, $field );
346 346
 
@@ -356,22 +356,22 @@  discard block
 block discarded – undo
356 356
 			$update_options = apply_filters( 'frm_field_options_to_update', $update_options );
357 357
 
358 358
 			foreach ( $update_options as $opt => $default ) {
359
-				$field->field_options[ $opt ] = isset( $values['field_options'][ $opt . '_' . $field_id ] ) ? $values['field_options'][ $opt . '_' . $field_id ] : $default;
360
-				self::sanitize_field_opt( $opt, $field->field_options[ $opt ] );
359
+				$field->field_options[$opt] = isset( $values['field_options'][$opt . '_' . $field_id] ) ? $values['field_options'][$opt . '_' . $field_id] : $default;
360
+				self::sanitize_field_opt( $opt, $field->field_options[$opt] );
361 361
 			}
362 362
 
363 363
 			$field->field_options = apply_filters( 'frm_update_field_options', $field->field_options, $field, $values );
364 364
 
365 365
 			$new_field = array(
366 366
 				'field_options' => $field->field_options,
367
-				'default_value' => isset( $values[ 'default_value_' . $field_id ] ) ? FrmAppHelper::maybe_json_encode( $values[ 'default_value_' . $field_id ] ) : '',
367
+				'default_value' => isset( $values['default_value_' . $field_id] ) ? FrmAppHelper::maybe_json_encode( $values['default_value_' . $field_id] ) : '',
368 368
 			);
369 369
 
370
-			if ( ! FrmAppHelper::allow_unfiltered_html() && isset( $values['field_options'][ 'options_' . $field_id ] ) && is_array( $values['field_options'][ 'options_' . $field_id ] ) ) {
371
-				foreach ( $values['field_options'][ 'options_' . $field_id ] as $option_key => $option ) {
370
+			if ( ! FrmAppHelper::allow_unfiltered_html() && isset( $values['field_options']['options_' . $field_id] ) && is_array( $values['field_options']['options_' . $field_id] ) ) {
371
+				foreach ( $values['field_options']['options_' . $field_id] as $option_key => $option ) {
372 372
 					if ( is_array( $option ) ) {
373 373
 						foreach ( $option as $key => $item ) {
374
-							$values['field_options'][ 'options_' . $field_id ][ $option_key ][ $key ] = FrmAppHelper::kses( $item, 'all' );
374
+							$values['field_options']['options_' . $field_id][$option_key][$key] = FrmAppHelper::kses( $item, 'all' );
375 375
 						}
376 376
 					}
377 377
 				}
@@ -401,8 +401,8 @@  discard block
 block discarded – undo
401 401
 	 */
402 402
 	private static function maybe_update_max_option( $field, $values, &$new_field ) {
403 403
 		if ( $field->type === 'textarea' &&
404
-			! empty( $values['field_options'][ 'type_' . $field->id ] ) &&
405
-			in_array( $values['field_options'][ 'type_' . $field->id ], array( 'text', 'email', 'url', 'password', 'phone' ), true ) ) {
404
+			! empty( $values['field_options']['type_' . $field->id] ) &&
405
+			in_array( $values['field_options']['type_' . $field->id], array( 'text', 'email', 'url', 'password', 'phone' ), true ) ) {
406 406
 
407 407
 			$new_field['field_options']['max'] = '';
408 408
 
@@ -410,7 +410,7 @@  discard block
 block discarded – undo
410 410
 			 * Update posted field setting so that new 'max' option is displayed after form is saved and page reloads.
411 411
 			 * FrmFieldsHelper::fill_default_field_opts populates field options by calling self::get_posted_field_setting.
412 412
 			 */
413
-			$_POST['field_options'][ 'max_' . $field->id ] = '';
413
+			$_POST['field_options']['max_' . $field->id] = '';
414 414
 		}
415 415
 	}
416 416
 
@@ -486,11 +486,11 @@  discard block
 block discarded – undo
486 486
 	 * Updating the settings page
487 487
 	 */
488 488
 	private static function get_settings_page_html( $values, &$field ) {
489
-		if ( isset( $values['field_options'][ 'custom_html_' . $field->id ] ) ) {
489
+		if ( isset( $values['field_options']['custom_html_' . $field->id] ) ) {
490 490
 			$prev_opts     = array();
491 491
 			$fallback_html = isset( $field->field_options['custom_html'] ) ? $field->field_options['custom_html'] : FrmFieldsHelper::get_default_html( $field->type );
492 492
 
493
-			$field->field_options['custom_html'] = isset( $values['field_options'][ 'custom_html_' . $field->id ] ) ? $values['field_options'][ 'custom_html_' . $field->id ] : $fallback_html;
493
+			$field->field_options['custom_html'] = isset( $values['field_options']['custom_html_' . $field->id] ) ? $values['field_options']['custom_html_' . $field->id] : $fallback_html;
494 494
 		} elseif ( $field->type == 'hidden' || $field->type == 'user_id' ) {
495 495
 			$prev_opts = $field->field_options;
496 496
 		}
@@ -516,7 +516,7 @@  discard block
 block discarded – undo
516 516
 		foreach ( $field_cols as $col => $default ) {
517 517
 			$default = ( $default === '' ) ? $field->{$col} : $default;
518 518
 
519
-			$new_field[ $col ] = isset( $values['field_options'][ $col . '_' . $field->id ] ) ? $values['field_options'][ $col . '_' . $field->id ] : $default;
519
+			$new_field[$col] = isset( $values['field_options'][$col . '_' . $field->id] ) ? $values['field_options'][$col . '_' . $field->id] : $default;
520 520
 		}
521 521
 
522 522
 		// Don't save the template option.
@@ -941,8 +941,8 @@  discard block
 block discarded – undo
941 941
 			self::maybe_get_form( $form );
942 942
 		}
943 943
 
944
-		if ( isset( $frm_vars['form_params'] ) && is_array( $frm_vars['form_params'] ) && isset( $frm_vars['form_params'][ $form->id ] ) ) {
945
-			return $frm_vars['form_params'][ $form->id ];
944
+		if ( isset( $frm_vars['form_params'] ) && is_array( $frm_vars['form_params'] ) && isset( $frm_vars['form_params'][$form->id] ) ) {
945
+			return $frm_vars['form_params'][$form->id];
946 946
 		}
947 947
 
948 948
 		$action_var = isset( $_REQUEST['frm_action'] ) ? 'frm_action' : 'action'; // phpcs:ignore WordPress.Security.NonceVerification.Missing
@@ -971,15 +971,15 @@  discard block
 block discarded – undo
971 971
 			// If there are two forms on the same page, make sure not to submit both.
972 972
 			foreach ( $default_values as $var => $default ) {
973 973
 				if ( $var == 'action' ) {
974
-					$values[ $var ] = FrmAppHelper::get_param( $action_var, $default, 'get', 'sanitize_title' );
974
+					$values[$var] = FrmAppHelper::get_param( $action_var, $default, 'get', 'sanitize_title' );
975 975
 				} else {
976
-					$values[ $var ] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' );
976
+					$values[$var] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' );
977 977
 				}
978 978
 				unset( $var, $default );
979 979
 			}
980 980
 		} else {
981 981
 			foreach ( $default_values as $var => $default ) {
982
-				$values[ $var ] = $default;
982
+				$values[$var] = $default;
983 983
 				unset( $var, $default );
984 984
 			}
985 985
 		}
@@ -1005,7 +1005,7 @@  discard block
 block discarded – undo
1005 1005
 			'sdir'     => '',
1006 1006
 		);
1007 1007
 		foreach ( $defaults as $var => $default ) {
1008
-			$values[ $var ] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' );
1008
+			$values[$var] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' );
1009 1009
 		}
1010 1010
 
1011 1011
 		return $values;
@@ -1033,7 +1033,7 @@  discard block
 block discarded – undo
1033 1033
 			'keep_post' => '',
1034 1034
 		);
1035 1035
 		foreach ( $defaults as $var => $default ) {
1036
-			$values[ $var ] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' );
1036
+			$values[$var] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' );
1037 1037
 		}
1038 1038
 
1039 1039
 		return $values;
@@ -1136,7 +1136,7 @@  discard block
 block discarded – undo
1136 1136
 		$form = $atts['form'];
1137 1137
 		$default = isset( $atts['default'] ) ? $atts['default'] : '';
1138 1138
 
1139
-		return isset( $form->options[ $atts['option'] ] ) ? $form->options[ $atts['option'] ] : $default;
1139
+		return isset( $form->options[$atts['option']] ) ? $form->options[$atts['option']] : $default;
1140 1140
 	}
1141 1141
 
1142 1142
 	/**
Please login to merge, or discard this patch.
classes/models/FrmFormTemplateApi.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@  discard block
 block discarded – undo
5 5
 
6 6
 class FrmFormTemplateApi extends FrmFormApi {
7 7
 
8
-	protected static $code_option_name  = 'frm_free_license_code';
8
+	protected static $code_option_name = 'frm_free_license_code';
9 9
 
10 10
 	private static $base_api_url = 'https://formidableforms.com/wp-json/form-templates/v1/';
11 11
 
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 
90 90
 		$templates    = $this->get_api_info();
91 91
 		$contact_form = 20872734;
92
-		return isset( $templates[ $contact_form ] ) && ! empty( $templates[ $contact_form ]['url'] );
92
+		return isset( $templates[$contact_form] ) && ! empty( $templates[$contact_form]['url'] );
93 93
 	}
94 94
 
95 95
 	/**
@@ -164,15 +164,15 @@  discard block
 block discarded – undo
164 164
 					continue;
165 165
 				}
166 166
 
167
-				$data['urlByKey'][ $template['key'] ] = $template['url'];
167
+				$data['urlByKey'][$template['key']] = $template['url'];
168 168
 			}
169 169
 
170
-			if ( ! isset( $data['urlByKey'][ $key ] ) ) {
170
+			if ( ! isset( $data['urlByKey'][$key] ) ) {
171 171
 				$error = new WP_Error( 400, 'We were unable to retrieve the template' );
172 172
 				wp_send_json_error( $error );
173 173
 			}
174 174
 
175
-			$data['url'] = $data['urlByKey'][ $key ];
175
+			$data['url'] = $data['urlByKey'][$key];
176 176
 		}//end if
177 177
 
178 178
 		wp_send_json_success( $data );
Please login to merge, or discard this patch.
classes/models/FrmEmail.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
 		$to = $this->prepare_email_setting( $this->settings['email_to'], $user_id_args );
163 163
 		$to = $this->explode_emails( $to );
164 164
 
165
-		$where  = array(
165
+		$where = array(
166 166
 			'it.field_id !' => 0,
167 167
 			'it.item_id'    => $this->entry->id,
168 168
 		);
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
 			'entry'     => $this->entry,
173 173
 			'form'      => $this->form,
174 174
 		);
175
-		$to     = apply_filters( 'frm_to_email', $to, $values, $this->form->id, $args );
175
+		$to = apply_filters( 'frm_to_email', $to, $values, $this->form->id, $args );
176 176
 
177 177
 		$this->to = array_unique( (array) $to );
178 178
 
@@ -408,7 +408,7 @@  discard block
 block discarded – undo
408 408
 
409 409
 		// Add the user info if it isn't already included
410 410
 		if ( $this->include_user_info && $prev_mail_body === $mail_body ) {
411
-			$data      = $this->entry->description;
411
+			$data = $this->entry->description;
412 412
 			$mail_body .= "\r\n\r\n" . __( 'User Information', 'formidable' ) . "\r\n";
413 413
 			$this->maybe_add_ip( $mail_body );
414 414
 			$mail_body .= __( 'User-Agent (Browser/OS)', 'formidable' ) . ': ' . FrmEntriesHelper::get_browser( $data['browser'] ) . "\r\n";
@@ -702,12 +702,12 @@  discard block
 block discarded – undo
702 702
 					$name = trim( str_replace( $email, '', $val ) );
703 703
 				} else {
704 704
 					// If user enters a name without an email
705
-					unset( $recipients[ $key ] );
705
+					unset( $recipients[$key] );
706 706
 					continue;
707 707
 				}
708 708
 			}
709 709
 
710
-			$recipients[ $key ] = $this->format_from_email( $name, $email );
710
+			$recipients[$key] = $this->format_from_email( $name, $email );
711 711
 		}//end foreach
712 712
 
713 713
 		return $recipients;
@@ -857,7 +857,7 @@  discard block
 block discarded – undo
857 857
 				);
858 858
 
859 859
 				// Remove phone number from to addresses
860
-				unset( $this->to[ $key ] );
860
+				unset( $this->to[$key] );
861 861
 			}//end if
862 862
 		}//end foreach
863 863
 	}
Please login to merge, or discard this patch.