Completed
Pull Request — master (#2651)
by
unknown
41s
created
stripe/controllers/FrmStrpLiteSettingsController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
 			 *
27 27
 			 * @return void
28 28
 			 */
29
-			function ( $frm_settings ) {
29
+			function( $frm_settings ) {
30 30
 				$stripe_settings = FrmStrpLiteAppHelper::get_settings()->settings;
31 31
 				require FrmStrpLiteAppHelper::plugin_path() . '/views/settings/messages.php';
32 32
 			}
Please login to merge, or discard this patch.
stripe/controllers/FrmTransLiteActionsController.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -500,8 +500,8 @@  discard block
 block discarded – undo
500 500
 			return $values;
501 501
 		}
502 502
 
503
-		if ( is_array( $previous_entry->metas ) && isset( $previous_entry->metas[ $field->id ] ) ) {
504
-			$values['value'] = $previous_entry->metas[ $field->id ];
503
+		if ( is_array( $previous_entry->metas ) && isset( $previous_entry->metas[$field->id] ) ) {
504
+			$values['value'] = $previous_entry->metas[$field->id];
505 505
 		}
506 506
 
507 507
 		$frm_vars['trans_filled'] = true;
@@ -538,7 +538,7 @@  discard block
 block discarded – undo
538 538
 			 *
539 539
 			 * @return void
540 540
 			 */
541
-			function () use ( $entry_id, &$destroy_callback ) {
541
+			function() use ( $entry_id, &$destroy_callback ) {
542 542
 				FrmEntry::destroy( $entry_id );
543 543
 				// Only call this once.
544 544
 				remove_action( 'frm_entry_form', $destroy_callback );
@@ -559,7 +559,7 @@  discard block
 block discarded – undo
559 559
 	 * @return array
560 560
 	 */
561 561
 	public static function before_save_settings( $settings, $action ) {
562
-		$settings['gateway']  = ! empty( $settings['gateway'] ) ? (array) $settings['gateway'] : array( 'stripe' );
562
+		$settings['gateway'] = ! empty( $settings['gateway'] ) ? (array) $settings['gateway'] : array( 'stripe' );
563 563
 
564 564
 		if ( in_array( 'square', $settings['gateway'] ) ) {
565 565
 			$currency = FrmSquareLiteConnectHelper::get_merchant_currency();
Please login to merge, or discard this patch.
classes/helpers/FrmStylesPreviewHelper.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 			 *
78 78
 			 * @return string
79 79
 			 */
80
-			function ( $position, $field ) {
80
+			function( $position, $field ) {
81 81
 				if ( is_array( $field ) ) {
82 82
 					$this->default_label_position_field_ids[] = (int) $field['id'];
83 83
 				}
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 			 *
96 96
 			 * @return string
97 97
 			 */
98
-			function ( $classes, $field ) {
98
+			function( $classes, $field ) {
99 99
 				if ( is_array( $field ) && in_array( (int) $field['id'], $this->default_label_position_field_ids, true ) ) {
100 100
 					$classes .= ' frm-default-label-position';
101 101
 				}
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
 			 *
124 124
 			 * @return bool
125 125
 			 */
126
-			function ( $show, $field_type ) {
126
+			function( $show, $field_type ) {
127 127
 				if ( 'captcha' === $field_type ) {
128 128
 					$show = false;
129 129
 				}
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
 			 *
153 153
 			 * @return stdClass|null
154 154
 			 */
155
-			function ( $form ) {
155
+			function( $form ) {
156 156
 				if ( is_object( $form ) && is_array( $form->options ) ) {
157 157
 					$form->options['js_validate'] = false;
158 158
 				}
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
 
203 203
 		$frm_settings = FrmAppHelper::get_settings();
204 204
 		if ( 'none' === $frm_settings->load_style ) {
205
-			$notes[] = function () {
205
+			$notes[] = function() {
206 206
 				printf(
207 207
 					// translators: %1$s: Anchor tag open, %2$s: Anchor tag close.
208 208
 					esc_html__( 'Formidable styles are disabled. This needs to be enabled in %1$sGlobal Settings%2$s.', 'formidable' ),
@@ -393,7 +393,7 @@  discard block
 block discarded – undo
393 393
 			return;
394 394
 		}
395 395
 
396
-		unset( $dependencies[ $index ] );
396
+		unset( $dependencies[$index] );
397 397
 		$dependencies = array_values( $dependencies );
398 398
 
399 399
 		$styles->registered['wp-admin']->deps = $dependencies;
Please login to merge, or discard this patch.
Formidable/Sniffs/WhiteSpace/BlankLineAfterClosingBraceSniff.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -75,14 +75,14 @@  discard block
 block discarded – undo
75 75
 			T_COALESCE_EQUAL,
76 76
 		);
77 77
 
78
-		if ( ! in_array( $tokens[ $nextToken ]['code'], $assignmentTokens, true ) ) {
78
+		if ( ! in_array( $tokens[$nextToken]['code'], $assignmentTokens, true ) ) {
79 79
 			return;
80 80
 		}
81 81
 
82 82
 		// Find the first token on the current line.
83 83
 		$firstOnLine = $stackPtr;
84
-		for ( $i = $stackPtr - 1; $i >= 0; $i-- ) {
85
-			if ( $tokens[ $i ]['line'] < $tokens[ $stackPtr ]['line'] ) {
84
+		for ( $i = $stackPtr - 1; $i >= 0; $i -- ) {
85
+			if ( $tokens[$i]['line'] < $tokens[$stackPtr]['line'] ) {
86 86
 				break;
87 87
 			}
88 88
 			$firstOnLine = $i;
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 		}
96 96
 
97 97
 		// Now find what's on the previous line.
98
-		$currentLine  = $tokens[ $stackPtr ]['line'];
98
+		$currentLine  = $tokens[$stackPtr]['line'];
99 99
 		$previousLine = $currentLine - 1;
100 100
 
101 101
 		if ( $previousLine < 1 ) {
@@ -104,11 +104,11 @@  discard block
 block discarded – undo
104 104
 
105 105
 		// Find the last non-whitespace token on the previous line.
106 106
 		$lastTokenOnPrevLine = null;
107
-		for ( $i = $stackPtr - 1; $i >= 0; $i-- ) {
108
-			if ( $tokens[ $i ]['line'] < $previousLine ) {
107
+		for ( $i = $stackPtr - 1; $i >= 0; $i -- ) {
108
+			if ( $tokens[$i]['line'] < $previousLine ) {
109 109
 				break;
110 110
 			}
111
-			if ( $tokens[ $i ]['line'] === $previousLine && $tokens[ $i ]['code'] !== T_WHITESPACE ) {
111
+			if ( $tokens[$i]['line'] === $previousLine && $tokens[$i]['code'] !== T_WHITESPACE ) {
112 112
 				$lastTokenOnPrevLine = $i;
113 113
 				break;
114 114
 			}
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 		}
122 122
 
123 123
 		// Check if the last token on the previous line is a closing brace.
124
-		if ( $tokens[ $lastTokenOnPrevLine ]['code'] !== T_CLOSE_CURLY_BRACKET ) {
124
+		if ( $tokens[$lastTokenOnPrevLine]['code'] !== T_CLOSE_CURLY_BRACKET ) {
125 125
 			return;
126 126
 		}
127 127
 
Please login to merge, or discard this patch.
classes/views/frm-settings/payments.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -25,8 +25,8 @@
 block discarded – undo
25 25
 		$input_params['checked'] = 'checked';
26 26
 	}
27 27
 
28
-	$other_section_selectors      = array_map(
29
-		function ( $section ) {
28
+	$other_section_selectors = array_map(
29
+		function( $section ) {
30 30
 			return "#frm_{$section}_settings_section";
31 31
 		},
32 32
 		array_diff( array_keys( $payment_sections ), array( $key ) )
Please login to merge, or discard this patch.
classes/models/fields/FrmFieldEmail.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@
 block discarded – undo
52 52
 
53 53
 		$errors = array();
54 54
 		if ( false !== strpos( $args['value'], '.@' ) || ! is_email( $args['value'] ) ) {
55
-			$errors[ 'field' . $args['id'] ] = FrmFieldsHelper::get_error_msg( $this->field, 'invalid' );
55
+			$errors['field' . $args['id']] = FrmFieldsHelper::get_error_msg( $this->field, 'invalid' );
56 56
 		}
57 57
 		return $errors;
58 58
 	}
Please login to merge, or discard this patch.
classes/models/FrmDb.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -355,8 +355,8 @@  discard block
 block discarded – undo
355 355
 
356 356
 		$where_is = strtolower( $where_is );
357 357
 
358
-		if ( isset( $switch_to[ $where_is ] ) ) {
359
-			return ' ' . $switch_to[ $where_is ];
358
+		if ( isset( $switch_to[$where_is] ) ) {
359
+			return ' ' . $switch_to[$where_is];
360 360
 		}
361 361
 
362 362
 		// > and < need a little more work since we don't want them switched to >= and <=
@@ -436,14 +436,14 @@  discard block
 block discarded – undo
436 436
 
437 437
 		foreach ( $temp_args as $k => $v ) {
438 438
 			if ( $v == '' ) {
439
-				unset( $args[ $k ] );
439
+				unset( $args[$k] );
440 440
 				continue;
441 441
 			}
442 442
 
443 443
 			$db_name = strtoupper( str_replace( '_', ' ', $k ) );
444 444
 
445 445
 			if ( strpos( $v, $db_name ) === false ) {
446
-				$args[ $k ] = $db_name . ' ' . $v;
446
+				$args[$k] = $db_name . ' ' . $v;
447 447
 			}
448 448
 		}
449 449
 
@@ -514,13 +514,13 @@  discard block
 block discarded – undo
514 514
 	private static function esc_query_args( &$args ) {
515 515
 		foreach ( $args as $param => $value ) {
516 516
 			if ( $param === 'order_by' ) {
517
-				$args[ $param ] = self::esc_order( $value );
517
+				$args[$param] = self::esc_order( $value );
518 518
 			} elseif ( $param === 'limit' ) {
519
-				$args[ $param ] = self::esc_limit( $value );
519
+				$args[$param] = self::esc_limit( $value );
520 520
 			}
521 521
 
522
-			if ( $args[ $param ] == '' ) {
523
-				unset( $args[ $param ] );
522
+			if ( $args[$param] == '' ) {
523
+				unset( $args[$param] );
524 524
 			}
525 525
 		}
526 526
 	}
@@ -617,7 +617,7 @@  discard block
 block discarded – undo
617 617
 
618 618
 		foreach ( $limit as $k => $l ) {
619 619
 			if ( is_numeric( $l ) ) {
620
-				$limit[ $k ] = $l;
620
+				$limit[$k] = $l;
621 621
 			}
622 622
 		}
623 623
 
@@ -795,7 +795,7 @@  discard block
 block discarded – undo
795 795
 	 */
796 796
 	public static function add_key_to_group_cache( $key, $group ) {
797 797
 		$cached         = self::get_group_cached_keys( $group );
798
-		$cached[ $key ] = $key;
798
+		$cached[$key] = $key;
799 799
 		wp_cache_set( 'cached_keys', $cached, $group, 300 );
800 800
 	}
801 801
 
Please login to merge, or discard this patch.
classes/models/FrmUsage.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
 		);
132 132
 
133 133
 		foreach ( $skipped_keys as $skipped_key ) {
134
-			unset( $data[ $skipped_key ] );
134
+			unset( $data[$skipped_key] );
135 135
 		}
136 136
 
137 137
 		return $data;
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
 
240 240
 		foreach ( $pass_settings as $setting ) {
241 241
 			if ( isset( $settings_list->$setting ) ) {
242
-				$settings[ $setting ] = $this->maybe_json( $settings_list->$setting );
242
+				$settings[$setting] = $this->maybe_json( $settings_list->$setting );
243 243
 			}
244 244
 		}
245 245
 
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
 		$message_settings = array();
278 278
 
279 279
 		foreach ( $messages as $message ) {
280
-			$message_settings[ 'changed-' . $message ] = $settings_list->$message === $default[ $message ] ? 0 : 1;
280
+			$message_settings['changed-' . $message] = $settings_list->$message === $default[$message] ? 0 : 1;
281 281
 		}
282 282
 
283 283
 		return $message_settings;
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
 
299 299
 		foreach ( $frm_roles as $frm_role => $frm_role_description ) {
300 300
 			if ( isset( $settings_list->$frm_role ) ) {
301
-				$permissions[ $frm_role ] = $settings_list->$frm_role;
301
+				$permissions[$frm_role] = $settings_list->$frm_role;
302 302
 			}
303 303
 		}
304 304
 
@@ -371,9 +371,9 @@  discard block
 block discarded – undo
371 371
 			);
372 372
 
373 373
 			foreach ( $settings as $setting ) {
374
-				if ( isset( $form->options[ $setting ] ) ) {
374
+				if ( isset( $form->options[$setting] ) ) {
375 375
 					if ( 'custom_style' === $setting ) {
376
-						$style->id = $form->options[ $setting ];
376
+						$style->id = $form->options[$setting];
377 377
 
378 378
 						if ( ! $style->id ) {
379 379
 							$style_name = 0;
@@ -384,9 +384,9 @@  discard block
 block discarded – undo
384 384
 							$style_name = $style_post ? $style_post->post_name : 'formidable-style';
385 385
 						}
386 386
 
387
-						$new_form[ $setting ] = $style_name;
387
+						$new_form[$setting] = $style_name;
388 388
 					} else {
389
-						$new_form[ $setting ] = $this->maybe_json( $form->options[ $setting ] );
389
+						$new_form[$setting] = $this->maybe_json( $form->options[$setting] );
390 390
 					}
391 391
 				}
392 392
 			}
@@ -454,7 +454,7 @@  discard block
 block discarded – undo
454 454
 
455 455
 		foreach ( $fields as $k => $field ) {
456 456
 			FrmAppHelper::unserialize_or_decode( $field->field_options );
457
-			$fields[ $k ]->field_options = json_encode( $field->field_options );
457
+			$fields[$k]->field_options = json_encode( $field->field_options );
458 458
 		}
459 459
 		return $fields;
460 460
 	}
Please login to merge, or discard this patch.
classes/models/FrmFormApi.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -143,13 +143,13 @@  discard block
 block discarded – undo
143 143
 				$cats = array_intersect( $this->skip_categories(), $addon['categories'] );
144 144
 
145 145
 				if ( ! empty( $cats ) ) {
146
-					unset( $addons[ $k ] );
146
+					unset( $addons[$k] );
147 147
 					continue;
148 148
 				}
149 149
 			}
150 150
 
151 151
 			if ( ! array_key_exists( 'is_new', $addon ) && array_key_exists( 'released', $addon ) ) {
152
-				$addons[ $k ]['is_new'] = $this->is_new( $addon );
152
+				$addons[$k]['is_new'] = $this->is_new( $addon );
153 153
 			}
154 154
 		}
155 155
 
@@ -266,8 +266,8 @@  discard block
 block discarded – undo
266 266
 					return $addon;
267 267
 				}
268 268
 			}
269
-		} elseif ( isset( $addons[ $download_id ] ) ) {
270
-			$plugin = $addons[ $download_id ];
269
+		} elseif ( isset( $addons[$download_id] ) ) {
270
+			$plugin = $addons[$download_id];
271 271
 		}
272 272
 
273 273
 		return $plugin;
Please login to merge, or discard this patch.