Completed
Pull Request — master (#2229)
by
unknown
54s
created
classes/models/FrmSalesApi.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 			return;
90 90
 		}
91 91
 
92
-		self::$sales[ $sale['key'] ] = $this->fill_sale( $sale );
92
+		self::$sales[$sale['key']] = $this->fill_sale( $sale );
93 93
 	}
94 94
 
95 95
 	/**
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 
188 188
 		$sale = self::$instance->get_best_sale();
189 189
 
190
-		return is_array( $sale ) && ! empty( $sale[ $key ] ) ? $sale[ $key ] : false;
190
+		return is_array( $sale ) && ! empty( $sale[$key] ) ? $sale[$key] : false;
191 191
 	}
192 192
 
193 193
 	/**
Please login to merge, or discard this patch.
stripe/controllers/FrmTransLiteHooksController.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 static function load_admin_hooks() {
37 37
 		add_action(
38 38
 			'admin_init',
39
-			function () {
39
+			function() {
40 40
 				self::fix_addon_hooks();
41 41
 			}
42 42
 		);
Please login to merge, or discard this patch.
classes/helpers/FrmApiHelper.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -127,7 +127,7 @@
 block discarded – undo
127 127
 	 * @return bool
128 128
 	 */
129 129
 	private static function check_free_segments( $who ) {
130
-		$segments          = array(
130
+		$segments = array(
131 131
 			'free_first_1',
132 132
 			'free_first_2_3',
133 133
 			'free_first_4_7',
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
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 
63 63
 		// Validate the number format.
64 64
 		if ( ! is_numeric( $args['value'] ) && '' !== $args['value'] ) {
65
-			$errors[ 'field' . $args['id'] ] = FrmFieldsHelper::get_error_msg( $this->field, 'invalid' );
65
+			$errors['field' . $args['id']] = FrmFieldsHelper::get_error_msg( $this->field, 'invalid' );
66 66
 		}
67 67
 
68 68
 		if ( $args['value'] === '' ) {
@@ -74,9 +74,9 @@  discard block
 block discarded – undo
74 74
 		$maxnum = FrmField::get_option( $this->field, 'maxnum' );
75 75
 
76 76
 		if ( $minnum !== '' && $value < $minnum ) {
77
-			$errors[ 'field' . $args['id'] ] = __( 'Please select a higher number', 'formidable' );
77
+			$errors['field' . $args['id']] = __( 'Please select a higher number', 'formidable' );
78 78
 		} elseif ( $maxnum !== '' && $value > $maxnum ) {
79
-			$errors[ 'field' . $args['id'] ] = __( 'Please select a lower number', 'formidable' );
79
+			$errors['field' . $args['id']] = __( 'Please select a lower number', 'formidable' );
80 80
 		}
81 81
 
82 82
 		$this->validate_step( $errors, $args );
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 	 * @return void
96 96
 	 */
97 97
 	protected function validate_step( &$errors, $args ) {
98
-		if ( isset( $errors[ 'field' . $args['id'] ] ) ) {
98
+		if ( isset( $errors['field' . $args['id']] ) ) {
99 99
 			// Don't need to check if value is invalid before.
100 100
 			return;
101 101
 		}
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 			return;
111 111
 		}
112 112
 
113
-		$errors[ 'field' . $args['id'] ] = sprintf(
113
+		$errors['field' . $args['id']] = sprintf(
114 114
 			// Translators: %1$s: the first nearest value; %2$s: the second nearest value.
115 115
 			__( 'Please enter a valid value. Two nearest valid values are %1$s and %2$s', 'formidable' ),
116 116
 			is_numeric( $result[0] ) ? floatval( $result[0] ) : $result[0],
Please login to merge, or discard this patch.
classes/helpers/FrmFormsListHelper.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 		$page     = $this->get_pagenum();
29 29
 		$per_page = $this->get_items_per_page( 'formidable_page_formidable_per_page' );
30 30
 
31
-		$mode    = self::get_param(
31
+		$mode = self::get_param(
32 32
 			array(
33 33
 				'param'   => 'mode',
34 34
 				'default' => 'list',
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 				'default' => 'name',
41 41
 			)
42 42
 		);
43
-		$order   = self::get_param(
43
+		$order = self::get_param(
44 44
 			array(
45 45
 				'param'   => 'order',
46 46
 				'default' => 'ASC',
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 
50 50
 		FrmAppController::apply_saved_sort_preference( $orderby, $order );
51 51
 
52
-		$start   = self::get_param(
52
+		$start = self::get_param(
53 53
 			array(
54 54
 				'param'   => 'start',
55 55
 				'default' => ( $page - 1 ) * $per_page,
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
 		$counts    = FrmForm::get_count();
182 182
 		$form_type = FrmAppHelper::simple_get( 'form_type', 'sanitize_title', 'published' );
183 183
 
184
-		if ( isset( $statuses[ $form_type ] ) ) {
184
+		if ( isset( $statuses[$form_type] ) ) {
185 185
 			$counts->$form_type = $this->total_items;
186 186
 		}
187 187
 
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
 
203 203
 			if ( $counts->{$status} || 'draft' !== $status ) {
204 204
 				/* translators: %1$s: Status, %2$s: Number of items */
205
-				$links[ $status ] = '<a href="' . esc_url( '?page=formidable&form_type=' . $status ) . '" ' . $class . '>' . sprintf( __( '%1$s <span class="count">(%2$s)</span>', 'formidable' ), $name, number_format_i18n( $counts->{$status} ) ) . '</a>';
205
+				$links[$status] = '<a href="' . esc_url( '?page=formidable&form_type=' . $status ) . '" ' . $class . '>' . sprintf( __( '%1$s <span class="count">(%2$s)</span>', 'formidable' ), $name, number_format_i18n( $counts->{$status} ) ) . '</a>';
206 206
 			}
207 207
 
208 208
 			unset( $status, $name );
@@ -404,7 +404,7 @@  discard block
 block discarded – undo
404 404
 	private function get_actions( &$actions, $item, $edit_link ) {
405 405
 		$new_actions = FrmFormsHelper::get_action_links( $item->id, $item );
406 406
 		foreach ( $new_actions as $link => $action ) {
407
-			$new_actions[ $link ] = FrmFormsHelper::format_link_html( $action, 'short' );
407
+			$new_actions[$link] = FrmFormsHelper::format_link_html( $action, 'short' );
408 408
 		}
409 409
 
410 410
 		if ( 'trash' === $this->status ) {
Please login to merge, or discard this patch.
classes/helpers/FrmFieldGdprHelper.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@
 block discarded – undo
53 53
 	 * @return array
54 54
 	 */
55 55
 	public static function add_gdpr_field( $fields ) {
56
-		$fields[ self::FIELD_TYPE ] = array(
56
+		$fields[self::FIELD_TYPE] = array(
57 57
 			'name' => __( 'GDPR', 'formidable' ),
58 58
 			'icon' => 'frm_icon_font frm-gdpr-icon',
59 59
 		);
Please login to merge, or discard this patch.
classes/controllers/FrmAppController.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1356,15 +1356,15 @@  discard block
 block discarded – undo
1356 1356
 		global $wp_filter;
1357 1357
 
1358 1358
 		foreach ( $actions as $action ) {
1359
-			if ( empty( $wp_filter[ $action ]->callbacks ) ) {
1359
+			if ( empty( $wp_filter[$action]->callbacks ) ) {
1360 1360
 				continue;
1361 1361
 			}
1362
-			foreach ( $wp_filter[ $action ]->callbacks as $priority => $callbacks ) {
1362
+			foreach ( $wp_filter[$action]->callbacks as $priority => $callbacks ) {
1363 1363
 				foreach ( $callbacks as $callback_name => $callback ) {
1364 1364
 					if ( self::is_our_callback_string( $callback_name ) || self::is_our_callback_array( $callback ) ) {
1365 1365
 						continue;
1366 1366
 					}
1367
-					unset( $wp_filter[ $action ]->callbacks[ $priority ][ $callback_name ] );
1367
+					unset( $wp_filter[$action]->callbacks[$priority][$callback_name] );
1368 1368
 				}
1369 1369
 			}
1370 1370
 		}
@@ -1376,7 +1376,7 @@  discard block
 block discarded – undo
1376 1376
 	 * @return void
1377 1377
 	 */
1378 1378
 	private static function remember_custom_sort() {
1379
-		$screen  = get_current_screen();
1379
+		$screen = get_current_screen();
1380 1380
 		if ( ! $screen ) {
1381 1381
 			return;
1382 1382
 		}
Please login to merge, or discard this patch.
classes/factories/FrmFieldFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -112,7 +112,7 @@
 block discarded – undo
112 112
 			FrmFieldGdprHelper::FIELD_TYPE => FrmFieldGdprHelper::get_gdpr_field_class( $field_type ),
113 113
 		);
114 114
 
115
-		$class = isset( $type_classes[ $field_type ] ) ? $type_classes[ $field_type ] : '';
115
+		$class = isset( $type_classes[$field_type] ) ? $type_classes[$field_type] : '';
116 116
 
117 117
 		return apply_filters( 'frm_get_field_type_class', $class, $field_type );
118 118
 	}
Please login to merge, or discard this patch.
classes/models/FrmField.php 1 patch
Spacing   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -309,8 +309,8 @@  discard block
 block discarded – undo
309 309
 			require_once ABSPATH . 'wp-admin/includes/plugin.php';
310 310
 		}
311 311
 		$plugins = get_plugins();
312
-		if ( isset( $plugins[ $plugin ] ) && ! empty( $plugins[ $plugin ]['Version'] ) ) {
313
-			return $plugins[ $plugin ]['Version'];
312
+		if ( isset( $plugins[$plugin] ) && ! empty( $plugins[$plugin]['Version'] ) ) {
313
+			return $plugins[$plugin]['Version'];
314 314
 		}
315 315
 		return false;
316 316
 	}
@@ -383,8 +383,8 @@  discard block
 block discarded – undo
383 383
 		$values = FrmAppHelper::maybe_filter_array( $values, array( 'name', 'description' ) );
384 384
 
385 385
 		foreach ( array( 'name', 'description', 'type', 'default_value' ) as $col ) {
386
-			if ( isset( $values[ $col ] ) ) {
387
-				$new_values[ $col ] = $values[ $col ];
386
+			if ( isset( $values[$col] ) ) {
387
+				$new_values[$col] = $values[$col];
388 388
 			}
389 389
 		}
390 390
 
@@ -396,7 +396,7 @@  discard block
 block discarded – undo
396 396
 		$new_values['created_at']    = current_time( 'mysql', 1 );
397 397
 
398 398
 		if ( isset( $values['id'] ) ) {
399
-			$frm_duplicate_ids[ $values['field_key'] ] = $new_values['field_key'];
399
+			$frm_duplicate_ids[$values['field_key']] = $new_values['field_key'];
400 400
 			$new_values                                = apply_filters( 'frm_duplicated_field', $new_values );
401 401
 		}
402 402
 
@@ -405,9 +405,9 @@  discard block
 block discarded – undo
405 405
 		foreach ( $new_values as $k => $v ) {
406 406
 			if ( is_array( $v ) ) {
407 407
 				if ( $k === 'default_value' ) {
408
-					$new_values[ $k ] = FrmAppHelper::maybe_json_encode( $v );
408
+					$new_values[$k] = FrmAppHelper::maybe_json_encode( $v );
409 409
 				} else {
410
-					$new_values[ $k ] = serialize( $v );
410
+					$new_values[$k] = serialize( $v );
411 411
 				}
412 412
 			}
413 413
 			unset( $k, $v );
@@ -427,7 +427,7 @@  discard block
 block discarded – undo
427 427
 		}
428 428
 
429 429
 		if ( isset( $values['id'] ) ) {
430
-			$frm_duplicate_ids[ $values['id'] ] = $new_id;
430
+			$frm_duplicate_ids[$values['id']] = $new_id;
431 431
 		}
432 432
 
433 433
 		return $new_id;
@@ -478,7 +478,7 @@  discard block
 block discarded – undo
478 478
 			 * @param array $match Shortcode data.
479 479
 			 * @return string
480 480
 			 */
481
-			function ( $match ) {
481
+			function( $match ) {
482 482
 				$attr = shortcode_parse_atts( $match[3] );
483 483
 
484 484
 				if ( ! is_array( $attr ) ) {
@@ -503,7 +503,7 @@  discard block
 block discarded – undo
503 503
 					}
504 504
 
505 505
 					if ( FrmAppHelper::input_key_is_safe( $key, 'update' ) ) {
506
-						$safe_atts[ $key ] = $value;
506
+						$safe_atts[$key] = $value;
507 507
 					}
508 508
 				}
509 509
 
@@ -561,7 +561,7 @@  discard block
 block discarded – undo
561 561
 	public static function duplicate( $old_form_id, $form_id, $copy_keys = false, $blog_id = false ) {
562 562
 		global $frm_duplicate_ids;
563 563
 
564
-		$where  = array(
564
+		$where = array(
565 565
 			array(
566 566
 				'or'                => 1,
567 567
 				'fi.form_id'        => $old_form_id,
@@ -607,8 +607,8 @@  discard block
 block discarded – undo
607 607
 
608 608
 			$values                                 = apply_filters( 'frm_duplicated_field', $values );
609 609
 			$new_id                                 = self::create( $values );
610
-			$frm_duplicate_ids[ $field->id ]        = $new_id;
611
-			$frm_duplicate_ids[ $field->field_key ] = $new_id;
610
+			$frm_duplicate_ids[$field->id]        = $new_id;
611
+			$frm_duplicate_ids[$field->field_key] = $new_id;
612 612
 			unset( $field );
613 613
 		}//end foreach
614 614
 	}
@@ -657,11 +657,11 @@  discard block
 block discarded – undo
657 657
 
658 658
 		// serialize array values
659 659
 		foreach ( array( 'field_options', 'options' ) as $opt ) {
660
-			if ( isset( $values[ $opt ] ) && is_array( $values[ $opt ] ) ) {
660
+			if ( isset( $values[$opt] ) && is_array( $values[$opt] ) ) {
661 661
 				if ( 'field_options' === $opt ) {
662
-					$values[ $opt ] = self::maybe_filter_options( $values[ $opt ] );
662
+					$values[$opt] = self::maybe_filter_options( $values[$opt] );
663 663
 				}
664
-				$values[ $opt ] = serialize( $values[ $opt ] );
664
+				$values[$opt] = serialize( $values[$opt] );
665 665
 			}
666 666
 		}
667 667
 		if ( isset( $values['default_value'] ) && is_array( $values['default_value'] ) ) {
@@ -848,8 +848,8 @@  discard block
 block discarded – undo
848 848
 					continue;
849 849
 				}
850 850
 
851
-				$fields[ $result->id ] = $result;
852
-				++$count;
851
+				$fields[$result->id] = $result;
852
+				++ $count;
853 853
 				if ( $limit == 1 ) {
854 854
 					$fields = $result;
855 855
 					break;
@@ -900,8 +900,8 @@  discard block
 block discarded – undo
900 900
 			$fields = array();
901 901
 			$count  = 0;
902 902
 			foreach ( $results as $result ) {
903
-				++$count;
904
-				$fields[ $result->id ] = $result;
903
+				++ $count;
904
+				$fields[$result->id] = $result;
905 905
 				if ( ! empty( $limit ) && $count >= $limit ) {
906 906
 					break;
907 907
 				}
@@ -1015,7 +1015,7 @@  discard block
 block discarded – undo
1015 1015
 		$query_type = $limit === ' LIMIT 1' || $limit == 1 ? 'row' : 'results';
1016 1016
 
1017 1017
 		if ( is_array( $where ) ) {
1018
-			$args    = array(
1018
+			$args = array(
1019 1019
 				'order_by' => $order_by,
1020 1020
 				'limit'    => $limit,
1021 1021
 			);
@@ -1048,9 +1048,9 @@  discard block
 block discarded – undo
1048 1048
 				FrmDb::set_cache( $result->field_key, $result, 'frm_field' );
1049 1049
 
1050 1050
 				self::prepare_options( $result );
1051
-				$results[ $r_key ]->field_options = $result->field_options;
1052
-				$results[ $r_key ]->options       = $result->options;
1053
-				$results[ $r_key ]->default_value = $result->default_value;
1051
+				$results[$r_key]->field_options = $result->field_options;
1052
+				$results[$r_key]->options       = $result->options;
1053
+				$results[$r_key]->default_value = $result->default_value;
1054 1054
 
1055 1055
 				unset( $r_key, $result );
1056 1056
 			}
@@ -1129,7 +1129,7 @@  discard block
 block discarded – undo
1129 1129
 
1130 1130
 			if ( count( $next_fields ) >= self::$transient_size ) {
1131 1131
 				// if this transient is full, check for another
1132
-				++$next;
1132
+				++ $next;
1133 1133
 				self::get_next_transient( $fields, $base_name, $next );
1134 1134
 			}
1135 1135
 		}
@@ -1157,7 +1157,7 @@  discard block
 block discarded – undo
1157 1157
 				return;
1158 1158
 			}
1159 1159
 
1160
-			++$next;
1160
+			++ $next;
1161 1161
 		}
1162 1162
 	}
1163 1163
 
@@ -1305,7 +1305,7 @@  discard block
 block discarded – undo
1305 1305
 	 * @return bool
1306 1306
 	 */
1307 1307
 	public static function is_option_true_in_array( $field, $option ) {
1308
-		return ! empty( $field[ $option ] );
1308
+		return ! empty( $field[$option] );
1309 1309
 	}
1310 1310
 
1311 1311
 	/**
@@ -1314,7 +1314,7 @@  discard block
 block discarded – undo
1314 1314
 	 * @return bool
1315 1315
 	 */
1316 1316
 	public static function is_option_true_in_object( $field, $option ) {
1317
-		return isset( $field->field_options[ $option ] ) && $field->field_options[ $option ];
1317
+		return isset( $field->field_options[$option] ) && $field->field_options[$option];
1318 1318
 	}
1319 1319
 
1320 1320
 	/**
@@ -1323,7 +1323,7 @@  discard block
 block discarded – undo
1323 1323
 	 * @return bool
1324 1324
 	 */
1325 1325
 	public static function is_option_empty_in_array( $field, $option ) {
1326
-		return empty( $field[ $option ] );
1326
+		return empty( $field[$option] );
1327 1327
 	}
1328 1328
 
1329 1329
 	/**
@@ -1332,7 +1332,7 @@  discard block
 block discarded – undo
1332 1332
 	 * @return bool
1333 1333
 	 */
1334 1334
 	public static function is_option_empty_in_object( $field, $option ) {
1335
-		return empty( $field->field_options[ $option ] );
1335
+		return empty( $field->field_options[$option] );
1336 1336
 	}
1337 1337
 
1338 1338
 	/**
@@ -1341,7 +1341,7 @@  discard block
 block discarded – undo
1341 1341
 	 * @return bool
1342 1342
 	 */
1343 1343
 	public static function is_option_value_in_object( $field, $option ) {
1344
-		return isset( $field->field_options[ $option ] ) && $field->field_options[ $option ] != '';
1344
+		return isset( $field->field_options[$option] ) && $field->field_options[$option] != '';
1345 1345
 	}
1346 1346
 
1347 1347
 	/**
@@ -1367,10 +1367,10 @@  discard block
 block discarded – undo
1367 1367
 	 * @return mixed
1368 1368
 	 */
1369 1369
 	public static function get_option_in_array( $field, $option ) {
1370
-		if ( isset( $field[ $option ] ) ) {
1371
-			$this_option = $field[ $option ];
1372
-		} elseif ( isset( $field['field_options'] ) && is_array( $field['field_options'] ) && isset( $field['field_options'][ $option ] ) ) {
1373
-			$this_option = $field['field_options'][ $option ];
1370
+		if ( isset( $field[$option] ) ) {
1371
+			$this_option = $field[$option];
1372
+		} elseif ( isset( $field['field_options'] ) && is_array( $field['field_options'] ) && isset( $field['field_options'][$option] ) ) {
1373
+			$this_option = $field['field_options'][$option];
1374 1374
 		} else {
1375 1375
 			$this_option = '';
1376 1376
 		}
@@ -1384,7 +1384,7 @@  discard block
 block discarded – undo
1384 1384
 	 * @return mixed
1385 1385
 	 */
1386 1386
 	public static function get_option_in_object( $field, $option ) {
1387
-		return isset( $field->field_options[ $option ] ) ? $field->field_options[ $option ] : '';
1387
+		return isset( $field->field_options[$option] ) ? $field->field_options[$option] : '';
1388 1388
 	}
1389 1389
 
1390 1390
 	/**
Please login to merge, or discard this patch.