Completed
Pull Request — master (#1580)
by Stephanie
36s
created
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/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/helpers/FrmTipsHelper.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 			'page'  => '',
46 46
 			'class' => 'frm-mt-0',
47 47
 		);
48
-		$tip      = array_merge( $defaults, $tip );
48
+		$tip = array_merge( $defaults, $tip );
49 49
 
50 50
 		if ( isset( $tip['link'] ) && ! isset( $tip['link']['medium'] ) ) {
51 51
 			$tip['link']['medium'] = 'tip';
@@ -372,7 +372,7 @@  discard block
 block discarded – undo
372 372
 	 * @return array
373 373
 	 */
374 374
 	public static function get_banner_tip() {
375
-		$tips       = array(
375
+		$tips = array(
376 376
 			array(
377 377
 				'link' => array(
378 378
 					'medium'  => 'banner',
@@ -399,7 +399,7 @@  discard block
 block discarded – undo
399 399
 			),
400 400
 		);
401 401
 		$random     = rand( 0, count( $tips ) - 1 );
402
-		$tip        = $tips[ $random ];
402
+		$tip        = $tips[$random];
403 403
 		$tip['num'] = $random;
404 404
 
405 405
 		return $tip;
@@ -408,7 +408,7 @@  discard block
 block discarded – undo
408 408
 	public static function get_random_tip( $tips ) {
409 409
 		$random = rand( 0, count( $tips ) - 1 );
410 410
 
411
-		return $tips[ $random ];
411
+		return $tips[$random];
412 412
 	}
413 413
 
414 414
 	/**
Please login to merge, or discard this patch.
classes/views/dashboard/templates/counters.php 1 patch
Braces   +10 added lines, -4 removed lines patch added patch discarded remove patch
@@ -15,20 +15,26 @@
 block discarded – undo
15 15
 				<h4><?php echo esc_html( $counter['heading'] ); ?></h4>
16 16
 				<?php if ( isset( $counter['cta'] ) && isset( $counter['cta']['display'] ) && true === $counter['cta']['display'] ) : ?>
17 17
 					<a href="<?php echo esc_url( $counter['cta']['link'] ); ?>"><?php echo esc_attr( $counter['cta']['title'] ); ?></a>
18
-				<?php else : ?>
18
+				<?php else {
19
+	: ?>
19 20
 					<?php if ( 'currency' === $counter['type'] ) : ?>
20 21
 						<div class="frm-flex-box frm-gap-md">
21 22
 							<?php foreach ( $counter['items'] as $item ) : ?>
22 23
 								<b>
23
-									<?php echo esc_attr( $item['counter_label']['symbol_left'] ); ?>
24
+									<?php echo esc_attr( $item['counter_label']['symbol_left'] );
25
+}
26
+?>
24 27
 									<span class="frm-counter" data-type="<?php echo esc_attr( $counter['type'] ); ?>" data-locale="<?php echo esc_attr( get_locale() ); ?>" data-counter="<?php echo (int) $item['counter']; ?>"><?php echo (int) $item['counter']; ?></span>
25 28
 									<?php echo esc_attr( $item['counter_label']['symbol_right'] ); ?>
26 29
 								</b>
27 30
 							<?php endforeach; ?>
28 31
 						</div>
29
-					<?php else : ?>
32
+					<?php else {
33
+	: ?>
30 34
 						<b>
31
-							<span class="frm-counter" data-type="<?php echo esc_attr( $counter['type'] ); ?>" data-locale="<?php echo esc_attr( get_locale() ); ?>" data-counter="<?php echo (int) $counter['counter']; ?>"><?php echo (int) $counter['counter']; ?></span>
35
+							<span class="frm-counter" data-type="<?php echo esc_attr( $counter['type'] );
36
+}
37
+?>" data-locale="<?php echo esc_attr( get_locale() ); ?>" data-counter="<?php echo (int) $counter['counter']; ?>"><?php echo (int) $counter['counter']; ?></span>
32 38
 						</b>
33 39
 					<?php endif; ?>
34 40
 				<?php endif; ?>
Please login to merge, or discard this patch.
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 );
@@ -1498,7 +1498,7 @@  discard block
 block discarded – undo
1498 1498
 
1499 1499
 		foreach ( $item['categories'] as $k => $category ) {
1500 1500
 			if ( in_array( $category, $plans, true ) ) {
1501
-				unset( $item['categories'][ $k ] );
1501
+				unset( $item['categories'][$k] );
1502 1502
 
1503 1503
 				if ( in_array( $category, array( 'Creator', 'Personal' ), true ) ) {
1504 1504
 					// Show the current package name.
@@ -1700,9 +1700,9 @@  discard block
 block discarded – undo
1700 1700
 		}
1701 1701
 
1702 1702
 		foreach ( $shortcodes[0] as $key => $shortcode ) {
1703
-			$options = trim( $shortcodes[3][ $key ] );
1703
+			$options = trim( $shortcodes[3][$key] );
1704 1704
 
1705
-			if ( in_array( $shortcodes[1][ $key ], array( 'if ' ), true ) ) {
1705
+			if ( in_array( $shortcodes[1][$key], array( 'if ' ), true ) ) {
1706 1706
 				// Skip if shortcodes.
1707 1707
 				continue;
1708 1708
 			}
@@ -1712,7 +1712,7 @@  discard block
 block discarded – undo
1712 1712
 				continue;
1713 1713
 			}
1714 1714
 
1715
-			$new_shortcode = '[' . $shortcodes[2][ $key ];
1715
+			$new_shortcode = '[' . $shortcodes[2][$key];
1716 1716
 			if ( $options ) {
1717 1717
 				$new_shortcode .= ' ' . $options;
1718 1718
 			}
Please login to merge, or discard this patch.
stripe/models/FrmTransLitePayment.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -126,11 +126,11 @@
 block discarded – undo
126 126
 		foreach ( $payments as $payment ) {
127 127
 			list( $amount, $currency ) = FrmTransLiteAppHelper::get_amount_and_currency_from_payment( $payment );
128 128
 
129
-			if ( ! isset( $data[ $currency ] ) ) {
130
-				$data[ $currency ] = 0;
129
+			if ( ! isset( $data[$currency] ) ) {
130
+				$data[$currency] = 0;
131 131
 			}
132 132
 
133
-			$data[ $currency ] += floatval( $amount );
133
+			$data[$currency] += floatval( $amount );
134 134
 		}
135 135
 
136 136
 		return $data;
Please login to merge, or discard this patch.
classes/helpers/FrmEmailSummaryHelper.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -236,11 +236,11 @@  discard block
 block discarded – undo
236 236
 	 */
237 237
 	public static function get_last_sent_date( $type ) {
238 238
 		$options = self::get_options();
239
-		if ( empty( $options[ 'last_' . $type ] ) ) {
239
+		if ( empty( $options['last_' . $type] ) ) {
240 240
 			return false;
241 241
 		}
242 242
 
243
-		return $options[ 'last_' . $type ];
243
+		return $options['last_' . $type];
244 244
 	}
245 245
 
246 246
 	/**
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
 	public static function set_last_sent_date( $type, $value = null ) {
253 253
 		$options = self::get_options();
254 254
 
255
-		$options[ 'last_' . $type ] = null === $value ? self::get_date_from_today() : '';
255
+		$options['last_' . $type] = null === $value ? self::get_date_from_today() : '';
256 256
 		self::save_options( $options );
257 257
 	}
258 258
 
Please login to merge, or discard this patch.