Completed
Pull Request — master (#2513)
by
unknown
47s
created
classes/models/FrmEntryFormatter.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -169,8 +169,8 @@  discard block
 block discarded – undo
169 169
 
170 170
 		$conditionally_add = array( 'include_fields', 'fields', 'exclude_fields', 'entry' );
171 171
 		foreach ( $conditionally_add as $index ) {
172
-			if ( isset( $atts[ $index ] ) ) {
173
-				$entry_atts[ $index ] = $atts[ $index ];
172
+			if ( isset( $atts[$index] ) ) {
173
+				$entry_atts[$index] = $atts[$index];
174 174
 			}
175 175
 		}
176 176
 
@@ -376,8 +376,8 @@  discard block
 block discarded – undo
376 376
 
377 377
 		$unset = array( 'id', 'form_id', 'format' );
378 378
 		foreach ( $unset as $param ) {
379
-			if ( isset( $atts[ $param ] ) ) {
380
-				unset( $atts[ $param ] );
379
+			if ( isset( $atts[$param] ) ) {
380
+				unset( $atts[$param] );
381 381
 			}
382 382
 		}
383 383
 
@@ -553,11 +553,11 @@  discard block
 block discarded – undo
553 553
 
554 554
 			$displayed_value = $this->prepare_display_value_for_array( $field_value->get_displayed_value() );
555 555
 
556
-			$output[ $this->get_key_or_id( $field_value ) ] = $displayed_value;
556
+			$output[$this->get_key_or_id( $field_value )] = $displayed_value;
557 557
 
558 558
 			$has_separate_value = (bool) $field_value->get_field_option( 'separate_value' );
559 559
 			if ( $has_separate_value || $displayed_value !== $field_value->get_saved_value() ) {
560
-				$output[ $this->get_key_or_id( $field_value ) . '-value' ] = $field_value->get_saved_value();
560
+				$output[$this->get_key_or_id( $field_value ) . '-value'] = $field_value->get_saved_value();
561 561
 			}
562 562
 		}
563 563
 	}
@@ -975,7 +975,7 @@  discard block
 block discarded – undo
975 975
 		if ( $this->is_plain_text ) {
976 976
 			if ( is_array( $value ) ) {
977 977
 				foreach ( $value as $key => $single_value ) {
978
-					$value[ $key ] = $this->strip_html( $single_value );
978
+					$value[$key] = $this->strip_html( $single_value );
979 979
 				}
980 980
 			} elseif ( $this->is_plain_text && ! is_array( $value ) ) {
981 981
 				if ( strpos( $value, '<img' ) !== false ) {
Please login to merge, or discard this patch.
classes/helpers/FrmTipsHelper.php 1 patch
Spacing   +2 added lines, -2 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';
@@ -402,7 +402,7 @@  discard block
 block discarded – undo
402 402
 		}
403 403
 
404 404
 		$random = random_int( 0, $count - 1 );
405
-		return $tips[ $random ];
405
+		return $tips[$random];
406 406
 	}
407 407
 
408 408
 	/**
Please login to merge, or discard this patch.
stripe/controllers/FrmStrpLiteAppController.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -152,13 +152,13 @@  discard block
 block discarded – undo
152 152
 
153 153
 		$is_setup_intent = 0 === strpos( $intent->id, 'seti_' );
154 154
 		if ( $is_setup_intent ) {
155
-			$errors[ 'field' . $cc_field_id ] = is_object( $intent->last_setup_error ) ? $intent->last_setup_error->message : '';
155
+			$errors['field' . $cc_field_id] = is_object( $intent->last_setup_error ) ? $intent->last_setup_error->message : '';
156 156
 		} else {
157
-			$errors[ 'field' . $cc_field_id ] = is_object( $intent->last_payment_error ) ? $intent->last_payment_error->message : '';
157
+			$errors['field' . $cc_field_id] = is_object( $intent->last_payment_error ) ? $intent->last_payment_error->message : '';
158 158
 		}
159 159
 
160
-		if ( ! $errors[ 'field' . $cc_field_id ] ) {
161
-			$errors[ 'field' . $cc_field_id ] = 'Payment was not successfully processed.';
160
+		if ( ! $errors['field' . $cc_field_id] ) {
161
+			$errors['field' . $cc_field_id] = 'Payment was not successfully processed.';
162 162
 		}
163 163
 
164 164
 		global $frm_vars;
@@ -187,10 +187,10 @@  discard block
 block discarded – undo
187 187
 		$save_draft = ! empty( $form->options['save_draft'] );
188 188
 
189 189
 		global $frm_vars;
190
-		$frm_vars['created_entries'][ $form_id ]['errors'] = $errors;
190
+		$frm_vars['created_entries'][$form_id]['errors'] = $errors;
191 191
 
192 192
 		// Set to true to get FrmProFieldsHelper::get_page_with_error() run.
193
-		$_POST[ 'frm_page_order_' . $form_id ] = true;
193
+		$_POST['frm_page_order_' . $form_id] = true;
194 194
 
195 195
 		if ( ! $save_draft ) {
196 196
 			// If draft saving is not on, delete the entry.
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
 		}
200 200
 
201 201
 		// If draft saving is on, load the draft entry.
202
-		$frm_vars['created_entries'][ $form_id ]['entry_id'] = $entry_id;
202
+		$frm_vars['created_entries'][$form_id]['entry_id'] = $entry_id;
203 203
 		add_action(
204 204
 			'frm_filter_final_form',
205 205
 			/**
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
 			 *
211 211
 			 * @return string
212 212
 			 */
213
-			function ( $html ) use ( $entry_id ) {
213
+			function( $html ) use ( $entry_id ) {
214 214
 				global $wpdb;
215 215
 				$wpdb->update( $wpdb->prefix . 'frm_items', array( 'is_draft' => 1 ), array( 'id' => $entry_id ) );
216 216
 				return $html;
Please login to merge, or discard this patch.
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.
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.