Completed
Pull Request — master (#601)
by Stephanie
42s
created
classes/models/fields/FrmFieldEmail.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
 	public function validate( $args ) {
37 37
 		$errors = array();
38 38
 		if ( $args['value'] != '' && ! is_email( $args['value'] ) ) {
39
-			$errors[ 'field' . $args['id'] ] = FrmFieldsHelper::get_error_msg( $this->field, 'invalid' );
39
+			$errors['field' . $args['id']] = FrmFieldsHelper::get_error_msg( $this->field, 'invalid' );
40 40
 		}
41 41
 
42 42
 		return $errors;
Please login to merge, or discard this patch.
classes/models/fields/FrmFieldUrl.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 			'sep'  => ', ',
40 40
 			'html' => false,
41 41
 		);
42
-		$atts     = wp_parse_args( $atts, $defaults );
42
+		$atts = wp_parse_args( $atts, $defaults );
43 43
 
44 44
 		if ( $atts['html'] ) {
45 45
 			$atts['sep'] = ' ';
@@ -61,9 +61,9 @@  discard block
 block discarded – undo
61 61
 
62 62
 		// validate the url format
63 63
 		if ( ! empty( $value ) && ! preg_match( '/^http(s)?:\/\/(?:localhost|(?:[\da-z\.-]+\.[\da-z\.-]+))/i', $value ) ) {
64
-			$errors[ 'field' . $args['id'] ] = FrmFieldsHelper::get_error_msg( $this->field, 'invalid' );
64
+			$errors['field' . $args['id']] = FrmFieldsHelper::get_error_msg( $this->field, 'invalid' );
65 65
 		} elseif ( $this->field->required == '1' && empty( $value ) ) {
66
-			$errors[ 'field' . $args['id'] ] = FrmFieldsHelper::get_error_msg( $this->field, 'blank' );
66
+			$errors['field' . $args['id']] = FrmFieldsHelper::get_error_msg( $this->field, 'blank' );
67 67
 		}
68 68
 
69 69
 		return $errors;
Please login to merge, or discard this patch.
classes/models/FrmDb.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 		}
62 62
 
63 63
 		foreach ( $args as $key => $value ) {
64
-			$where          .= empty( $where ) ? $base_where : $condition;
64
+			$where .= empty( $where ) ? $base_where : $condition;
65 65
 			$array_inc_null = ( ! is_numeric( $key ) && is_array( $value ) && in_array( null, $value ) );
66 66
 			if ( is_numeric( $key ) || $array_inc_null ) {
67 67
 				$where        .= ' ( ';
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 
97 97
 		if ( strpos( $key, 'created_at' ) !== false || strpos( $key, 'updated_at' ) !== false ) {
98 98
 			$k        = explode( ' ', $key );
99
-			$where    .= ' DATE_FORMAT(' . reset( $k ) . ', %s) ' . str_replace( reset( $k ), '', $key );
99
+			$where .= ' DATE_FORMAT(' . reset( $k ) . ', %s) ' . str_replace( reset( $k ), '', $key );
100 100
 			$values[] = '%Y-%m-%d %H:%i:%s';
101 101
 		} else {
102 102
 			$where .= ' ' . $key;
@@ -116,12 +116,12 @@  discard block
 block discarded – undo
116 116
 						$where .= ' OR ';
117 117
 					}
118 118
 					$start    = false;
119
-					$where    .= $key . ' %s';
119
+					$where .= $key . ' %s';
120 120
 					$values[] = '%' . self::esc_like( $v ) . '%';
121 121
 				}
122 122
 				$where .= ')';
123 123
 			} elseif ( ! empty( $value ) ) {
124
-				$where  .= ' in (' . self::prepare_array_values( $value, '%s' ) . ')';
124
+				$where .= ' in (' . self::prepare_array_values( $value, '%s' ) . ')';
125 125
 				$values = array_merge( $values, $value );
126 126
 			}
127 127
 		} elseif ( strpos( $lowercase_key, 'like' ) !== false ) {
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
 				$where .= 'like';
142 142
 			}
143 143
 
144
-			$where    .= ' %s';
144
+			$where .= ' %s';
145 145
 			$values[] = $start . self::esc_like( $value ) . $end;
146 146
 
147 147
 		} elseif ( $value === null ) {
@@ -306,8 +306,8 @@  discard block
 block discarded – undo
306 306
 		);
307 307
 
308 308
 		$where_is = strtolower( $where_is );
309
-		if ( isset( $switch_to[ $where_is ] ) ) {
310
-			return ' ' . $switch_to[ $where_is ];
309
+		if ( isset( $switch_to[$where_is] ) ) {
310
+			return ' ' . $switch_to[$where_is];
311 311
 		}
312 312
 
313 313
 		// > and < need a little more work since we don't want them switched to >= and <=
@@ -360,13 +360,13 @@  discard block
 block discarded – undo
360 360
 		$temp_args = $args;
361 361
 		foreach ( $temp_args as $k => $v ) {
362 362
 			if ( $v == '' ) {
363
-				unset( $args[ $k ] );
363
+				unset( $args[$k] );
364 364
 				continue;
365 365
 			}
366 366
 
367 367
 			$db_name = strtoupper( str_replace( '_', ' ', $k ) );
368 368
 			if ( strpos( $v, $db_name ) === false ) {
369
-				$args[ $k ] = $db_name . ' ' . $v;
369
+				$args[$k] = $db_name . ' ' . $v;
370 370
 			}
371 371
 		}
372 372
 
@@ -440,13 +440,13 @@  discard block
 block discarded – undo
440 440
 	private static function esc_query_args( &$args ) {
441 441
 		foreach ( $args as $param => $value ) {
442 442
 			if ( $param == 'order_by' ) {
443
-				$args[ $param ] = self::esc_order( $value );
443
+				$args[$param] = self::esc_order( $value );
444 444
 			} elseif ( $param == 'limit' ) {
445
-				$args[ $param ] = self::esc_limit( $value );
445
+				$args[$param] = self::esc_limit( $value );
446 446
 			}
447 447
 
448
-			if ( $args[ $param ] == '' ) {
449
-				unset( $args[ $param ] );
448
+			if ( $args[$param] == '' ) {
449
+				unset( $args[$param] );
450 450
 			}
451 451
 		}
452 452
 	}
@@ -529,7 +529,7 @@  discard block
 block discarded – undo
529 529
 		$limit = explode( ',', trim( $limit ) );
530 530
 		foreach ( $limit as $k => $l ) {
531 531
 			if ( is_numeric( $l ) ) {
532
-				$limit[ $k ] = $l;
532
+				$limit[$k] = $l;
533 533
 			}
534 534
 		}
535 535
 
@@ -665,7 +665,7 @@  discard block
 block discarded – undo
665 665
 	 */
666 666
 	public static function add_key_to_group_cache( $key, $group ) {
667 667
 		$cached         = self::get_group_cached_keys( $group );
668
-		$cached[ $key ] = $key;
668
+		$cached[$key] = $key;
669 669
 		wp_cache_set( 'cached_keys', $cached, $group, 300 );
670 670
 	}
671 671
 
Please login to merge, or discard this patch.
classes/models/FrmSettings.php 2 patches
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -56,7 +56,8 @@  discard block
 block discarded – undo
56 56
 	}
57 57
 
58 58
 	private function translate_settings( $settings ) {
59
-		if ( $settings ) { //workaround for W3 total cache conflict
59
+		if ( $settings ) {
60
+//workaround for W3 total cache conflict
60 61
 			return unserialize( serialize( $settings ) );
61 62
 		}
62 63
 
@@ -68,7 +69,8 @@  discard block
 block discarded – undo
68 69
 		}
69 70
 
70 71
 		// If unserializing didn't work
71
-		if ( $settings ) { //workaround for W3 total cache conflict
72
+		if ( $settings ) {
73
+//workaround for W3 total cache conflict
72 74
 			$settings = unserialize( serialize( $settings ) );
73 75
 		} else {
74 76
 			$settings = $this;
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -161,8 +161,8 @@  discard block
 block discarded – undo
161 161
 		}
162 162
 
163 163
 		foreach ( $settings as $setting => $default ) {
164
-			if ( isset( $params[ 'frm_' . $setting ] ) ) {
165
-				$this->{$setting} = $params[ 'frm_' . $setting ];
164
+			if ( isset( $params['frm_' . $setting] ) ) {
165
+				$this->{$setting} = $params['frm_' . $setting];
166 166
 			} elseif ( ! isset( $this->{$setting} ) ) {
167 167
 				$this->{$setting} = $default;
168 168
 			}
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
 
271 271
 		$checkboxes = array( 'mu_menu', 're_multi', 'use_html', 'jquery_css', 'accordion_js', 'fade_form', 'no_ips', 'tracking', 'admin_bar' );
272 272
 		foreach ( $checkboxes as $set ) {
273
-			$this->$set = isset( $params[ 'frm_' . $set ] ) ? $params[ 'frm_' . $set ] : 0;
273
+			$this->$set = isset( $params['frm_' . $set] ) ? $params['frm_' . $set] : 0;
274 274
 		}
275 275
 	}
276 276
 
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
 		$frm_roles = FrmAppHelper::frm_capabilities();
281 281
 		$roles     = get_editable_roles();
282 282
 		foreach ( $frm_roles as $frm_role => $frm_role_description ) {
283
-			$this->$frm_role = (array) ( isset( $params[ $frm_role ] ) ? $params[ $frm_role ] : 'administrator' );
283
+			$this->$frm_role = (array) ( isset( $params[$frm_role] ) ? $params[$frm_role] : 'administrator' );
284 284
 
285 285
 			// Make sure administrators always have permissions
286 286
 			if ( ! in_array( 'administrator', $this->$frm_role ) ) {
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/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/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-form-actions/_action_inside.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
 	$event_labels = FrmFormAction::trigger_labels();
37 37
 	foreach ( $action_control->action_options['event'] as $event ) {
38 38
 		?>
39
-		<option value="<?php echo esc_attr( $event ); ?>" <?php echo in_array( $event, (array) $form_action->post_content['event'] ) ? ' selected="selected"' : ''; ?> ><?php echo esc_html( isset( $event_labels[ $event ] ) ? $event_labels[ $event ] : $event ); ?></option>
39
+		<option value="<?php echo esc_attr( $event ); ?>" <?php echo in_array( $event, (array) $form_action->post_content['event'] ) ? ' selected="selected"' : ''; ?> ><?php echo esc_html( isset( $event_labels[$event] ) ? $event_labels[$event] : $event ); ?></option>
40 40
 <?php } ?>
41 41
 		</select>
42 42
 	</p>
Please login to merge, or discard this patch.
classes/views/frm-form-actions/default_actions.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
3 3
 class FrmDefPostAction extends FrmFormAction {
4 4
 	public function __construct() {
5 5
 		$action_ops = FrmFormAction::default_action_opts( 'frm_wordpress_icon frm-inverse frm_show_upgrade' );
6
-		$action_ops['color']   = 'rgb(0,160,210)';
6
+		$action_ops['color'] = 'rgb(0,160,210)';
7 7
 
8 8
 		parent::__construct( 'wppost', __( 'Create Post', 'formidable' ), $action_ops );
9 9
 	}
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 class FrmDefMlcmpAction extends FrmFormAction {
43 43
 	public function __construct() {
44 44
 		$action_ops = FrmFormAction::default_action_opts( 'frm_mailchimp_icon frm_show_upgrade frm-inverse' );
45
-		$action_ops['color']   = 'var(--dark-grey)';
45
+		$action_ops['color'] = 'var(--dark-grey)';
46 46
 
47 47
 		parent::__construct( 'mailchimp', 'MailChimp', $action_ops );
48 48
 	}
Please login to merge, or discard this patch.