Completed
Pull Request — master (#1580)
by Stephanie
47s
created
classes/models/fields/FrmFieldCaptcha.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -255,8 +255,8 @@  discard block
 block discarded – undo
255 255
 
256 256
 		if ( is_wp_error( $resp ) ) {
257 257
 			$error_string                     = $resp->get_error_message();
258
-			$errors[ 'field' . $args['id'] ]  = __( 'There was a problem verifying your captcha', 'formidable' );
259
-			$errors[ 'field' . $args['id'] ] .= ' ' . $error_string;
258
+			$errors['field' . $args['id']]  = __( 'There was a problem verifying your captcha', 'formidable' );
259
+			$errors['field' . $args['id']] .= ' ' . $error_string;
260 260
 			return $errors;
261 261
 		}
262 262
 
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
 			if ( $invalid_message === __( 'The reCAPTCHA was not entered correctly', 'formidable' ) ) {
284 284
 				$invalid_message = '';
285 285
 			}
286
-			$errors[ 'field' . $args['id'] ] = ( $invalid_message === '' ? $frm_settings->re_msg : $invalid_message );
286
+			$errors['field' . $args['id']] = ( $invalid_message === '' ? $frm_settings->re_msg : $invalid_message );
287 287
 		}
288 288
 
289 289
 		return $errors;
@@ -299,8 +299,8 @@  discard block
 block discarded – undo
299 299
 			$frm_vars['captcha_scores'] = array();
300 300
 		}
301 301
 		$form_id = is_object( $this->field ) ? $this->field->form_id : $this->field['form_id'];
302
-		if ( ! isset( $frm_vars['captcha_scores'][ $form_id ] ) ) {
303
-			$frm_vars['captcha_scores'][ $form_id ] = $score;
302
+		if ( ! isset( $frm_vars['captcha_scores'][$form_id] ) ) {
303
+			$frm_vars['captcha_scores'][$form_id] = $score;
304 304
 		}
305 305
 	}
306 306
 
@@ -329,7 +329,7 @@  discard block
 block discarded – undo
329 329
 	protected static function post_data_includes_token() {
330 330
 		$settings = FrmCaptchaFactory::get_settings_object();
331 331
 		// phpcs:ignore WordPress.Security.NonceVerification.Missing
332
-		return ! empty( $_POST[ $settings->token_field ] );
332
+		return ! empty( $_POST[$settings->token_field] );
333 333
 	}
334 334
 
335 335
 	/**
Please login to merge, or discard this patch.
stubs.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -216,16 +216,16 @@
 block discarded – undo
216 216
 namespace WPMailSMTP {
217 217
 	class Options {
218 218
 	   /**
219
-		* @return Options
220
-		*/
219
+	    * @return Options
220
+	    */
221 221
 	   public static function init() {
222 222
 	   }
223 223
 	   /**
224
-		 * @param string $group
225
-		 * @param string $key
226
-		 * @param bool   $strip_slashes
227
-		 * @return mixed|null
228
-		 */
224
+	    * @param string $group
225
+	    * @param string $key
226
+	    * @param bool   $strip_slashes
227
+	    * @return mixed|null
228
+	    */
229 229
 		public function get( $group, $key, $strip_slashes = true ) {
230 230
 		}
231 231
 	}
Please login to merge, or discard this patch.
classes/controllers/FrmDashboardController.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -478,7 +478,7 @@  discard block
 block discarded – undo
478 478
 		foreach ( $data as $key => $messages ) {
479 479
 			if ( in_array( $key, array( 'unread', 'dismissed' ), true ) ) {
480 480
 				foreach ( $messages as $key_msg => $message ) {
481
-					$data[ $key ][ $key_msg ]['cta'] = self::inbox_clean_messages_cta( $message['cta'] );
481
+					$data[$key][$key_msg]['cta'] = self::inbox_clean_messages_cta( $message['cta'] );
482 482
 				}
483 483
 			}
484 484
 		}
@@ -557,11 +557,11 @@  discard block
 block discarded – undo
557 557
 	 */
558 558
 	private static function get_dashboard_options( $option_name = null ) {
559 559
 		$options = get_option( self::OPTION_META_NAME, array() );
560
-		if ( null !== $option_name && ! isset( $options[ $option_name ] ) ) {
560
+		if ( null !== $option_name && ! isset( $options[$option_name] ) ) {
561 561
 			return array();
562 562
 		}
563 563
 		if ( null !== $option_name ) {
564
-			return $options[ $option_name ];
564
+			return $options[$option_name];
565 565
 		}
566 566
 		return $options;
567 567
 	}
@@ -576,7 +576,7 @@  discard block
 block discarded – undo
576 576
 	 */
577 577
 	private static function update_dashboard_options( $data, $option_name ) {
578 578
 		$options                 = self::get_dashboard_options();
579
-		$options[ $option_name ] = $data;
579
+		$options[$option_name] = $data;
580 580
 		update_option( self::OPTION_META_NAME, $options, 'no' );
581 581
 	}
582 582
 
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
@@ -111,7 +111,7 @@
 block discarded – undo
111 111
 			FrmSubmitHelper::FIELD_TYPE => 'FrmFieldSubmit',
112 112
 		);
113 113
 
114
-		$class = isset( $type_classes[ $field_type ] ) ? $type_classes[ $field_type ] : '';
114
+		$class = isset( $type_classes[$field_type] ) ? $type_classes[$field_type] : '';
115 115
 
116 116
 		return apply_filters( 'frm_get_field_type_class', $class, $field_type );
117 117
 	}
Please login to merge, or discard this patch.
classes/models/FrmInbox.php 1 patch
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
 			return;
106 106
 		}
107 107
 
108
-		if ( isset( self::$messages[ $message['key'] ] ) && ! isset( $message['force'] ) ) {
108
+		if ( isset( self::$messages[$message['key']] ) && ! isset( $message['force'] ) ) {
109 109
 			// Don't replace messages unless required.
110 110
 			return;
111 111
 		}
@@ -114,13 +114,13 @@  discard block
 block discarded – undo
114 114
 			return;
115 115
 		}
116 116
 
117
-		if ( isset( self::$messages[ $message['key'] ] ) ) {
117
+		if ( isset( self::$messages[$message['key']] ) ) {
118 118
 			// Move up and mark as new.
119
-			unset( self::$messages[ $message['key'] ] );
119
+			unset( self::$messages[$message['key']] );
120 120
 		}
121 121
 
122 122
 		$this->fill_message( $message );
123
-		self::$messages[ $message['key'] ] = $message;
123
+		self::$messages[$message['key']] = $message;
124 124
 
125 125
 		$this->update_list();
126 126
 
@@ -157,11 +157,11 @@  discard block
 block discarded – undo
157 157
 	private function clean_messages() {
158 158
 		$removed = false;
159 159
 		foreach ( self::$messages as $t => $message ) {
160
-			$read      = ! empty( $message['read'] ) && isset( $message['read'][ get_current_user_id() ] ) && $message['read'][ get_current_user_id() ] < strtotime( '-1 month' );
161
-			$dismissed = ! empty( $message['dismissed'] ) && isset( $message['dismissed'][ get_current_user_id() ] ) && $message['dismissed'][ get_current_user_id() ] < strtotime( '-1 week' );
160
+			$read      = ! empty( $message['read'] ) && isset( $message['read'][get_current_user_id()] ) && $message['read'][get_current_user_id()] < strtotime( '-1 month' );
161
+			$dismissed = ! empty( $message['dismissed'] ) && isset( $message['dismissed'][get_current_user_id()] ) && $message['dismissed'][get_current_user_id()] < strtotime( '-1 week' );
162 162
 			$expired   = $this->is_expired( $message );
163 163
 			if ( $read || $expired || $dismissed ) {
164
-				unset( self::$messages[ $t ] );
164
+				unset( self::$messages[$t] );
165 165
 				$removed = true;
166 166
 			}
167 167
 		}
@@ -179,11 +179,11 @@  discard block
 block discarded – undo
179 179
 	public function filter_messages( &$messages, $type = 'unread' ) {
180 180
 		$user_id = get_current_user_id();
181 181
 		foreach ( $messages as $k => $message ) {
182
-			$dismissed = isset( $message['dismissed'] ) && isset( $message['dismissed'][ $user_id ] );
182
+			$dismissed = isset( $message['dismissed'] ) && isset( $message['dismissed'][$user_id] );
183 183
 			if ( empty( $k ) || $this->is_expired( $message ) || ( $type === 'dismissed' ) !== $dismissed ) {
184
-				unset( $messages[ $k ] );
184
+				unset( $messages[$k] );
185 185
 			} elseif ( ! $this->is_for_user( $message ) ) {
186
-				unset( $messages[ $k ] );
186
+				unset( $messages[$k] );
187 187
 			}
188 188
 		}
189 189
 		$messages = apply_filters( 'frm_filter_inbox', $messages );
@@ -241,14 +241,14 @@  discard block
 block discarded – undo
241 241
 	 * @return void
242 242
 	 */
243 243
 	public function mark_read( $key ) {
244
-		if ( ! $key || ! isset( self::$messages[ $key ] ) ) {
244
+		if ( ! $key || ! isset( self::$messages[$key] ) ) {
245 245
 			return;
246 246
 		}
247 247
 
248
-		if ( ! isset( self::$messages[ $key ]['read'] ) ) {
249
-			self::$messages[ $key ]['read'] = array();
248
+		if ( ! isset( self::$messages[$key]['read'] ) ) {
249
+			self::$messages[$key]['read'] = array();
250 250
 		}
251
-		self::$messages[ $key ]['read'][ get_current_user_id() ] = time();
251
+		self::$messages[$key]['read'][get_current_user_id()] = time();
252 252
 
253 253
 		$this->update_list();
254 254
 	}
@@ -260,9 +260,9 @@  discard block
 block discarded – undo
260 260
 	 * @return void
261 261
 	 */
262 262
 	public function mark_unread( $key ) {
263
-		$is_read = isset( self::$messages[ $key ] ) && isset( self::$messages[ $key ]['read'] ) && isset( self::$messages[ $key ]['read'][ get_current_user_id() ] );
263
+		$is_read = isset( self::$messages[$key] ) && isset( self::$messages[$key]['read'] ) && isset( self::$messages[$key]['read'][get_current_user_id()] );
264 264
 		if ( $is_read ) {
265
-			unset( self::$messages[ $key ]['read'][ get_current_user_id() ] );
265
+			unset( self::$messages[$key]['read'][get_current_user_id()] );
266 266
 			$this->update_list();
267 267
 		}
268 268
 	}
@@ -278,14 +278,14 @@  discard block
 block discarded – undo
278 278
 			return;
279 279
 		}
280 280
 
281
-		if ( ! isset( self::$messages[ $key ] ) ) {
281
+		if ( ! isset( self::$messages[$key] ) ) {
282 282
 			return;
283 283
 		}
284 284
 
285
-		if ( ! isset( self::$messages[ $key ]['dismissed'] ) ) {
286
-			self::$messages[ $key ]['dismissed'] = array();
285
+		if ( ! isset( self::$messages[$key]['dismissed'] ) ) {
286
+			self::$messages[$key]['dismissed'] = array();
287 287
 		}
288
-		self::$messages[ $key ]['dismissed'][ get_current_user_id() ] = time();
288
+		self::$messages[$key]['dismissed'][get_current_user_id()] = time();
289 289
 
290 290
 		$this->update_list();
291 291
 	}
@@ -299,11 +299,11 @@  discard block
 block discarded – undo
299 299
 		$user_id = get_current_user_id();
300 300
 		foreach ( self::$messages as $key => $message ) {
301 301
 			if ( ! isset( $message['dismissed'] ) ) {
302
-				self::$messages[ $key ]['dismissed'] = array();
302
+				self::$messages[$key]['dismissed'] = array();
303 303
 			}
304 304
 
305
-			if ( ! isset( $message['dismissed'][ $user_id ] ) ) {
306
-				self::$messages[ $key ]['dismissed'][ $user_id ] = time();
305
+			if ( ! isset( $message['dismissed'][$user_id] ) ) {
306
+				self::$messages[$key]['dismissed'][$user_id] = time();
307 307
 			}
308 308
 		}
309 309
 		$this->update_list();
@@ -313,8 +313,8 @@  discard block
 block discarded – undo
313 313
 		$messages = $this->get_messages( 'filter' );
314 314
 		$user_id  = get_current_user_id();
315 315
 		foreach ( $messages as $t => $message ) {
316
-			if ( isset( $message['read'] ) && isset( $message['read'][ $user_id ] ) ) {
317
-				unset( $messages[ $t ] );
316
+			if ( isset( $message['read'] ) && isset( $message['read'][$user_id] ) ) {
317
+				unset( $messages[$t] );
318 318
 			}
319 319
 		}
320 320
 		return $messages;
@@ -341,8 +341,8 @@  discard block
 block discarded – undo
341 341
 	 * @return void
342 342
 	 */
343 343
 	public function remove( $key ) {
344
-		if ( isset( self::$messages[ $key ] ) ) {
345
-			unset( self::$messages[ $key ] );
344
+		if ( isset( self::$messages[$key] ) ) {
345
+			unset( self::$messages[$key] );
346 346
 			$this->update_list();
347 347
 		}
348 348
 	}
@@ -388,7 +388,7 @@  discard block
 block discarded – undo
388 388
 			 * @param array $matches The regex results for a single match.
389 389
 			 * @return string
390 390
 			 */
391
-			function ( $matches ) {
391
+			function( $matches ) {
392 392
 				$url   = $matches[2];
393 393
 				$parts = parse_url( $url );
394 394
 
@@ -452,7 +452,7 @@  discard block
 block discarded – undo
452 452
 		return array_filter(
453 453
 			$inbox->get_messages( 'filter' ),
454 454
 			function( $message ) use ( $key ) {
455
-				return ! empty( $message[ $key ] );
455
+				return ! empty( $message[$key] );
456 456
 			}
457 457
 		);
458 458
 	}
@@ -499,7 +499,7 @@  discard block
 block discarded – undo
499 499
 		return array_reduce(
500 500
 			$keys_to_return,
501 501
 			function( $total, $key ) use ( $message ) {
502
-				$total[ $key ] = $message[ $key ];
502
+				$total[$key] = $message[$key];
503 503
 				return $total;
504 504
 			},
505 505
 			array()
Please login to merge, or discard this patch.
classes/helpers/FrmSubmitHelper.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -71,8 +71,8 @@  discard block
 block discarded – undo
71 71
 	public static function get_current_action_from_global_var( $form_id ) {
72 72
 		global $frm_vars;
73 73
 
74
-		if ( isset( $frm_vars['form_params'][ $form_id ]['action'] ) ) {
75
-			return $frm_vars['form_params'][ $form_id ]['action'];
74
+		if ( isset( $frm_vars['form_params'][$form_id]['action'] ) ) {
75
+			return $frm_vars['form_params'][$form_id]['action'];
76 76
 		}
77 77
 
78 78
 		return 'create';
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
 	public static function remove_submit_field_from_list( &$fields ) {
168 168
 		foreach ( $fields as $key => $field ) {
169 169
 			if ( self::FIELD_TYPE === FrmField::get_field_type( $field ) ) {
170
-				unset( $fields[ $key ] );
170
+				unset( $fields[$key] );
171 171
 				return;
172 172
 			}
173 173
 		}
Please login to merge, or discard this patch.
classes/helpers/FrmListHelper.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -225,8 +225,8 @@  discard block
 block discarded – undo
225 225
 			return $this->get_pagenum();
226 226
 		}
227 227
 
228
-		if ( isset( $this->_pagination_args[ $key ] ) ) {
229
-			return $this->_pagination_args[ $key ];
228
+		if ( isset( $this->_pagination_args[$key] ) ) {
229
+			return $this->_pagination_args[$key];
230 230
 		}
231 231
 	}
232 232
 
@@ -271,8 +271,8 @@  discard block
 block discarded – undo
271 271
 	}
272 272
 
273 273
 	private function hidden_search_inputs( $param_name ) {
274
-		if ( ! empty( $_REQUEST[ $param_name ] ) ) {
275
-			$value = sanitize_text_field( wp_unslash( $_REQUEST[ $param_name ] ) );
274
+		if ( ! empty( $_REQUEST[$param_name] ) ) {
275
+			$value = sanitize_text_field( wp_unslash( $_REQUEST[$param_name] ) );
276 276
 			echo '<input type="hidden" name="' . esc_attr( $param_name ) . '" value="' . esc_attr( $value ) . '" />';
277 277
 		}
278 278
 	}
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
 
315 315
 		echo "<ul class='subsubsub'>\n";
316 316
 		foreach ( $views as $class => $view ) {
317
-			$views[ $class ] = "\t" . '<li class="' . esc_attr( $class ) . '">' . $view;
317
+			$views[$class] = "\t" . '<li class="' . esc_attr( $class ) . '">' . $view;
318 318
 		}
319 319
 		echo implode( " |</li>\n", $views ) . "</li>\n"; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
320 320
 		echo '</ul>';
@@ -686,7 +686,7 @@  discard block
 block discarded – undo
686 686
 			'next'  => __( 'Next page', 'formidable' ),
687 687
 		);
688 688
 
689
-		return $labels[ $link ];
689
+		return $labels[$link];
690 690
 	}
691 691
 
692 692
 	private function current_url() {
@@ -776,7 +776,7 @@  discard block
 block discarded – undo
776 776
 
777 777
 		// If the primary column doesn't exist fall back to the
778 778
 		// first non-checkbox column.
779
-		if ( ! isset( $columns[ $default ] ) ) {
779
+		if ( ! isset( $columns[$default] ) ) {
780 780
 			$default = self::get_default_primary_column_name();
781 781
 		}
782 782
 
@@ -790,7 +790,7 @@  discard block
 block discarded – undo
790 790
 		 */
791 791
 		$column = apply_filters( 'list_table_primary_column', $default, $this->screen->id );
792 792
 
793
-		if ( empty( $column ) || ! isset( $columns[ $column ] ) ) {
793
+		if ( empty( $column ) || ! isset( $columns[$column] ) ) {
794 794
 			$column = $default;
795 795
 		}
796 796
 
@@ -811,7 +811,7 @@  discard block
 block discarded – undo
811 811
 			// In 4.3, we added a fourth argument for primary column.
812 812
 			$column_headers = array( array(), array(), array(), $this->get_primary_column_name() );
813 813
 			foreach ( $this->_column_headers as $key => $value ) {
814
-				$column_headers[ $key ] = $value;
814
+				$column_headers[$key] = $value;
815 815
 			}
816 816
 
817 817
 			return $column_headers;
@@ -844,7 +844,7 @@  discard block
 block discarded – undo
844 844
 				$data[1] = false;
845 845
 			}
846 846
 
847
-			$sortable[ $id ] = $data;
847
+			$sortable[$id] = $data;
848 848
 		}
849 849
 
850 850
 		$primary = $this->get_primary_column_name();
@@ -922,8 +922,8 @@  discard block
 block discarded – undo
922 922
 				$class[] = 'column-primary';
923 923
 			}
924 924
 
925
-			if ( isset( $sortable[ $column_key ] ) ) {
926
-				list( $orderby, $desc_first ) = $sortable[ $column_key ];
925
+			if ( isset( $sortable[$column_key] ) ) {
926
+				list( $orderby, $desc_first ) = $sortable[$column_key];
927 927
 
928 928
 				if ( $current_orderby == $orderby ) {
929 929
 					// The sorted column. The `aria-sort` attribute must be set only on the sorted column.
@@ -1036,7 +1036,7 @@  discard block
 block discarded – undo
1036 1036
 	 * @return bool Returns true if the setting is not set or if it is not false; otherwise, returns false.
1037 1037
 	 */
1038 1038
 	protected function should_display( $args, $settings ) {
1039
-		return ! isset( $args[ $settings ] ) || false !== $args[ $settings ];
1039
+		return ! isset( $args[$settings] ) || false !== $args[$settings];
1040 1040
 	}
1041 1041
 
1042 1042
 	/**
Please login to merge, or discard this patch.
classes/models/FrmField.php 1 patch
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -300,8 +300,8 @@  discard block
 block discarded – undo
300 300
 			require_once ABSPATH . 'wp-admin/includes/plugin.php';
301 301
 		}
302 302
 		$plugins = get_plugins();
303
-		if ( isset( $plugins[ $plugin ] ) && ! empty( $plugins[ $plugin ]['Version'] ) ) {
304
-			return $plugins[ $plugin ]['Version'];
303
+		if ( isset( $plugins[$plugin] ) && ! empty( $plugins[$plugin]['Version'] ) ) {
304
+			return $plugins[$plugin]['Version'];
305 305
 		}
306 306
 		return false;
307 307
 	}
@@ -372,7 +372,7 @@  discard block
 block discarded – undo
372 372
 		$values = FrmAppHelper::maybe_filter_array( $values, array( 'name', 'description' ) );
373 373
 
374 374
 		foreach ( array( 'name', 'description', 'type', 'default_value' ) as $col ) {
375
-			$new_values[ $col ] = $values[ $col ];
375
+			$new_values[$col] = $values[$col];
376 376
 		}
377 377
 
378 378
 		$new_values['options']       = self::maybe_filter_options( $values['options'] );
@@ -383,7 +383,7 @@  discard block
 block discarded – undo
383 383
 		$new_values['created_at']    = current_time( 'mysql', 1 );
384 384
 
385 385
 		if ( isset( $values['id'] ) ) {
386
-			$frm_duplicate_ids[ $values['field_key'] ] = $new_values['field_key'];
386
+			$frm_duplicate_ids[$values['field_key']] = $new_values['field_key'];
387 387
 			$new_values                                = apply_filters( 'frm_duplicated_field', $new_values );
388 388
 		}
389 389
 
@@ -392,9 +392,9 @@  discard block
 block discarded – undo
392 392
 		foreach ( $new_values as $k => $v ) {
393 393
 			if ( is_array( $v ) ) {
394 394
 				if ( $k === 'default_value' ) {
395
-					$new_values[ $k ] = FrmAppHelper::maybe_json_encode( $v );
395
+					$new_values[$k] = FrmAppHelper::maybe_json_encode( $v );
396 396
 				} else {
397
-					$new_values[ $k ] = serialize( $v );
397
+					$new_values[$k] = serialize( $v );
398 398
 				}
399 399
 			}
400 400
 			unset( $k, $v );
@@ -414,7 +414,7 @@  discard block
 block discarded – undo
414 414
 		}
415 415
 
416 416
 		if ( isset( $values['id'] ) ) {
417
-			$frm_duplicate_ids[ $values['id'] ] = $new_id;
417
+			$frm_duplicate_ids[$values['id']] = $new_id;
418 418
 		}
419 419
 
420 420
 		return $new_id;
@@ -474,7 +474,7 @@  discard block
 block discarded – undo
474 474
 	public static function duplicate( $old_form_id, $form_id, $copy_keys = false, $blog_id = false ) {
475 475
 		global $frm_duplicate_ids;
476 476
 
477
-		$where  = array(
477
+		$where = array(
478 478
 			array(
479 479
 				'or'                => 1,
480 480
 				'fi.form_id'        => $old_form_id,
@@ -520,8 +520,8 @@  discard block
 block discarded – undo
520 520
 
521 521
 			$values                                 = apply_filters( 'frm_duplicated_field', $values );
522 522
 			$new_id                                 = self::create( $values );
523
-			$frm_duplicate_ids[ $field->id ]        = $new_id;
524
-			$frm_duplicate_ids[ $field->field_key ] = $new_id;
523
+			$frm_duplicate_ids[$field->id]        = $new_id;
524
+			$frm_duplicate_ids[$field->field_key] = $new_id;
525 525
 			unset( $field );
526 526
 		}//end foreach
527 527
 	}
@@ -559,11 +559,11 @@  discard block
 block discarded – undo
559 559
 
560 560
 		// serialize array values
561 561
 		foreach ( array( 'field_options', 'options' ) as $opt ) {
562
-			if ( isset( $values[ $opt ] ) && is_array( $values[ $opt ] ) ) {
562
+			if ( isset( $values[$opt] ) && is_array( $values[$opt] ) ) {
563 563
 				if ( 'field_options' === $opt ) {
564
-					$values[ $opt ] = self::maybe_filter_options( $values[ $opt ] );
564
+					$values[$opt] = self::maybe_filter_options( $values[$opt] );
565 565
 				}
566
-				$values[ $opt ] = serialize( $values[ $opt ] );
566
+				$values[$opt] = serialize( $values[$opt] );
567 567
 			}
568 568
 		}
569 569
 		if ( isset( $values['default_value'] ) && is_array( $values['default_value'] ) ) {
@@ -715,7 +715,7 @@  discard block
 block discarded – undo
715 715
 				'id'        => $id,
716 716
 				'field_key' => $id,
717 717
 			);
718
-			$type  = FrmDb::get_var( 'frm_fields', $where, $col );
718
+			$type = FrmDb::get_var( 'frm_fields', $where, $col );
719 719
 		}
720 720
 
721 721
 		return $type;
@@ -741,7 +741,7 @@  discard block
 block discarded – undo
741 741
 					continue;
742 742
 				}
743 743
 
744
-				$fields[ $result->id ] = $result;
744
+				$fields[$result->id] = $result;
745 745
 				$count ++;
746 746
 				if ( $limit == 1 ) {
747 747
 					$fields = $result;
@@ -787,7 +787,7 @@  discard block
 block discarded – undo
787 787
 			$count  = 0;
788 788
 			foreach ( $results as $result ) {
789 789
 				$count ++;
790
-				$fields[ $result->id ] = $result;
790
+				$fields[$result->id] = $result;
791 791
 				if ( ! empty( $limit ) && $count >= $limit ) {
792 792
 					break;
793 793
 				}
@@ -856,7 +856,7 @@  discard block
 block discarded – undo
856 856
 			}
857 857
 
858 858
 			if ( ! empty( $sub_fields ) ) {
859
-				$index        = $k + $index_offset;
859
+				$index = $k + $index_offset;
860 860
 				$index_offset += count( $sub_fields );
861 861
 				array_splice( $results, $index, 0, $sub_fields );
862 862
 			}
@@ -901,7 +901,7 @@  discard block
 block discarded – undo
901 901
 		$query_type = ( $limit == ' LIMIT 1' || $limit == 1 ) ? 'row' : 'results';
902 902
 
903 903
 		if ( is_array( $where ) ) {
904
-			$args    = array(
904
+			$args = array(
905 905
 				'order_by' => $order_by,
906 906
 				'limit'    => $limit,
907 907
 			);
@@ -932,9 +932,9 @@  discard block
 block discarded – undo
932 932
 				FrmDb::set_cache( $result->field_key, $result, 'frm_field' );
933 933
 
934 934
 				self::prepare_options( $result );
935
-				$results[ $r_key ]->field_options = $result->field_options;
936
-				$results[ $r_key ]->options       = $result->options;
937
-				$results[ $r_key ]->default_value = $result->default_value;
935
+				$results[$r_key]->field_options = $result->field_options;
936
+				$results[$r_key]->options       = $result->options;
937
+				$results[$r_key]->default_value = $result->default_value;
938 938
 
939 939
 				unset( $r_key, $result );
940 940
 			}
@@ -1137,19 +1137,19 @@  discard block
 block discarded – undo
1137 1137
 	}
1138 1138
 
1139 1139
 	public static function is_option_true_in_array( $field, $option ) {
1140
-		return isset( $field[ $option ] ) && $field[ $option ];
1140
+		return isset( $field[$option] ) && $field[$option];
1141 1141
 	}
1142 1142
 
1143 1143
 	public static function is_option_true_in_object( $field, $option ) {
1144
-		return isset( $field->field_options[ $option ] ) && $field->field_options[ $option ];
1144
+		return isset( $field->field_options[$option] ) && $field->field_options[$option];
1145 1145
 	}
1146 1146
 
1147 1147
 	public static function is_option_empty_in_array( $field, $option ) {
1148
-		return ! isset( $field[ $option ] ) || empty( $field[ $option ] );
1148
+		return ! isset( $field[$option] ) || empty( $field[$option] );
1149 1149
 	}
1150 1150
 
1151 1151
 	public static function is_option_empty_in_object( $field, $option ) {
1152
-		return ! isset( $field->field_options[ $option ] ) || empty( $field->field_options[ $option ] );
1152
+		return ! isset( $field->field_options[$option] ) || empty( $field->field_options[$option] );
1153 1153
 	}
1154 1154
 
1155 1155
 	/**
@@ -1158,7 +1158,7 @@  discard block
 block discarded – undo
1158 1158
 	 * @return bool
1159 1159
 	 */
1160 1160
 	public static function is_option_value_in_object( $field, $option ) {
1161
-		return isset( $field->field_options[ $option ] ) && $field->field_options[ $option ] != '';
1161
+		return isset( $field->field_options[$option] ) && $field->field_options[$option] != '';
1162 1162
 	}
1163 1163
 
1164 1164
 	/**
@@ -1176,10 +1176,10 @@  discard block
 block discarded – undo
1176 1176
 
1177 1177
 	public static function get_option_in_array( $field, $option ) {
1178 1178
 
1179
-		if ( isset( $field[ $option ] ) ) {
1180
-			$this_option = $field[ $option ];
1181
-		} elseif ( isset( $field['field_options'] ) && is_array( $field['field_options'] ) && isset( $field['field_options'][ $option ] ) ) {
1182
-			$this_option = $field['field_options'][ $option ];
1179
+		if ( isset( $field[$option] ) ) {
1180
+			$this_option = $field[$option];
1181
+		} elseif ( isset( $field['field_options'] ) && is_array( $field['field_options'] ) && isset( $field['field_options'][$option] ) ) {
1182
+			$this_option = $field['field_options'][$option];
1183 1183
 		} else {
1184 1184
 			$this_option = '';
1185 1185
 		}
@@ -1188,7 +1188,7 @@  discard block
 block discarded – undo
1188 1188
 	}
1189 1189
 
1190 1190
 	public static function get_option_in_object( $field, $option ) {
1191
-		return isset( $field->field_options[ $option ] ) ? $field->field_options[ $option ] : '';
1191
+		return isset( $field->field_options[$option] ) ? $field->field_options[$option] : '';
1192 1192
 	}
1193 1193
 
1194 1194
 	/**
Please login to merge, or discard this patch.