Completed
Push — master ( 466a17...06f781 )
by Stephanie
03:10
created
classes/models/FrmForm.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
 
139 139
 		foreach ( $values as $value_key => $value ) {
140 140
 			if ( $value_key && in_array( $value_key, $form_fields ) ) {
141
-				$new_values[ $value_key ] = $value;
141
+				$new_values[$value_key] = $value;
142 142
 			}
143 143
 		}
144 144
 
@@ -208,15 +208,15 @@  discard block
 block discarded – undo
208 208
 		$existing_keys = array_keys( $values['item_meta'] );
209 209
 		foreach ( $all_fields as $fid ) {
210 210
 			if ( ! in_array( $fid->id, $existing_keys ) && ( isset( $values['frm_fields_submitted'] ) && in_array( $fid->id, $values['frm_fields_submitted'] ) ) || isset( $values['options'] ) ) {
211
-				$values['item_meta'][ $fid->id ] = '';
211
+				$values['item_meta'][$fid->id] = '';
212 212
 			}
213
-			$field_array[ $fid->id ] = $fid;
213
+			$field_array[$fid->id] = $fid;
214 214
 		}
215 215
 		unset( $all_fields );
216 216
 
217 217
 		foreach ( $values['item_meta'] as $field_id => $default_value ) {
218
-			if ( isset( $field_array[ $field_id ] ) ) {
219
-				$field = $field_array[ $field_id ];
218
+			if ( isset( $field_array[$field_id] ) ) {
219
+				$field = $field_array[$field_id];
220 220
 			} else {
221 221
 				$field = FrmField::getOne( $field_id );
222 222
 			}
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
 				continue;
226 226
 			}
227 227
 
228
-			$is_settings_page = ( isset( $values['options'] ) || isset( $values['field_options'][ 'custom_html_' . $field_id ] ) );
228
+			$is_settings_page = ( isset( $values['options'] ) || isset( $values['field_options']['custom_html_' . $field_id] ) );
229 229
 			if ( $is_settings_page ) {
230 230
 				self::get_settings_page_html( $values, $field );
231 231
 
@@ -240,15 +240,15 @@  discard block
 block discarded – undo
240 240
 			$update_options = apply_filters( 'frm_field_options_to_update', $update_options );
241 241
 
242 242
 			foreach ( $update_options as $opt => $default ) {
243
-				$field->field_options[ $opt ] = isset( $values['field_options'][ $opt . '_' . $field_id ] ) ? $values['field_options'][ $opt . '_' . $field_id ] : $default;
244
-				self::sanitize_field_opt( $opt, $field->field_options[ $opt ] );
243
+				$field->field_options[$opt] = isset( $values['field_options'][$opt . '_' . $field_id] ) ? $values['field_options'][$opt . '_' . $field_id] : $default;
244
+				self::sanitize_field_opt( $opt, $field->field_options[$opt] );
245 245
 			}
246 246
 
247 247
 			$field->field_options = apply_filters( 'frm_update_field_options', $field->field_options, $field, $values );
248 248
 
249 249
 			$new_field = array(
250 250
 				'field_options' => $field->field_options,
251
-				'default_value' => isset( $values[ 'default_value_' . $field_id ] ) ? maybe_serialize( $values[ 'default_value_' . $field_id ] ) : '',
251
+				'default_value' => isset( $values['default_value_' . $field_id] ) ? maybe_serialize( $values['default_value_' . $field_id] ) : '',
252 252
 			);
253 253
 
254 254
 			self::prepare_field_update_values( $field, $values, $new_field );
@@ -277,11 +277,11 @@  discard block
 block discarded – undo
277 277
 	 * Updating the settings page
278 278
 	 */
279 279
 	private static function get_settings_page_html( $values, &$field ) {
280
-		if ( isset( $values['field_options'][ 'custom_html_' . $field->id ] ) ) {
280
+		if ( isset( $values['field_options']['custom_html_' . $field->id] ) ) {
281 281
 			$prev_opts     = array();
282 282
 			$fallback_html = isset( $field->field_options['custom_html'] ) ? $field->field_options['custom_html'] : FrmFieldsHelper::get_default_html( $field->type );
283 283
 
284
-			$field->field_options['custom_html'] = isset( $values['field_options'][ 'custom_html_' . $field->id ] ) ? $values['field_options'][ 'custom_html_' . $field->id ] : $fallback_html;
284
+			$field->field_options['custom_html'] = isset( $values['field_options']['custom_html_' . $field->id] ) ? $values['field_options']['custom_html_' . $field->id] : $fallback_html;
285 285
 		} elseif ( $field->type == 'hidden' || $field->type == 'user_id' ) {
286 286
 			$prev_opts = $field->field_options;
287 287
 		}
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
 		foreach ( $field_cols as $col => $default ) {
308 308
 			$default = ( $default === '' ) ? $field->{$col} : $default;
309 309
 
310
-			$new_field[ $col ] = isset( $values['field_options'][ $col . '_' . $field->id ] ) ? $values['field_options'][ $col . '_' . $field->id ] : $default;
310
+			$new_field[$col] = isset( $values['field_options'][$col . '_' . $field->id] ) ? $values['field_options'][$col . '_' . $field->id] : $default;
311 311
 		}
312 312
 
313 313
 		// Don't save the template option.
@@ -721,8 +721,8 @@  discard block
 block discarded – undo
721 721
 			self::maybe_get_form( $form );
722 722
 		}
723 723
 
724
-		if ( isset( $frm_vars['form_params'] ) && is_array( $frm_vars['form_params'] ) && isset( $frm_vars['form_params'][ $form->id ] ) ) {
725
-			return $frm_vars['form_params'][ $form->id ];
724
+		if ( isset( $frm_vars['form_params'] ) && is_array( $frm_vars['form_params'] ) && isset( $frm_vars['form_params'][$form->id] ) ) {
725
+			return $frm_vars['form_params'][$form->id];
726 726
 		}
727 727
 
728 728
 		$action_var = isset( $_REQUEST['frm_action'] ) ? 'frm_action' : 'action'; // WPCS: CSRF ok.
@@ -751,15 +751,15 @@  discard block
 block discarded – undo
751 751
 			//if there are two forms on the same page, make sure not to submit both
752 752
 			foreach ( $default_values as $var => $default ) {
753 753
 				if ( $var == 'action' ) {
754
-					$values[ $var ] = FrmAppHelper::get_param( $action_var, $default, 'get', 'sanitize_title' );
754
+					$values[$var] = FrmAppHelper::get_param( $action_var, $default, 'get', 'sanitize_title' );
755 755
 				} else {
756
-					$values[ $var ] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' );
756
+					$values[$var] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' );
757 757
 				}
758 758
 				unset( $var, $default );
759 759
 			}
760 760
 		} else {
761 761
 			foreach ( $default_values as $var => $default ) {
762
-				$values[ $var ] = $default;
762
+				$values[$var] = $default;
763 763
 				unset( $var, $default );
764 764
 			}
765 765
 		}
@@ -785,7 +785,7 @@  discard block
 block discarded – undo
785 785
 			'sdir'     => '',
786 786
 		);
787 787
 		foreach ( $defaults as $var => $default ) {
788
-			$values[ $var ] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' );
788
+			$values[$var] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' );
789 789
 		}
790 790
 
791 791
 		return $values;
@@ -813,7 +813,7 @@  discard block
 block discarded – undo
813 813
 			'keep_post' => '',
814 814
 		);
815 815
 		foreach ( $defaults as $var => $default ) {
816
-			$values[ $var ] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' );
816
+			$values[$var] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' );
817 817
 		}
818 818
 
819 819
 		return $values;
@@ -898,7 +898,7 @@  discard block
 block discarded – undo
898 898
 	public static function get_option( $atts ) {
899 899
 		$form = $atts['form'];
900 900
 
901
-		return isset( $form->options[ $atts['option'] ] ) ? $form->options[ $atts['option'] ] : $atts['default'];
901
+		return isset( $form->options[$atts['option']] ) ? $form->options[$atts['option']] : $atts['default'];
902 902
 	}
903 903
 
904 904
 	/**
Please login to merge, or discard this patch.
classes/models/FrmCreateFile.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -146,7 +146,7 @@
 block discarded – undo
146 146
 
147 147
 		$next_dir = '';
148 148
 		foreach ( $dir_names as $dir ) {
149
-			$next_dir      .= '/' . $dir;
149
+			$next_dir .= '/' . $dir;
150 150
 			$needed_dirs[] = $this->uploads['basedir'] . $next_dir;
151 151
 		}
152 152
 
Please login to merge, or discard this patch.
classes/models/FrmReviews.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -71,12 +71,12 @@
 block discarded – undo
71 71
 		$show_intervals = array( 50, 200, 500 );
72 72
 		$asked          = $this->review_status['asked'];
73 73
 
74
-		if ( ! isset( $show_intervals[ $asked ] ) ) {
74
+		if ( ! isset( $show_intervals[$asked] ) ) {
75 75
 			return;
76 76
 		}
77 77
 
78 78
 		$entries = FrmEntry::getRecordCount();
79
-		$count   = $show_intervals[ $asked ];
79
+		$count   = $show_intervals[$asked];
80 80
 		$user    = wp_get_current_user();
81 81
 
82 82
 		// Only show review request if the site has collected enough entries
Please login to merge, or discard this patch.
classes/models/FrmTableHTMLGenerator.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 	 * @param array $atts
72 72
 	 */
73 73
 	private function init_style_settings( $atts ) {
74
-		$style_settings       = array(
74
+		$style_settings = array(
75 75
 			'border_color' => 'dddddd',
76 76
 			'bg_color'     => 'f7f7f7',
77 77
 			'text_color'   => '444444',
@@ -82,12 +82,12 @@  discard block
 block discarded – undo
82 82
 		$this->style_settings = apply_filters( 'frm_show_entry_styles', $style_settings );
83 83
 
84 84
 		foreach ( $this->style_settings as $key => $setting ) {
85
-			if ( isset( $atts[ $key ] ) && $atts[ $key ] !== '' ) {
86
-				$this->style_settings[ $key ] = $atts[ $key ];
85
+			if ( isset( $atts[$key] ) && $atts[$key] !== '' ) {
86
+				$this->style_settings[$key] = $atts[$key];
87 87
 			}
88 88
 
89 89
 			if ( $this->is_color_setting( $key ) ) {
90
-				$this->style_settings[ $key ] = $this->get_color_markup( $this->style_settings[ $key ] );
90
+				$this->style_settings[$key] = $this->get_color_markup( $this->style_settings[$key] );
91 91
 			}
92 92
 		}
93 93
 
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
@@ -41,8 +41,8 @@  discard block
 block discarded – undo
41 41
 	 * @param array $atts
42 42
 	 */
43 43
 	private function _set( $param, $atts ) {
44
-		if ( isset( $atts[ $param ] ) ) {
45
-			$this->{$param} = $atts[ $param ];
44
+		if ( isset( $atts[$param] ) ) {
45
+			$this->{$param} = $atts[$param];
46 46
 		}
47 47
 	}
48 48
 
@@ -86,8 +86,8 @@  discard block
 block discarded – undo
86 86
 
87 87
 		$exclude = array( 'field_obj', 'html' );
88 88
 		foreach ( $exclude as $ex ) {
89
-			if ( isset( $atts[ $ex ] ) ) {
90
-				unset( $this->pass_args[ $ex ] );
89
+			if ( isset( $atts[$ex] ) ) {
90
+				unset( $this->pass_args[$ex] );
91 91
 			}
92 92
 		}
93 93
 	}
@@ -99,8 +99,8 @@  discard block
 block discarded – undo
99 99
 	 * @param array $set
100 100
 	 */
101 101
 	private function set_from_field( $atts, $set ) {
102
-		if ( isset( $atts[ $set['param'] ] ) ) {
103
-			$this->{$set['param']} = $atts[ $set['param'] ];
102
+		if ( isset( $atts[$set['param']] ) ) {
103
+			$this->{$set['param']} = $atts[$set['param']];
104 104
 		} else {
105 105
 			$this->{$set['param']} = $this->field_obj->get_field_column( $set['default'] );
106 106
 		}
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
 	 */
226 226
 	private function replace_error_shortcode() {
227 227
 		$this->maybe_add_error_id();
228
-		$error = isset( $this->pass_args['errors'][ 'field' . $this->field_id ] ) ? $this->pass_args['errors'][ 'field' . $this->field_id ] : false;
228
+		$error = isset( $this->pass_args['errors']['field' . $this->field_id] ) ? $this->pass_args['errors']['field' . $this->field_id] : false;
229 229
 		FrmShortcodeHelper::remove_inline_conditions( ! empty( $error ), 'error', $error, $this->html );
230 230
 	}
231 231
 
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
 	 * @since 3.06.02
237 237
 	 */
238 238
 	private function maybe_add_error_id() {
239
-		if ( ! isset( $this->pass_args['errors'][ 'field' . $this->field_id ] ) ) {
239
+		if ( ! isset( $this->pass_args['errors']['field' . $this->field_id] ) ) {
240 240
 			return;
241 241
 		}
242 242
 
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
 		preg_match_all( "/\[(input|deletelink)\b(.*?)(?:(\/))?\]/s", $this->html, $shortcodes, PREG_PATTERN_ORDER );
317 317
 
318 318
 		foreach ( $shortcodes[0] as $short_key => $tag ) {
319
-			$shortcode_atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[2][ $short_key ] );
319
+			$shortcode_atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[2][$short_key] );
320 320
 			$tag            = FrmShortcodeHelper::get_shortcode_tag( $shortcodes, $short_key );
321 321
 
322 322
 			$replace_with = '';
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
 				$replace_with = $this->replace_input_shortcode( $shortcode_atts );
328 328
 			}
329 329
 
330
-			$this->html = str_replace( $shortcodes[0][ $short_key ], $replace_with, $this->html );
330
+			$this->html = str_replace( $shortcodes[0][$short_key], $replace_with, $this->html );
331 331
 		}
332 332
 	}
333 333
 
@@ -359,7 +359,7 @@  discard block
 block discarded – undo
359 359
 			unset( $shortcode_atts['class'] );
360 360
 		}
361 361
 
362
-		if ( isset( $this->pass_args['errors'][ 'field' . $this->field_id ] ) ) {
362
+		if ( isset( $this->pass_args['errors']['field' . $this->field_id] ) ) {
363 363
 			$shortcode_atts['aria-invalid'] = 'true';
364 364
 		}
365 365
 
@@ -416,7 +416,7 @@  discard block
 block discarded – undo
416 416
 	 */
417 417
 	private function get_field_div_classes() {
418 418
 		// Add error class
419
-		$classes = isset( $this->pass_args['errors'][ 'field' . $this->field_id ] ) ? ' frm_blank_field' : '';
419
+		$classes = isset( $this->pass_args['errors']['field' . $this->field_id] ) ? ' frm_blank_field' : '';
420 420
 
421 421
 		// Add label position class
422 422
 		$settings = $this->field_obj->display_field_settings();
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
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 		$to = $this->prepare_email_setting( $this->settings['email_to'], $user_id_args );
86 86
 		$to = $this->explode_emails( $to );
87 87
 
88
-		$where  = array(
88
+		$where = array(
89 89
 			'it.field_id !' => 0,
90 90
 			'it.item_id'    => $this->entry->id,
91 91
 		);
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 			'entry'     => $this->entry,
96 96
 			'form'      => $this->form,
97 97
 		);
98
-		$to     = apply_filters( 'frm_to_email', $to, $values, $this->form->id, $args );
98
+		$to = apply_filters( 'frm_to_email', $to, $values, $this->form->id, $args );
99 99
 
100 100
 		$this->to = array_unique( (array) $to );
101 101
 
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
 
299 299
 		// Add the user info if it isn't already included
300 300
 		if ( $this->include_user_info && $prev_mail_body === $mail_body ) {
301
-			$data      = maybe_unserialize( $this->entry->description );
301
+			$data = maybe_unserialize( $this->entry->description );
302 302
 			$mail_body .= "\r\n\r\n" . __( 'User Information', 'formidable' ) . "\r\n";
303 303
 			$this->maybe_add_ip( $mail_body );
304 304
 			$mail_body .= __( 'User-Agent (Browser/OS)', 'formidable' ) . ': ' . FrmEntriesHelper::get_browser( $data['browser'] ) . "\r\n";
@@ -563,12 +563,12 @@  discard block
 block discarded – undo
563 563
 					$name = trim( str_replace( $email, '', $val ) );
564 564
 				} else {
565 565
 					// If user enters a name without an email
566
-					unset( $recipients[ $key ] );
566
+					unset( $recipients[$key] );
567 567
 					continue;
568 568
 				}
569 569
 			}
570 570
 
571
-			$recipients[ $key ] = $this->format_from_email( $name, $email );
571
+			$recipients[$key] = $this->format_from_email( $name, $email );
572 572
 		}
573 573
 
574 574
 		return $recipients;
@@ -709,7 +709,7 @@  discard block
 block discarded – undo
709 709
 				);
710 710
 
711 711
 				// Remove phone number from to addresses
712
-				unset( $this->to[ $key ] );
712
+				unset( $this->to[$key] );
713 713
 			}
714 714
 		}
715 715
 	}
Please login to merge, or discard this patch.
classes/models/FrmFieldValue.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -59,8 +59,8 @@
 block discarded – undo
59 59
 	protected function init_saved_value( $entry ) {
60 60
 		if ( $this->field->type === 'html' ) {
61 61
 			$this->saved_value = $this->field->description;
62
-		} elseif ( isset( $entry->metas[ $this->field->id ] ) ) {
63
-			$this->saved_value = $entry->metas[ $this->field->id ];
62
+		} elseif ( isset( $entry->metas[$this->field->id] ) ) {
63
+			$this->saved_value = $entry->metas[$this->field->id];
64 64
 		} else {
65 65
 			$this->saved_value = '';
66 66
 		}
Please login to merge, or discard this patch.
classes/views/frm-fields/back-end/field-multiple.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,6 +6,6 @@
 block discarded – undo
6 6
 	$type = $field['type'];
7 7
 	do_action( 'frm_after_checkbox', compact( 'field', 'field_name', 'type' ) );
8 8
 } else {
9
-	$read_only  = $field['read_only'];
9
+	$read_only = $field['read_only'];
10 10
 	include( dirname( __FILE__ ) . '/' . $field['type'] . '-field.php' );
11 11
 }
Please login to merge, or discard this patch.
classes/views/frm-forms/list-templates.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -148,7 +148,7 @@
 block discarded – undo
148 148
 						<?php } ?>
149 149
 					</div>
150 150
 				</div>
151
-				<?php unset( $template, $templates[ $k ] ); ?>
151
+				<?php unset( $template, $templates[$k] ); ?>
152 152
 			<?php } ?>
153 153
 		</div>
154 154
 		<?php if ( $expired ) { ?>
Please login to merge, or discard this patch.