Completed
Pull Request — master (#1304)
by Stephanie
42s
created
classes/helpers/FrmFormsHelper.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 			'class'        => '',
29 29
 			'inc_children' => 'exclude',
30 30
 		);
31
-		$args     = wp_parse_args( $args, $defaults );
31
+		$args = wp_parse_args( $args, $defaults );
32 32
 
33 33
 		if ( ! $args['field_id'] ) {
34 34
 			$args['field_id'] = $field_name;
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 	 */
71 71
 	public static function add_html_attr( $class, $param, &$add_html ) {
72 72
 		if ( ! empty( $class ) ) {
73
-			$add_html[ $param ] = sanitize_title( $param ) . '="' . esc_attr( trim( sanitize_text_field( $class ) ) ) . '"';
73
+			$add_html[$param] = sanitize_title( $param ) . '="' . esc_attr( trim( sanitize_text_field( $class ) ) ) . '"';
74 74
 		}
75 75
 	}
76 76
 
@@ -293,8 +293,8 @@  discard block
 block discarded – undo
293 293
 			'description' => '',
294 294
 		);
295 295
 		foreach ( $defaults as $var => $default ) {
296
-			if ( ! isset( $values[ $var ] ) ) {
297
-				$values[ $var ] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' );
296
+			if ( ! isset( $values[$var] ) ) {
297
+				$values[$var] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' );
298 298
 			}
299 299
 		}
300 300
 
@@ -309,8 +309,8 @@  discard block
 block discarded – undo
309 309
 			'parent_form_id' => 0,
310 310
 		);
311 311
 		foreach ( $defaults as $var => $default ) {
312
-			if ( ! isset( $values[ $var ] ) ) {
313
-				$values[ $var ] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' );
312
+			if ( ! isset( $values[$var] ) ) {
313
+				$values[$var] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' );
314 314
 			}
315 315
 		}
316 316
 		unset( $defaults );
@@ -347,16 +347,16 @@  discard block
 block discarded – undo
347 347
 		$defaults = self::get_default_opts();
348 348
 		foreach ( $defaults as $var => $default ) {
349 349
 			if ( is_array( $default ) ) {
350
-				if ( ! isset( $values[ $var ] ) ) {
351
-					$values[ $var ] = ( $record && isset( $record->options[ $var ] ) ) ? $record->options[ $var ] : array();
350
+				if ( ! isset( $values[$var] ) ) {
351
+					$values[$var] = ( $record && isset( $record->options[$var] ) ) ? $record->options[$var] : array();
352 352
 				}
353 353
 
354 354
 				foreach ( $default as $k => $v ) {
355
-					$values[ $var ][ $k ] = ( $post_values && isset( $post_values[ $var ][ $k ] ) ) ? $post_values[ $var ][ $k ] : ( ( $record && isset( $record->options[ $var ] ) && isset( $record->options[ $var ][ $k ] ) ) ? $record->options[ $var ][ $k ] : $v );
355
+					$values[$var][$k] = ( $post_values && isset( $post_values[$var][$k] ) ) ? $post_values[$var][$k] : ( ( $record && isset( $record->options[$var] ) && isset( $record->options[$var][$k] ) ) ? $record->options[$var][$k] : $v );
356 356
 
357 357
 					if ( is_array( $v ) ) {
358 358
 						foreach ( $v as $k1 => $v1 ) {
359
-							$values[ $var ][ $k ][ $k1 ] = ( $post_values && isset( $post_values[ $var ][ $k ][ $k1 ] ) ) ? $post_values[ $var ][ $k ][ $k1 ] : ( ( $record && isset( $record->options[ $var ] ) && isset( $record->options[ $var ][ $k ] ) && isset( $record->options[ $var ][ $k ][ $k1 ] ) ) ? $record->options[ $var ][ $k ][ $k1 ] : $v1 );
359
+							$values[$var][$k][$k1] = ( $post_values && isset( $post_values[$var][$k][$k1] ) ) ? $post_values[$var][$k][$k1] : ( ( $record && isset( $record->options[$var] ) && isset( $record->options[$var][$k] ) && isset( $record->options[$var][$k][$k1] ) ) ? $record->options[$var][$k][$k1] : $v1 );
360 360
 							unset( $k1, $v1 );
361 361
 						}
362 362
 					}
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
 					unset( $k, $v );
365 365
 				}
366 366
 			} else {
367
-				$values[ $var ] = ( $post_values && isset( $post_values['options'][ $var ] ) ) ? $post_values['options'][ $var ] : ( ( $record && isset( $record->options[ $var ] ) ) ? $record->options[ $var ] : $default );
367
+				$values[$var] = ( $post_values && isset( $post_values['options'][$var] ) ) ? $post_values['options'][$var] : ( ( $record && isset( $record->options[$var] ) ) ? $record->options[$var] : $default );
368 368
 			}
369 369
 
370 370
 			unset( $var, $default );
@@ -410,7 +410,7 @@  discard block
 block discarded – undo
410 410
 	public static function fill_form_options( &$options, $values ) {
411 411
 		$defaults = self::get_default_opts();
412 412
 		foreach ( $defaults as $var => $default ) {
413
-			$options[ $var ] = isset( $values['options'][ $var ] ) ? $values['options'][ $var ] : $default;
413
+			$options[$var] = isset( $values['options'][$var] ) ? $values['options'][$var] : $default;
414 414
 			unset( $var, $default );
415 415
 		}
416 416
 	}
@@ -585,7 +585,7 @@  discard block
 block discarded – undo
585 585
 	public static function insert_opt_html( $args ) {
586 586
 		$class  = isset( $args['class'] ) ? $args['class'] : '';
587 587
 		$fields = FrmField::all_field_selection();
588
-		$field  = isset( $fields[ $args['type'] ] ) ? $fields[ $args['type'] ] : array();
588
+		$field  = isset( $fields[$args['type']] ) ? $fields[$args['type']] : array();
589 589
 
590 590
 		self::prepare_field_type( $field );
591 591
 
@@ -741,7 +741,7 @@  discard block
 block discarded – undo
741 741
 			FrmField::update( $field->id, array( 'field_order' => $field->field_order + 2 ) );
742 742
 		}
743 743
 
744
-		$add_order    += 2;
744
+		$add_order += 2;
745 745
 		$open         = false;
746 746
 		$reset_fields = true;
747 747
 	}
@@ -1148,10 +1148,10 @@  discard block
 block discarded – undo
1148 1148
 				$link .= ' onclick="return confirm(\'' . esc_attr( $link_details['confirm'] ) . '\')"';
1149 1149
 			}
1150 1150
 
1151
-			$label = ( isset( $link_details[ $length ] ) ? $link_details[ $length ] : $link_details['label'] );
1152
-			if ( $length == 'icon' && isset( $link_details[ $length ] ) ) {
1151
+			$label = ( isset( $link_details[$length] ) ? $link_details[$length] : $link_details['label'] );
1152
+			if ( $length == 'icon' && isset( $link_details[$length] ) ) {
1153 1153
 				$label = '<span class="' . $label . '" title="' . esc_attr( $link_details['label'] ) . '" aria-hidden="true"></span>';
1154
-				$link  .= ' aria-label="' . esc_attr( $link_details['label'] ) . '"';
1154
+				$link .= ' aria-label="' . esc_attr( $link_details['label'] ) . '"';
1155 1155
 			}
1156 1156
 
1157 1157
 			$link .= '>' . $label . '</a>';
@@ -1296,7 +1296,7 @@  discard block
 block discarded – undo
1296 1296
 			$status = 'publish';
1297 1297
 		}
1298 1298
 
1299
-		$name = $nice_names[ $status ];
1299
+		$name = $nice_names[$status];
1300 1300
 
1301 1301
 		return $name;
1302 1302
 	}
@@ -1360,7 +1360,7 @@  discard block
 block discarded – undo
1360 1360
 		$icon = $icons[''];
1361 1361
 		if ( count( $categories ) === 1 ) {
1362 1362
 			$category = reset( $categories );
1363
-			$icon = isset( $icons[ $category ] ) ? $icons[ $category ] : $icon;
1363
+			$icon = isset( $icons[$category] ) ? $icons[$category] : $icon;
1364 1364
 		} elseif ( ! empty( $categories ) ) {
1365 1365
 			$icons = array_intersect_key( $icons, array_flip( $categories ) );
1366 1366
 			$icon = reset( $icons );
@@ -1496,7 +1496,7 @@  discard block
 block discarded – undo
1496 1496
 
1497 1497
 		foreach ( $item['categories'] as $k => $category ) {
1498 1498
 			if ( in_array( $category, $plans, true ) ) {
1499
-				unset( $item['categories'][ $k ] );
1499
+				unset( $item['categories'][$k] );
1500 1500
 
1501 1501
 				if ( in_array( $category, array( 'Creator', 'Personal' ), true ) ) {
1502 1502
 					// Show the current package name.
@@ -1698,9 +1698,9 @@  discard block
 block discarded – undo
1698 1698
 		}
1699 1699
 
1700 1700
 		foreach ( $shortcodes[0] as $key => $shortcode ) {
1701
-			$options = trim( $shortcodes[3][ $key ] );
1701
+			$options = trim( $shortcodes[3][$key] );
1702 1702
 
1703
-			if ( in_array( $shortcodes[1][ $key ], array( 'if ' ), true ) ) {
1703
+			if ( in_array( $shortcodes[1][$key], array( 'if ' ), true ) ) {
1704 1704
 				// Skip if shortcodes.
1705 1705
 				continue;
1706 1706
 			}
@@ -1710,7 +1710,7 @@  discard block
 block discarded – undo
1710 1710
 				continue;
1711 1711
 			}
1712 1712
 
1713
-			$new_shortcode = '[' . $shortcodes[2][ $key ];
1713
+			$new_shortcode = '[' . $shortcodes[2][$key];
1714 1714
 			if ( $options ) {
1715 1715
 				$new_shortcode .= ' ' . $options;
1716 1716
 			}
Please login to merge, or discard this patch.
classes/controllers/FrmAppController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -388,7 +388,7 @@
 block discarded – undo
388 388
 	 * @return void
389 389
 	 */
390 390
 	public static function api_email_form( $form_key, $title, $description ) {
391
-		$user        = wp_get_current_user();
391
+		$user = wp_get_current_user();
392 392
 		$args = array(
393 393
 			'api_url'     => 'https://sandbox.formidableforms.com/api/wp-json/frm/v2/forms/' . $form_key . '?return=html&exclude_script=jquery&exclude_style=formidable-css',
394 394
 			'title'       => $title,
Please login to merge, or discard this patch.
classes/helpers/FrmEntriesListHelper.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 
71 71
 		if ( strpos( $orderby, 'meta' ) !== false ) {
72 72
 			$order_field_type = FrmField::get_type( str_replace( 'meta_', '', $orderby ) );
73
-			$orderby          .= in_array( $order_field_type, array( 'number', 'scale', 'star' ) ) ? '+0' : '';
73
+			$orderby .= in_array( $order_field_type, array( 'number', 'scale', 'star' ) ) ? '+0' : '';
74 74
 		}
75 75
 
76 76
 		$order = self::get_param(
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
 			$form_ids              = $this->get_form_ids( $form_id );
117 117
 			$s_query['it.form_id'] = count( $form_ids ) > 1 ? $form_ids : $form_ids[0];
118 118
 		} else {
119
-			$s_query[]          = array(
119
+			$s_query[] = array(
120 120
 				'or'               => 1,
121 121
 				'parent_form_id'   => null,
122 122
 				'parent_form_id <' => 1,
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
 
266 266
 		$r = "<tr id='item-action-{$item->id}'$style>";
267 267
 
268
-		list( $columns, $hidden, , $primary ) = $this->get_column_info();
268
+		list( $columns, $hidden,, $primary ) = $this->get_column_info();
269 269
 		$action_col                           = false;
270 270
 		$action_columns                       = $this->get_action_columns();
271 271
 
Please login to merge, or discard this patch.
classes/models/FrmDb.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 		}
65 65
 
66 66
 		foreach ( $args as $key => $value ) {
67
-			$where          .= empty( $where ) ? $base_where : $condition;
67
+			$where .= empty( $where ) ? $base_where : $condition;
68 68
 			$array_inc_null = ( ! is_numeric( $key ) && is_array( $value ) && in_array( null, $value ) );
69 69
 			if ( is_numeric( $key ) || $array_inc_null ) {
70 70
 				$where        .= ' ( ';
@@ -113,12 +113,12 @@  discard block
 block discarded – undo
113 113
 						$where .= ' OR ';
114 114
 					}
115 115
 					$start    = false;
116
-					$where    .= $key . ' %s';
116
+					$where .= $key . ' %s';
117 117
 					$values[] = '%' . self::esc_like( $v ) . '%';
118 118
 				}
119 119
 				$where .= ')';
120 120
 			} elseif ( ! empty( $value ) ) {
121
-				$where  .= ' in (' . self::prepare_array_values( $value, '%s' ) . ')';
121
+				$where .= ' in (' . self::prepare_array_values( $value, '%s' ) . ')';
122 122
 				$values = array_merge( $values, $value );
123 123
 			}
124 124
 		} elseif ( strpos( $lowercase_key, 'like' ) !== false ) {
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
 				$where .= 'like';
139 139
 			}
140 140
 
141
-			$where    .= ' %s';
141
+			$where .= ' %s';
142 142
 			$values[] = $start . self::esc_like( $value ) . $end;
143 143
 
144 144
 		} 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 <=
@@ -371,13 +371,13 @@  discard block
 block discarded – undo
371 371
 		$temp_args = $args;
372 372
 		foreach ( $temp_args as $k => $v ) {
373 373
 			if ( $v == '' ) {
374
-				unset( $args[ $k ] );
374
+				unset( $args[$k] );
375 375
 				continue;
376 376
 			}
377 377
 
378 378
 			$db_name = strtoupper( str_replace( '_', ' ', $k ) );
379 379
 			if ( strpos( $v, $db_name ) === false ) {
380
-				$args[ $k ] = $db_name . ' ' . $v;
380
+				$args[$k] = $db_name . ' ' . $v;
381 381
 			}
382 382
 		}
383 383
 
@@ -451,13 +451,13 @@  discard block
 block discarded – undo
451 451
 	private static function esc_query_args( &$args ) {
452 452
 		foreach ( $args as $param => $value ) {
453 453
 			if ( $param == 'order_by' ) {
454
-				$args[ $param ] = self::esc_order( $value );
454
+				$args[$param] = self::esc_order( $value );
455 455
 			} elseif ( $param == 'limit' ) {
456
-				$args[ $param ] = self::esc_limit( $value );
456
+				$args[$param] = self::esc_limit( $value );
457 457
 			}
458 458
 
459
-			if ( $args[ $param ] == '' ) {
460
-				unset( $args[ $param ] );
459
+			if ( $args[$param] == '' ) {
460
+				unset( $args[$param] );
461 461
 			}
462 462
 		}
463 463
 	}
@@ -540,7 +540,7 @@  discard block
 block discarded – undo
540 540
 		$limit = explode( ',', trim( $limit ) );
541 541
 		foreach ( $limit as $k => $l ) {
542 542
 			if ( is_numeric( $l ) ) {
543
-				$limit[ $k ] = $l;
543
+				$limit[$k] = $l;
544 544
 			}
545 545
 		}
546 546
 
@@ -691,7 +691,7 @@  discard block
 block discarded – undo
691 691
 	 */
692 692
 	public static function add_key_to_group_cache( $key, $group ) {
693 693
 		$cached         = self::get_group_cached_keys( $group );
694
-		$cached[ $key ] = $key;
694
+		$cached[$key] = $key;
695 695
 		wp_cache_set( 'cached_keys', $cached, $group, 300 );
696 696
 	}
697 697
 
Please login to merge, or discard this patch.
classes/views/frm-fields/front-end/combo-field/combo-field.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 			$sub_field_class   = "frm_form_field form-field frm_form_subfield-{$name} {$sub_field['wrapper_classes']}";
42 42
 			$sub_field_desc    = FrmField::get_option( $field, $name . '_desc' );
43 43
 
44
-			if ( isset( $errors[ 'field' . $field_id . '-' . $name ] ) ) {
44
+			if ( isset( $errors['field' . $field_id . '-' . $name] ) ) {
45 45
 				$sub_field_class .= ' frm_blank_field';
46 46
 			}
47 47
 			?>
@@ -61,10 +61,10 @@  discard block
 block discarded – undo
61 61
 						<input
62 62
 							type="<?php echo esc_attr( $sub_field['type'] ); ?>"
63 63
 							id="<?php echo esc_attr( $html_id . '_' . $name ); ?>"
64
-							value="<?php echo esc_attr( isset( $field_value[ $name ] ) ? $field_value[ $name ] : '' ); ?>"
64
+							value="<?php echo esc_attr( isset( $field_value[$name] ) ? $field_value[$name] : '' ); ?>"
65 65
 							<?php
66
-							if ( ! empty( $field_value[ $name ] ) ) {
67
-								echo 'data-frmval="' . esc_attr( $field_value[ $name ] ) . '" ';
66
+							if ( ! empty( $field_value[$name] ) ) {
67
+								echo 'data-frmval="' . esc_attr( $field_value[$name] ) . '" ';
68 68
 							}
69 69
 							if ( empty( $args['remove_names'] ) ) {
70 70
 								echo 'name="' . esc_attr( $field_name ) . '[' . esc_attr( $name ) . ']" ';
@@ -81,9 +81,9 @@  discard block
 block discarded – undo
81 81
 				}
82 82
 
83 83
 				// Don't show individual field errors when there is a combo field error.
84
-				if ( ! empty( $errors ) && isset( $errors[ 'field' . $field_id . '-' . $name ] ) && ! isset( $errors[ 'field' . $field_id ] ) ) {
84
+				if ( ! empty( $errors ) && isset( $errors['field' . $field_id . '-' . $name] ) && ! isset( $errors['field' . $field_id] ) ) {
85 85
 					?>
86
-					<div class="frm_error" role="alert"><?php echo esc_html( $errors[ 'field' . $field_id . '-' . $name ] ); ?></div>
86
+					<div class="frm_error" role="alert"><?php echo esc_html( $errors['field' . $field_id . '-' . $name] ); ?></div>
87 87
 				<?php } ?>
88 88
 			</div>
89 89
 		<?php } ?>
Please login to merge, or discard this patch.
classes/views/frm-fields/front-end/checkbox-field.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -83,6 +83,6 @@
 block discarded – undo
83 83
 
84 84
 		?></div>
85 85
 <?php
86
-		++$option_index;
86
+		++ $option_index;
87 87
 	}
88 88
 }
Please login to merge, or discard this patch.
classes/helpers/FrmCurrencyHelper.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -16,10 +16,10 @@
 block discarded – undo
16 16
 	public static function get_currency( $currency ) {
17 17
 		$currency   = strtoupper( $currency );
18 18
 		$currencies = self::get_currencies();
19
-		if ( isset( $currencies[ $currency ] ) ) {
20
-			$currency = $currencies[ $currency ];
21
-		} elseif ( isset( $currencies[ strtolower( $currency ) ] ) ) {
22
-			$currency = $currencies[ strtolower( $currency ) ];
19
+		if ( isset( $currencies[$currency] ) ) {
20
+			$currency = $currencies[$currency];
21
+		} elseif ( isset( $currencies[strtolower( $currency )] ) ) {
22
+			$currency = $currencies[strtolower( $currency )];
23 23
 		} else {
24 24
 			$currency = $currencies['USD'];
25 25
 		}
Please login to merge, or discard this patch.
classes/controllers/FrmAddonsController.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 		} else {
102 102
 			foreach ( $addons as $k => $addon ) {
103 103
 				if ( empty( $addon['excerpt'] ) && $k !== 'error' ) {
104
-					unset( $addons[ $k ] );
104
+					unset( $addons[$k] );
105 105
 				}
106 106
 			}
107 107
 		}
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
 
203 203
 		foreach ( $list as $k => $info ) {
204 204
 			$info['slug'] = $k;
205
-			$list[ $k ]   = array_merge( $defaults, $info );
205
+			$list[$k]   = array_merge( $defaults, $info );
206 206
 		}
207 207
 		return $list;
208 208
 	}
@@ -352,17 +352,17 @@  discard block
 block discarded – undo
352 352
 				continue;
353 353
 			}
354 354
 
355
-			$wp_plugin    = isset( $wp_plugins[ $folder ] ) ? $wp_plugins[ $folder ] : array();
355
+			$wp_plugin    = isset( $wp_plugins[$folder] ) ? $wp_plugins[$folder] : array();
356 356
 			$wp_version   = isset( $wp_plugin['Version'] ) ? $wp_plugin['Version'] : '1.0';
357 357
 			$plugin->slug = explode( '/', $folder )[0];
358 358
 
359 359
 			if ( version_compare( $wp_version, $plugin->new_version, '<' ) ) {
360
-				$transient->response[ $folder ] = $plugin;
360
+				$transient->response[$folder] = $plugin;
361 361
 			} else {
362
-				$transient->no_update[ $folder ] = $plugin;
362
+				$transient->no_update[$folder] = $plugin;
363 363
 			}
364 364
 
365
-			$transient->checked[ $folder ] = $wp_version;
365
+			$transient->checked[$folder] = $wp_version;
366 366
 
367 367
 		}
368 368
 
@@ -395,7 +395,7 @@  discard block
 block discarded – undo
395 395
 	 */
396 396
 	protected static function is_installed( $plugin ) {
397 397
 		$all_plugins = self::get_plugins();
398
-		return isset( $all_plugins[ $plugin ] );
398
+		return isset( $all_plugins[$plugin] );
399 399
 	}
400 400
 
401 401
 	/**
@@ -434,13 +434,13 @@  discard block
 block discarded – undo
434 434
 			}
435 435
 
436 436
 			$download_id = isset( $plugin['id'] ) ? $plugin['id'] : 0;
437
-			if ( ! empty( $download_id ) && ! isset( $version_info[ $download_id ]['package'] ) ) {
437
+			if ( ! empty( $download_id ) && ! isset( $version_info[$download_id]['package'] ) ) {
438 438
 				// if this addon is using its own license, get the update url
439 439
 				$addon_info = $api->get_api_info();
440 440
 
441
-				$version_info[ $download_id ] = $addon_info[ $download_id ];
441
+				$version_info[$download_id] = $addon_info[$download_id];
442 442
 				if ( isset( $addon_info['error'] ) ) {
443
-					$version_info[ $download_id ]['error'] = array(
443
+					$version_info[$download_id]['error'] = array(
444 444
 						'message' => $addon_info['error']['message'],
445 445
 						'code'    => $addon_info['error']['code'],
446 446
 					);
@@ -539,8 +539,8 @@  discard block
 block discarded – undo
539 539
 					return $addon;
540 540
 				}
541 541
 			}
542
-		} elseif ( isset( $addons[ $download_id ] ) ) {
543
-			$plugin = $addons[ $download_id ];
542
+		} elseif ( isset( $addons[$download_id] ) ) {
543
+			$plugin = $addons[$download_id];
544 544
 		}
545 545
 
546 546
 		return $plugin;
@@ -604,7 +604,7 @@  discard block
 block discarded – undo
604 604
 			self::prepare_addon_link( $addon['link'] );
605 605
 
606 606
 			self::set_addon_status( $addon );
607
-			$addons[ $id ] = $addon;
607
+			$addons[$id] = $addon;
608 608
 		}
609 609
 	}
610 610
 
@@ -645,7 +645,7 @@  discard block
 block discarded – undo
645 645
 			'utm_medium'   => 'addons',
646 646
 			'utm_campaign' => 'liteplugin',
647 647
 		);
648
-		$link       = add_query_arg( $query_args, $link );
648
+		$link = add_query_arg( $query_args, $link );
649 649
 	}
650 650
 
651 651
 	/**
@@ -1373,7 +1373,7 @@  discard block
 block discarded – undo
1373 1373
 		$addons = $api->get_api_info();
1374 1374
 
1375 1375
 		if ( is_array( $addons ) && array_key_exists( $addon_id, $addons ) ) {
1376
-			$dates    = $addons[ $addon_id ];
1376
+			$dates    = $addons[$addon_id];
1377 1377
 			$requires = FrmFormsHelper::get_plan_required( $dates );
1378 1378
 		}
1379 1379
 
Please login to merge, or discard this patch.
classes/controllers/FrmFormTemplatesController.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -315,10 +315,10 @@  discard block
 block discarded – undo
315 315
 
316 316
 		// Perform add or remove operation.
317 317
 		if ( 'add' === $operation ) {
318
-			self::$favorite_templates[ $key ][ $template_id ] = $template_id;
318
+			self::$favorite_templates[$key][$template_id] = $template_id;
319 319
 		} elseif ( 'remove' === $operation ) {
320
-			if ( isset( self::$favorite_templates[ $key ][ $template_id ] ) ) {
321
-				unset( self::$favorite_templates[ $key ][ $template_id ] );
320
+			if ( isset( self::$favorite_templates[$key][$template_id] ) ) {
321
+				unset( self::$favorite_templates[$key][$template_id] );
322 322
 			}
323 323
 		}
324 324
 
@@ -449,7 +449,7 @@  discard block
 block discarded – undo
449 449
 		foreach ( self::$templates as $key => &$template ) {
450 450
 			// Skip the template if the categories are not set.
451 451
 			if ( ! isset( $template['categories'] ) ) {
452
-				unset( self::$templates[ $key ] );
452
+				unset( self::$templates[$key] );
453 453
 				continue;
454 454
 			}
455 455
 
@@ -463,14 +463,14 @@  discard block
 block discarded – undo
463 463
 				// Add the slug to the new array.
464 464
 				$template['category_slugs'][] = $category_slug;
465 465
 
466
-				if ( ! isset( self::$categories[ $category_slug ] ) ) {
467
-					self::$categories[ $category_slug ] = array(
466
+				if ( ! isset( self::$categories[$category_slug] ) ) {
467
+					self::$categories[$category_slug] = array(
468 468
 						'name'  => $category,
469 469
 						'count' => 0,
470 470
 					);
471 471
 				}
472 472
 
473
-				self::$categories[ $category_slug ]['count']++;
473
+				self::$categories[$category_slug]['count'] ++;
474 474
 			}
475 475
 
476 476
 			// Mark the template as favorite if it's in the favorite templates list.
@@ -483,7 +483,7 @@  discard block
 block discarded – undo
483 483
 		$redundant_cats = array_merge( array( 'PayPal', 'Stripe', 'Twilio' ), FrmFormsHelper::ignore_template_categories() );
484 484
 		foreach ( $redundant_cats as $redundant_cat ) {
485 485
 			$category_slug = sanitize_title( $redundant_cat );
486
-			unset( self::$categories[ $category_slug ] );
486
+			unset( self::$categories[$category_slug] );
487 487
 		}
488 488
 
489 489
 		// Sort the categories by keys alphabetically.
@@ -533,9 +533,9 @@  discard block
 block discarded – undo
533 533
 	 */
534 534
 	private static function assign_featured_templates() {
535 535
 		foreach ( self::FEATURED_TEMPLATES_KEYS as $key ) {
536
-			if ( isset( self::$templates[ $key ] ) ) {
537
-				self::$templates[ $key ]['is_featured'] = true;
538
-				self::$featured_templates[] = self::$templates[ $key ];
536
+			if ( isset( self::$templates[$key] ) ) {
537
+				self::$templates[$key]['is_featured'] = true;
538
+				self::$featured_templates[] = self::$templates[$key];
539 539
 			}
540 540
 		}
541 541
 	}
Please login to merge, or discard this patch.