Completed
Push — master ( 804b0a...fa4158 )
by Stephanie
02:30
created
classes/controllers/FrmAddonsController.php 2 patches
Doc Comments   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -300,7 +300,6 @@  discard block
 block discarded – undo
300 300
 	 * Get the action link for an addon that isn't active.
301 301
 	 *
302 302
 	 * @since 3.06.03
303
-	 * @param string $addon The plugin slug
304 303
 	 * @return array
305 304
 	 */
306 305
 	public static function install_link( $plugin ) {
@@ -403,6 +402,7 @@  discard block
 block discarded – undo
403 402
 
404 403
 	/**
405 404
 	 * @since 3.04.02
405
+	 * @param string $link
406 406
 	 */
407 407
 	private static function prepare_addon_link( &$link ) {
408 408
 		$site_url = 'https://formidableforms.com/';
@@ -736,6 +736,7 @@  discard block
 block discarded – undo
736 736
 	 * so let's install the plugin.
737 737
 	 *
738 738
 	 * @since 3.04.02
739
+	 * @return string
739 740
 	 */
740 741
 	private static function install_addon() {
741 742
 		require_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' );
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 		} else {
64 64
 			foreach ( $addons as $k => $addon ) {
65 65
 				if ( empty( $addon['excerpt'] ) && $k !== 'error' ) {
66
-					unset( $addons[ $k ] );
66
+					unset( $addons[$k] );
67 67
 				}
68 68
 			}
69 69
 		}
@@ -222,16 +222,16 @@  discard block
 block discarded – undo
222 222
 				continue;
223 223
 			}
224 224
 
225
-			$wp_plugin  = isset( $wp_plugins[ $folder ] ) ? $wp_plugins[ $folder ] : array();
225
+			$wp_plugin  = isset( $wp_plugins[$folder] ) ? $wp_plugins[$folder] : array();
226 226
 			$wp_version = isset( $wp_plugin['Version'] ) ? $wp_plugin['Version'] : '1.0';
227 227
 
228 228
 			if ( version_compare( $wp_version, $plugin->new_version, '<' ) ) {
229 229
 				$slug                           = explode( '/', $folder );
230 230
 				$plugin->slug                   = $slug[0];
231
-				$transient->response[ $folder ] = $plugin;
231
+				$transient->response[$folder] = $plugin;
232 232
 			}
233 233
 
234
-			$transient->checked[ $folder ] = $wp_version;
234
+			$transient->checked[$folder] = $wp_version;
235 235
 
236 236
 		}
237 237
 
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
 
255 255
 		$all_plugins = get_plugins();
256 256
 
257
-		return isset( $all_plugins[ $plugin ] );
257
+		return isset( $all_plugins[$plugin] );
258 258
 	}
259 259
 
260 260
 	/**
@@ -293,13 +293,13 @@  discard block
 block discarded – undo
293 293
 			}
294 294
 
295 295
 			$download_id = isset( $plugin['id'] ) ? $plugin['id'] : 0;
296
-			if ( ! empty( $download_id ) && ! isset( $version_info[ $download_id ]['package'] ) ) {
296
+			if ( ! empty( $download_id ) && ! isset( $version_info[$download_id]['package'] ) ) {
297 297
 				// if this addon is using its own license, get the update url
298 298
 				$addon_info = $api->get_api_info();
299 299
 
300
-				$version_info[ $download_id ] = $addon_info[ $download_id ];
300
+				$version_info[$download_id] = $addon_info[$download_id];
301 301
 				if ( isset( $addon_info['error'] ) ) {
302
-					$version_info[ $download_id ]['error'] = array(
302
+					$version_info[$download_id]['error'] = array(
303 303
 						'message' => $addon_info['error']['message'],
304 304
 						'code'    => $addon_info['error']['code'],
305 305
 					);
@@ -318,7 +318,7 @@  discard block
 block discarded – undo
318 318
 	 * @return array
319 319
 	 */
320 320
 	public static function install_link( $plugin ) {
321
-		$link    = array();
321
+		$link = array();
322 322
 		$addons = self::get_api_addons();
323 323
 		self::prepare_addons( $addons );
324 324
 
@@ -365,8 +365,8 @@  discard block
 block discarded – undo
365 365
 					return $addon;
366 366
 				}
367 367
 			}
368
-		} elseif ( isset( $addons[ $download_id ] ) ) {
369
-			$plugin = $addons[ $download_id ];
368
+		} elseif ( isset( $addons[$download_id] ) ) {
369
+			$plugin = $addons[$download_id];
370 370
 		}
371 371
 
372 372
 		return $plugin;
@@ -417,7 +417,7 @@  discard block
 block discarded – undo
417 417
 			self::prepare_addon_link( $addon['link'] );
418 418
 
419 419
 			self::set_addon_status( $addon );
420
-			$addons[ $id ] = $addon;
420
+			$addons[$id] = $addon;
421 421
 		}
422 422
 	}
423 423
 
@@ -435,7 +435,7 @@  discard block
 block discarded – undo
435 435
 			'utm_medium'   => 'addons',
436 436
 			'utm_campaign' => 'liteplugin',
437 437
 		);
438
-		$link       = add_query_arg( $query_args, $link );
438
+		$link = add_query_arg( $query_args, $link );
439 439
 	}
440 440
 
441 441
 	/**
Please login to merge, or discard this patch.
classes/models/FrmUsage.php 2 patches
Doc Comments   +2 added lines patch added patch discarded remove patch
@@ -147,6 +147,7 @@  discard block
 block discarded – undo
147 147
 	 * Include the permissions settings for each capability.
148 148
 	 *
149 149
 	 * @since 3.06.04
150
+	 * @param FrmSettings $settings_list
150 151
 	 * @return array
151 152
 	 */
152 153
 	private function messages( $settings_list ) {
@@ -173,6 +174,7 @@  discard block
 block discarded – undo
173 174
 	 * Include the permissions settings for each capability.
174 175
 	 *
175 176
 	 * @since 3.06.04
177
+	 * @param FrmSettings $settings_list
176 178
 	 * @return array
177 179
 	 */
178 180
 	private function permissions( $settings_list ) {
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 
140 140
 		foreach ( $pass_settings as $setting ) {
141 141
 			if ( isset( $settings_list->$setting ) ) {
142
-				$settings[ $setting ] = $this->maybe_json( $settings_list->$setting );
142
+				$settings[$setting] = $this->maybe_json( $settings_list->$setting );
143 143
 			}
144 144
 		}
145 145
 
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
 
172 172
 		$message_settings = array();
173 173
 		foreach ( $messages as $message ) {
174
-			$message_settings[ $message ] = $settings_list->$message;
174
+			$message_settings[$message] = $settings_list->$message;
175 175
 		}
176 176
 
177 177
 		return $message_settings;
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
 
190 190
 		foreach ( $frm_roles as $frm_role => $frm_role_description ) {
191 191
 			if ( isset( $settings_list->$frm_role ) ) {
192
-				$permissions[ $frm_role ] = $settings_list->$frm_role;
192
+				$permissions[$frm_role] = $settings_list->$frm_role;
193 193
 			}
194 194
 		}
195 195
 
@@ -256,8 +256,8 @@  discard block
 block discarded – undo
256 256
 			);
257 257
 
258 258
 			foreach ( $settings as $setting ) {
259
-				if ( isset( $form->options[ $setting ] ) ) {
260
-					$new_form[ $setting ] = $this->maybe_json( $form->options[ $setting ] );
259
+				if ( isset( $form->options[$setting] ) ) {
260
+					$new_form[$setting] = $this->maybe_json( $form->options[$setting] );
261 261
 				}
262 262
 			}
263 263
 
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
 	 * @return array
309 309
 	 */
310 310
 	private function fields() {
311
-		$args   = array(
311
+		$args = array(
312 312
 			'limit'    => 50,
313 313
 			'order_by' => 'id DESC',
314 314
 		);
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
 		$fields = FrmDb::get_results( 'frm_fields', array(), 'form_id, name, type, field_options', $args );
317 317
 		foreach ( $fields as $k => $field ) {
318 318
 			FrmAppHelper::unserialize_or_decode( $field->field_options );
319
-			$fields[ $k ]->field_options = json_encode( $field->field_options );
319
+			$fields[$k]->field_options = json_encode( $field->field_options );
320 320
 		}
321 321
 		return $fields;
322 322
 	}
Please login to merge, or discard this patch.
classes/controllers/FrmXMLController.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@
 block discarded – undo
80 80
 	 *
81 81
 	 * @since 3.06
82 82
 	 *
83
-	 * @param object $xml The values included in the XML.
83
+	 * @param SimpleXMLElement $xml The values included in the XML.
84 84
 	 */
85 85
 	private static function set_new_form_name( &$xml ) {
86 86
 		if ( ! isset( $xml->form ) ) {
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
 		// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash
197 197
 		$file_type = sanitize_option( 'upload_path', $_FILES['frm_import_file']['name'] );
198 198
 		$file_type = strtolower( pathinfo( $file_type, PATHINFO_EXTENSION ) );
199
-		if ( 'xml' !== $file_type && isset( $export_format[ $file_type ] ) ) {
199
+		if ( 'xml' !== $file_type && isset( $export_format[$file_type] ) ) {
200 200
 			// allow other file types to be imported
201 201
 			do_action( 'frm_before_import_' . $file_type );
202 202
 
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
 		foreach ( $type as $tb_type ) {
280 280
 			$where = array();
281 281
 			$join  = '';
282
-			$table = $tables[ $tb_type ];
282
+			$table = $tables[$tb_type];
283 283
 
284 284
 			$select     = $table . '.id';
285 285
 			$query_vars = array();
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
 							$table . '.parent_form_id' => $args['ids'],
295 295
 						);
296 296
 					} else {
297
-						$where[ $table . '.status !' ] = 'draft';
297
+						$where[$table . '.status !'] = 'draft';
298 298
 					}
299 299
 					break;
300 300
 				case 'actions':
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
 				case 'items':
308 308
 					// $join = "INNER JOIN {$wpdb->prefix}frm_item_metas im ON ($table.id = im.item_id)";
309 309
 					if ( $args['ids'] ) {
310
-						$where[ $table . '.form_id' ] = $args['ids'];
310
+						$where[$table . '.form_id'] = $args['ids'];
311 311
 					}
312 312
 					break;
313 313
 				case 'styles':
@@ -348,7 +348,7 @@  discard block
 block discarded – undo
348 348
 					}
349 349
 			}
350 350
 
351
-			$records[ $tb_type ] = FrmDb::get_col( $table . $join, $where, $select );
351
+			$records[$tb_type] = FrmDb::get_col( $table . $join, $where, $select );
352 352
 			unset( $tb_type );
353 353
 		}
354 354
 
@@ -493,7 +493,7 @@  discard block
 block discarded – undo
493 493
 		$no_export_fields = FrmField::no_save_fields();
494 494
 		foreach ( $csv_fields as $k => $f ) {
495 495
 			if ( in_array( $f->type, $no_export_fields ) ) {
496
-				unset( $csv_fields[ $k ] );
496
+				unset( $csv_fields[$k] );
497 497
 			}
498 498
 		}
499 499
 
Please login to merge, or discard this patch.
classes/helpers/FrmFieldsHelper.php 2 patches
Doc Comments   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 	 *
110 110
 	 * @param string $type
111 111
 	 *
112
-	 * @return array
112
+	 * @return string
113 113
 	 */
114 114
 	public static function get_default_field_options( $type ) {
115 115
 		$field_type = FrmFieldFactory::get_field_type( $type );
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
 	 *
213 213
 	 * @param object $field
214 214
 	 *
215
-	 * @return array
215
+	 * @return stdClass
216 216
 	 */
217 217
 	private static function get_original_field( $field ) {
218 218
 		$original_type = FrmField::get_option( $field, 'original_type' );
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
 	 *
241 241
 	 * @param string $type
242 242
 	 *
243
-	 * @return array
243
+	 * @return string
244 244
 	 */
245 245
 	public static function get_default_field( $type ) {
246 246
 		$field_type = FrmFieldFactory::get_field_type( $type );
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
 	 * @since 2.0
266 266
 	 *
267 267
 	 * @param $field
268
-	 * @param $error
268
+	 * @param string $error
269 269
 	 *
270 270
 	 * @return string
271 271
 	 */
Please login to merge, or discard this patch.
Spacing   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 			if ( in_array( $type, array( 'data', 'lookup' ) ) ) {
27 27
 				$values['field_options']['data_type'] = $setting;
28 28
 			} else {
29
-				$values['field_options'][ $setting ] = 1;
29
+				$values['field_options'][$setting] = 1;
30 30
 			}
31 31
 		}
32 32
 
@@ -133,10 +133,10 @@  discard block
 block discarded – undo
133 133
 		}
134 134
 
135 135
 		foreach ( $defaults as $opt => $default ) {
136
-			$values[ $opt ] = isset( $field->field_options[ $opt ] ) ? $field->field_options[ $opt ] : $default;
136
+			$values[$opt] = isset( $field->field_options[$opt] ) ? $field->field_options[$opt] : $default;
137 137
 
138 138
 			if ( $check_post ) {
139
-				self::get_posted_field_setting( $opt . '_' . $field->id, $values[ $opt ] );
139
+				self::get_posted_field_setting( $opt . '_' . $field->id, $values[$opt] );
140 140
 			}
141 141
 
142 142
 			unset( $opt, $default );
@@ -180,19 +180,19 @@  discard block
 block discarded – undo
180 180
 	 * @param mixed $value
181 181
 	 */
182 182
 	private static function get_posted_field_setting( $setting, &$value ) {
183
-		if ( ! isset( $_POST['field_options'][ $setting ] ) ) {
183
+		if ( ! isset( $_POST['field_options'][$setting] ) ) {
184 184
 			return;
185 185
 		}
186 186
 
187 187
 		if ( strpos( $setting, 'html' ) !== false ) {
188 188
 			// Strip slashes from HTML but not regex or script tags.
189 189
 			// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
190
-			$value = wp_unslash( $_POST['field_options'][ $setting ] );
190
+			$value = wp_unslash( $_POST['field_options'][$setting] );
191 191
 		} elseif ( strpos( $setting, 'format_' ) === 0 ) {
192 192
 			// TODO: Remove stripslashes on output, and use on input only.
193
-			$value = sanitize_text_field( $_POST['field_options'][ $setting ] ); // WPCS: sanitization ok.
193
+			$value = sanitize_text_field( $_POST['field_options'][$setting] ); // WPCS: sanitization ok.
194 194
 		} else {
195
-			$value = wp_kses_post( wp_unslash( $_POST['field_options'][ $setting ] ) );
195
+			$value = wp_kses_post( wp_unslash( $_POST['field_options'][$setting] ) );
196 196
 		}
197 197
 	}
198 198
 
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
 		$values['default_value'] = FrmAppHelper::maybe_json_encode( $field->default_value );
265 265
 
266 266
 		foreach ( array( 'name', 'description', 'type', 'field_order', 'field_options', 'required' ) as $col ) {
267
-			$values[ $col ] = $field->{$col};
267
+			$values[$col] = $field->{$col};
268 268
 		}
269 269
 	}
270 270
 
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
 		);
305 305
 
306 306
 		$msg = FrmField::get_option( $field, $error );
307
-		$msg = empty( $msg ) ? $defaults[ $error ]['part'] : $msg;
307
+		$msg = empty( $msg ) ? $defaults[$error]['part'] : $msg;
308 308
 		$msg = do_shortcode( $msg );
309 309
 
310 310
 		return $msg;
@@ -412,7 +412,7 @@  discard block
 block discarded – undo
412 412
 		}
413 413
 
414 414
 		$base_name = 'default_value_' . $field['id'];
415
-		$html_id    = isset( $field['html_id'] ) ? $field['html_id'] : self::get_html_id( $field );
415
+		$html_id = isset( $field['html_id'] ) ? $field['html_id'] : self::get_html_id( $field );
416 416
 
417 417
 		$default_type = self::get_default_value_type( $field );
418 418
 
@@ -708,7 +708,7 @@  discard block
 block discarded – undo
708 708
 				continue;
709 709
 			}
710 710
 
711
-			$atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[3][ $short_key ] );
711
+			$atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[3][$short_key] );
712 712
 			$tag  = FrmShortcodeHelper::get_shortcode_tag( $shortcodes, $short_key );
713 713
 
714 714
 			$atts['entry'] = $entry;
@@ -717,7 +717,7 @@  discard block
 block discarded – undo
717 717
 
718 718
 			if ( $replace_with !== null ) {
719 719
 				self::sanitize_embedded_shortcodes( compact( 'entry' ), $replace_with );
720
-				$content = str_replace( $shortcodes[0][ $short_key ], $replace_with, $content );
720
+				$content = str_replace( $shortcodes[0][$short_key], $replace_with, $content );
721 721
 			}
722 722
 
723 723
 			unset( $atts, $replace_with );
@@ -760,8 +760,8 @@  discard block
 block discarded – undo
760 760
 
761 761
 		$dynamic_default = array( 'admin_email', 'siteurl', 'frmurl', 'sitename', 'get' );
762 762
 
763
-		if ( isset( $shortcode_values[ $atts['tag'] ] ) ) {
764
-			$replace_with = $shortcode_values[ $atts['tag'] ];
763
+		if ( isset( $shortcode_values[$atts['tag']] ) ) {
764
+			$replace_with = $shortcode_values[$atts['tag']];
765 765
 		} elseif ( in_array( $atts['tag'], $dynamic_default ) ) {
766 766
 			$replace_with = self::dynamic_default_values( $atts['tag'], $atts );
767 767
 		} elseif ( $clean_tag == 'user_agent' ) {
@@ -970,8 +970,8 @@  discard block
 block discarded – undo
970 970
 			self::field_types_for_input( $single_input, $field_selection, $field_types );
971 971
 		} elseif ( in_array( $type, $multiple_input ) ) {
972 972
 			self::field_types_for_input( $multiple_input, $field_selection, $field_types );
973
-		} elseif ( isset( $field_selection[ $type ] ) ) {
974
-			$field_types[ $type ] = $field_selection[ $type ];
973
+		} elseif ( isset( $field_selection[$type] ) ) {
974
+			$field_types[$type] = $field_selection[$type];
975 975
 		}
976 976
 
977 977
 		$field_types = apply_filters( 'frm_switch_field_types', $field_types, compact( 'type' ) );
@@ -1004,7 +1004,7 @@  discard block
 block discarded – undo
1004 1004
 
1005 1005
 	private static function field_types_for_input( $inputs, $fields, &$field_types ) {
1006 1006
 		foreach ( $inputs as $input ) {
1007
-			$field_types[ $input ] = $fields[ $input ];
1007
+			$field_types[$input] = $fields[$input];
1008 1008
 			unset( $input );
1009 1009
 		}
1010 1010
 	}
@@ -1036,7 +1036,7 @@  discard block
 block discarded – undo
1036 1036
 			'parent'  => false,
1037 1037
 			'pointer' => false,
1038 1038
 		);
1039
-		$args     = wp_parse_args( $args, $defaults );
1039
+		$args = wp_parse_args( $args, $defaults );
1040 1040
 
1041 1041
 		$opt_key   = $args['opt_key'];
1042 1042
 		$field     = $args['field'];
@@ -1053,22 +1053,22 @@  discard block
 block discarded – undo
1053 1053
 		// Check posted vals before checking saved values
1054 1054
 
1055 1055
 		// For fields inside repeating sections - note, don't check if $pointer is true because it will often be zero
1056
-		if ( $parent && isset( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ] ) ) {
1056
+		if ( $parent && isset( $_POST['item_meta'][$parent][$pointer]['other'][$field['id']] ) ) {
1057 1057
 			if ( FrmField::is_field_with_multiple_values( $field ) ) {
1058
-				$other_val = isset( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ][ $opt_key ] ) ? sanitize_text_field( wp_unslash( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ][ $opt_key ] ) ) : '';
1058
+				$other_val = isset( $_POST['item_meta'][$parent][$pointer]['other'][$field['id']][$opt_key] ) ? sanitize_text_field( wp_unslash( $_POST['item_meta'][$parent][$pointer]['other'][$field['id']][$opt_key] ) ) : '';
1059 1059
 			} else {
1060
-				$other_val = sanitize_text_field( wp_unslash( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ] ) );
1060
+				$other_val = sanitize_text_field( wp_unslash( $_POST['item_meta'][$parent][$pointer]['other'][$field['id']] ) );
1061 1061
 			}
1062 1062
 
1063 1063
 			return $other_val;
1064 1064
 
1065
-		} elseif ( isset( $field['id'] ) && isset( $_POST['item_meta']['other'][ $field['id'] ] ) ) {
1065
+		} elseif ( isset( $field['id'] ) && isset( $_POST['item_meta']['other'][$field['id']] ) ) {
1066 1066
 			// For normal fields
1067 1067
 
1068 1068
 			if ( FrmField::is_field_with_multiple_values( $field ) ) {
1069
-				$other_val = isset( $_POST['item_meta']['other'][ $field['id'] ][ $opt_key ] ) ? sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][ $field['id'] ][ $opt_key ] ) ) : '';
1069
+				$other_val = isset( $_POST['item_meta']['other'][$field['id']][$opt_key] ) ? sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][$field['id']][$opt_key] ) ) : '';
1070 1070
 			} else {
1071
-				$other_val = sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][ $field['id'] ] ) );
1071
+				$other_val = sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][$field['id']] ) );
1072 1072
 			}
1073 1073
 
1074 1074
 			return $other_val;
@@ -1078,8 +1078,8 @@  discard block
 block discarded – undo
1078 1078
 		if ( $field['type'] == 'checkbox' && is_array( $field['value'] ) ) {
1079 1079
 			// Check if there is an "other" val in saved value and make sure the
1080 1080
 			// "other" val is not equal to the Other checkbox option
1081
-			if ( isset( $field['value'][ $opt_key ] ) && $field['options'][ $opt_key ] != $field['value'][ $opt_key ] ) {
1082
-				$other_val = $field['value'][ $opt_key ];
1081
+			if ( isset( $field['value'][$opt_key] ) && $field['options'][$opt_key] != $field['value'][$opt_key] ) {
1082
+				$other_val = $field['value'][$opt_key];
1083 1083
 			}
1084 1084
 		} else {
1085 1085
 			/**
@@ -1091,8 +1091,8 @@  discard block
 block discarded – undo
1091 1091
 				// Multi-select dropdowns - key is not preserved
1092 1092
 				if ( is_array( $field['value'] ) ) {
1093 1093
 					$o_key = array_search( $temp_val, $field['value'] );
1094
-					if ( isset( $field['value'][ $o_key ] ) ) {
1095
-						unset( $field['value'][ $o_key ], $o_key );
1094
+					if ( isset( $field['value'][$o_key] ) ) {
1095
+						unset( $field['value'][$o_key], $o_key );
1096 1096
 					}
1097 1097
 				} elseif ( $temp_val == $field['value'] ) {
1098 1098
 					// For radio and regular dropdowns
@@ -1279,7 +1279,7 @@  discard block
 block discarded – undo
1279 1279
 		}
1280 1280
 		if ( is_array( $val ) ) {
1281 1281
 			foreach ( $val as $k => $v ) {
1282
-				$val[ $k ] = str_replace( $replace, $replace_with, $v );
1282
+				$val[$k] = str_replace( $replace, $replace_with, $v );
1283 1283
 				unset( $k, $v );
1284 1284
 			}
1285 1285
 		} else {
@@ -1589,19 +1589,19 @@  discard block
 block discarded – undo
1589 1589
 	}
1590 1590
 
1591 1591
 	public static function get_bulk_prefilled_opts( array &$prepop ) {
1592
-		$prepop[ __( 'Countries', 'formidable' ) ] = self::get_countries();
1592
+		$prepop[__( 'Countries', 'formidable' )] = self::get_countries();
1593 1593
 
1594 1594
 		$states    = self::get_us_states();
1595 1595
 		$state_abv = array_keys( $states );
1596 1596
 		sort( $state_abv );
1597
-		$prepop[ __( 'U.S. State Abbreviations', 'formidable' ) ] = $state_abv;
1597
+		$prepop[__( 'U.S. State Abbreviations', 'formidable' )] = $state_abv;
1598 1598
 
1599 1599
 		$states = array_values( $states );
1600 1600
 		sort( $states );
1601
-		$prepop[ __( 'U.S. States', 'formidable' ) ] = $states;
1601
+		$prepop[__( 'U.S. States', 'formidable' )] = $states;
1602 1602
 		unset( $state_abv, $states );
1603 1603
 
1604
-		$prepop[ __( 'Age', 'formidable' ) ] = array(
1604
+		$prepop[__( 'Age', 'formidable' )] = array(
1605 1605
 			__( 'Under 18', 'formidable' ),
1606 1606
 			__( '18-24', 'formidable' ),
1607 1607
 			__( '25-34', 'formidable' ),
@@ -1612,7 +1612,7 @@  discard block
 block discarded – undo
1612 1612
 			__( 'Prefer Not to Answer', 'formidable' ),
1613 1613
 		);
1614 1614
 
1615
-		$prepop[ __( 'Satisfaction', 'formidable' ) ] = array(
1615
+		$prepop[__( 'Satisfaction', 'formidable' )] = array(
1616 1616
 			__( 'Very Satisfied', 'formidable' ),
1617 1617
 			__( 'Satisfied', 'formidable' ),
1618 1618
 			__( 'Neutral', 'formidable' ),
@@ -1621,7 +1621,7 @@  discard block
 block discarded – undo
1621 1621
 			__( 'N/A', 'formidable' ),
1622 1622
 		);
1623 1623
 
1624
-		$prepop[ __( 'Importance', 'formidable' ) ] = array(
1624
+		$prepop[__( 'Importance', 'formidable' )] = array(
1625 1625
 			__( 'Very Important', 'formidable' ),
1626 1626
 			__( 'Important', 'formidable' ),
1627 1627
 			__( 'Neutral', 'formidable' ),
@@ -1630,7 +1630,7 @@  discard block
 block discarded – undo
1630 1630
 			__( 'N/A', 'formidable' ),
1631 1631
 		);
1632 1632
 
1633
-		$prepop[ __( 'Agreement', 'formidable' ) ] = array(
1633
+		$prepop[__( 'Agreement', 'formidable' )] = array(
1634 1634
 			__( 'Strongly Agree', 'formidable' ),
1635 1635
 			__( 'Agree', 'formidable' ),
1636 1636
 			__( 'Neutral', 'formidable' ),
Please login to merge, or discard this patch.
classes/helpers/FrmFormsHelper.php 2 patches
Doc Comments   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -658,6 +658,9 @@  discard block
 block discarded – undo
658 658
 		$reset_fields = true;
659 659
 	}
660 660
 
661
+	/**
662
+	 * @return string
663
+	 */
661 664
 	public static function replace_shortcodes( $html, $form, $title = false, $description = false, $values = array() ) {
662 665
 		$codes = array(
663 666
 			'form_name'        => $title,
@@ -818,7 +821,7 @@  discard block
 block discarded – undo
818 821
 	}
819 822
 
820 823
 	/**
821
-	 * @param object|string|boolean $form
824
+	 * @param string|boolean $form
822 825
 	 *
823 826
 	 * @return string
824 827
 	 */
Please login to merge, or discard this patch.
Spacing   +21 added lines, -21 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
 
@@ -264,8 +264,8 @@  discard block
 block discarded – undo
264 264
 			'description' => '',
265 265
 		);
266 266
 		foreach ( $defaults as $var => $default ) {
267
-			if ( ! isset( $values[ $var ] ) ) {
268
-				$values[ $var ] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' );
267
+			if ( ! isset( $values[$var] ) ) {
268
+				$values[$var] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' );
269 269
 			}
270 270
 		}
271 271
 
@@ -280,8 +280,8 @@  discard block
 block discarded – undo
280 280
 			'parent_form_id' => 0,
281 281
 		);
282 282
 		foreach ( $defaults as $var => $default ) {
283
-			if ( ! isset( $values[ $var ] ) ) {
284
-				$values[ $var ] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' );
283
+			if ( ! isset( $values[$var] ) ) {
284
+				$values[$var] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' );
285 285
 			}
286 286
 		}
287 287
 		unset( $defaults );
@@ -318,16 +318,16 @@  discard block
 block discarded – undo
318 318
 		$defaults = self::get_default_opts();
319 319
 		foreach ( $defaults as $var => $default ) {
320 320
 			if ( is_array( $default ) ) {
321
-				if ( ! isset( $values[ $var ] ) ) {
322
-					$values[ $var ] = ( $record && isset( $record->options[ $var ] ) ) ? $record->options[ $var ] : array();
321
+				if ( ! isset( $values[$var] ) ) {
322
+					$values[$var] = ( $record && isset( $record->options[$var] ) ) ? $record->options[$var] : array();
323 323
 				}
324 324
 
325 325
 				foreach ( $default as $k => $v ) {
326
-					$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 );
326
+					$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 );
327 327
 
328 328
 					if ( is_array( $v ) ) {
329 329
 						foreach ( $v as $k1 => $v1 ) {
330
-							$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 );
330
+							$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 );
331 331
 							unset( $k1, $v1 );
332 332
 						}
333 333
 					}
@@ -335,7 +335,7 @@  discard block
 block discarded – undo
335 335
 					unset( $k, $v );
336 336
 				}
337 337
 			} else {
338
-				$values[ $var ] = ( $post_values && isset( $post_values['options'][ $var ] ) ) ? $post_values['options'][ $var ] : ( ( $record && isset( $record->options[ $var ] ) ) ? $record->options[ $var ] : $default );
338
+				$values[$var] = ( $post_values && isset( $post_values['options'][$var] ) ) ? $post_values['options'][$var] : ( ( $record && isset( $record->options[$var] ) ) ? $record->options[$var] : $default );
339 339
 			}
340 340
 
341 341
 			unset( $var, $default );
@@ -373,7 +373,7 @@  discard block
 block discarded – undo
373 373
 	public static function fill_form_options( &$options, $values ) {
374 374
 		$defaults = self::get_default_opts();
375 375
 		foreach ( $defaults as $var => $default ) {
376
-			$options[ $var ] = isset( $values['options'][ $var ] ) ? $values['options'][ $var ] : $default;
376
+			$options[$var] = isset( $values['options'][$var] ) ? $values['options'][$var] : $default;
377 377
 			unset( $var, $default );
378 378
 		}
379 379
 	}
@@ -529,7 +529,7 @@  discard block
 block discarded – undo
529 529
 	public static function insert_opt_html( $args ) {
530 530
 		$class  = isset( $args['class'] ) ? $args['class'] : '';
531 531
 		$fields = FrmField::all_field_selection();
532
-		$field  = isset( $fields[ $args['type'] ] ) ? $fields[ $args['type'] ] : array();
532
+		$field  = isset( $fields[$args['type']] ) ? $fields[$args['type']] : array();
533 533
 
534 534
 		self::prepare_field_type( $field );
535 535
 
@@ -681,7 +681,7 @@  discard block
 block discarded – undo
681 681
 			FrmField::update( $field->id, array( 'field_order' => $field->field_order + 2 ) );
682 682
 		}
683 683
 
684
-		$add_order    += 2;
684
+		$add_order += 2;
685 685
 		$open         = false;
686 686
 		$reset_fields = true;
687 687
 	}
@@ -1033,10 +1033,10 @@  discard block
 block discarded – undo
1033 1033
 				$link .= ' onclick="return confirm(\'' . esc_attr( $link_details['confirm'] ) . '\')"';
1034 1034
 			}
1035 1035
 
1036
-			$label = ( isset( $link_details[ $length ] ) ? $link_details[ $length ] : $link_details['label'] );
1037
-			if ( $length == 'icon' && isset( $link_details[ $length ] ) ) {
1036
+			$label = ( isset( $link_details[$length] ) ? $link_details[$length] : $link_details['label'] );
1037
+			if ( $length == 'icon' && isset( $link_details[$length] ) ) {
1038 1038
 				$label = '<span class="' . $label . '" title="' . esc_attr( $link_details['label'] ) . '" aria-hidden="true"></span>';
1039
-				$link  .= ' aria-label="' . esc_attr( $link_details['label'] ) . '"';
1039
+				$link .= ' aria-label="' . esc_attr( $link_details['label'] ) . '"';
1040 1040
 			}
1041 1041
 
1042 1042
 			$link .= '>' . $label . '</a>';
@@ -1184,7 +1184,7 @@  discard block
 block discarded – undo
1184 1184
 			$status = 'publish';
1185 1185
 		}
1186 1186
 
1187
-		$name = $nice_names[ $status ];
1187
+		$name = $nice_names[$status];
1188 1188
 
1189 1189
 		return $name;
1190 1190
 	}
@@ -1211,11 +1211,11 @@  discard block
 block discarded – undo
1211 1211
 			$icon = $icons[''];
1212 1212
 		} elseif ( count( $categories ) === 1 ) {
1213 1213
 			$category = reset( $categories );
1214
-			$icon     = $icons[ $category ];
1214
+			$icon     = $icons[$category];
1215 1215
 		} else {
1216 1216
 			foreach ( $icons as $cat => $icon ) {
1217 1217
 				if ( ! in_array( $cat, $categories ) ) {
1218
-					unset( $icons[ $cat ] );
1218
+					unset( $icons[$cat] );
1219 1219
 				}
1220 1220
 			}
1221 1221
 			$icon = reset( $icons );
@@ -1304,7 +1304,7 @@  discard block
 block discarded – undo
1304 1304
 
1305 1305
 		foreach ( $item['categories'] as $k => $category ) {
1306 1306
 			if ( in_array( $category, $plans ) ) {
1307
-				unset( $item['categories'][ $k ] );
1307
+				unset( $item['categories'][$k] );
1308 1308
 				return $category;
1309 1309
 			}
1310 1310
 		}
Please login to merge, or discard this patch.
classes/helpers/FrmListHelper.php 2 patches
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -278,6 +278,9 @@  discard block
 block discarded – undo
278 278
 		FrmAppHelper::show_search_box( compact( 'text', 'input_id' ) );
279 279
 	}
280 280
 
281
+	/**
282
+	 * @param string $param_name
283
+	 */
281 284
 	private function hidden_search_inputs( $param_name ) {
282 285
 		if ( ! empty( $_REQUEST[ $param_name ] ) ) {
283 286
 			$value = sanitize_text_field( wp_unslash( $_REQUEST[ $param_name ] ) );
@@ -418,6 +421,9 @@  discard block
 block discarded – undo
418 421
 		return $action;
419 422
 	}
420 423
 
424
+	/**
425
+	 * @param string $action_name
426
+	 */
421 427
 	private static function get_bulk_action( $action_name ) {
422 428
 		$action       = false;
423 429
 		$action_param = self::get_param(
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -230,8 +230,8 @@  discard block
 block discarded – undo
230 230
 			return $this->get_pagenum();
231 231
 		}
232 232
 
233
-		if ( isset( $this->_pagination_args[ $key ] ) ) {
234
-			return $this->_pagination_args[ $key ];
233
+		if ( isset( $this->_pagination_args[$key] ) ) {
234
+			return $this->_pagination_args[$key];
235 235
 		}
236 236
 	}
237 237
 
@@ -279,8 +279,8 @@  discard block
 block discarded – undo
279 279
 	}
280 280
 
281 281
 	private function hidden_search_inputs( $param_name ) {
282
-		if ( ! empty( $_REQUEST[ $param_name ] ) ) {
283
-			$value = sanitize_text_field( wp_unslash( $_REQUEST[ $param_name ] ) );
282
+		if ( ! empty( $_REQUEST[$param_name] ) ) {
283
+			$value = sanitize_text_field( wp_unslash( $_REQUEST[$param_name] ) );
284 284
 			echo '<input type="hidden" name="' . esc_attr( $param_name ) . '" value="' . esc_attr( $value ) . '" />';
285 285
 		}
286 286
 	}
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
 
325 325
 		echo "<ul class='subsubsub'>\n";
326 326
 		foreach ( $views as $class => $view ) {
327
-			$views[ $class ] = "\t" . '<li class="' . esc_attr( $class ) . '">' . $view;
327
+			$views[$class] = "\t" . '<li class="' . esc_attr( $class ) . '">' . $view;
328 328
 		}
329 329
 		echo implode( " |</li>\n", $views ) . "</li>\n"; // WPCS: XSS ok.
330 330
 		echo '</ul>';
@@ -682,7 +682,7 @@  discard block
 block discarded – undo
682 682
 			'next'  => __( 'Next page', 'formidable' ),
683 683
 		);
684 684
 
685
-		return $labels[ $link ];
685
+		return $labels[$link];
686 686
 	}
687 687
 
688 688
 	private function current_url() {
@@ -775,7 +775,7 @@  discard block
 block discarded – undo
775 775
 
776 776
 		// If the primary column doesn't exist fall back to the
777 777
 		// first non-checkbox column.
778
-		if ( ! isset( $columns[ $default ] ) ) {
778
+		if ( ! isset( $columns[$default] ) ) {
779 779
 			$default = self::get_default_primary_column_name();
780 780
 		}
781 781
 
@@ -789,7 +789,7 @@  discard block
 block discarded – undo
789 789
 		 */
790 790
 		$column = apply_filters( 'list_table_primary_column', $default, $this->screen->id );
791 791
 
792
-		if ( empty( $column ) || ! isset( $columns[ $column ] ) ) {
792
+		if ( empty( $column ) || ! isset( $columns[$column] ) ) {
793 793
 			$column = $default;
794 794
 		}
795 795
 
@@ -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();
@@ -921,8 +921,8 @@  discard block
 block discarded – undo
921 921
 				$class[] = 'column-primary';
922 922
 			}
923 923
 
924
-			if ( isset( $sortable[ $column_key ] ) ) {
925
-				list( $orderby, $desc_first ) = $sortable[ $column_key ];
924
+			if ( isset( $sortable[$column_key] ) ) {
925
+				list( $orderby, $desc_first ) = $sortable[$column_key];
926 926
 
927 927
 				if ( $current_orderby == $orderby ) {
928 928
 					$order   = 'asc' == $current_order ? 'desc' : 'asc';
Please login to merge, or discard this patch.
classes/helpers/FrmStylesHelper.php 2 patches
Doc Comments   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
 
183 183
 	/**
184 184
 	 * @since 2.0
185
-	 * @return The class for this icon
185
+	 * @return string class for this icon
186 186
 	 */
187 187
 	public static function icon_key_to_class( $key, $icon = '+', $type = 'arrow' ) {
188 188
 		if ( 'arrow' == $type && is_numeric( $key ) ) {
@@ -379,6 +379,7 @@  discard block
 block discarded – undo
379 379
 
380 380
 	/**
381 381
 	 * @since 2.3
382
+	 * @param string $default
382 383
 	 */
383 384
 	private static function get_color_output( $default, &$color ) {
384 385
 		$color = trim( $color );
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
 				'-' => 'down',
192 192
 				'+' => 'up',
193 193
 			);
194
-			$class = 'frm_arrow' . $arrow[ $icon ];
194
+			$class = 'frm_arrow' . $arrow[$icon];
195 195
 		} else {
196 196
 			//frm_minus1_icon
197 197
 			$key   = str_replace( 'p', '', $key );
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
 				'-' => 'minus',
200 200
 				'+' => 'plus',
201 201
 			);
202
-			$class = 'frm_' . $plus[ $icon ];
202
+			$class = 'frm_' . $plus[$icon];
203 203
 		}
204 204
 
205 205
 		if ( $key ) {
@@ -219,8 +219,8 @@  discard block
 block discarded – undo
219 219
 		?>
220 220
 		<div class="btn-group" id="frm_<?php echo esc_attr( $name ); ?>_select">
221 221
 			<button class="multiselect dropdown-toggle btn btn-default" data-toggle="dropdown" type="button">
222
-				<?php FrmAppHelper::icon_by_class( 'frmfont ' . self::icon_key_to_class( $style->post_content[ $name ], '+', $type ) ); ?>
223
-				<?php FrmAppHelper::icon_by_class( 'frmfont ' . self::icon_key_to_class( $style->post_content[ $name ], '-', $type ) ); ?>
222
+				<?php FrmAppHelper::icon_by_class( 'frmfont ' . self::icon_key_to_class( $style->post_content[$name], '+', $type ) ); ?>
223
+				<?php FrmAppHelper::icon_by_class( 'frmfont ' . self::icon_key_to_class( $style->post_content[$name], '-', $type ) ); ?>
224 224
 				<b class="caret"></b>
225 225
 			</button>
226 226
 			<ul class="multiselect-container frm-dropdown-menu">
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
 					<li <?php echo ( $style->post_content['collapse_icon'] == $key ) ? 'class="active"' : ''; ?>>
229 229
 						<a href="javascript:void(0);">
230 230
 							<label>
231
-								<input type="radio" value="<?php echo esc_attr( $key ); ?>" name="<?php echo esc_attr( $frm_style->get_field_name( $name ) ); ?>" <?php checked( $style->post_content[ $name ], $key ); ?>/>
231
+								<input type="radio" value="<?php echo esc_attr( $key ); ?>" name="<?php echo esc_attr( $frm_style->get_field_name( $name ) ); ?>" <?php checked( $style->post_content[$name], $key ); ?>/>
232 232
 								<span>
233 233
 									<?php FrmAppHelper::icon_by_class( 'frmfont ' . self::icon_key_to_class( $key, '+', $type ) ); ?>
234 234
 									<?php FrmAppHelper::icon_by_class( 'frmfont ' . self::icon_key_to_class( $key, '-', $type ) ); ?>
@@ -313,14 +313,14 @@  discard block
 block discarded – undo
313 313
 			$settings['style_class'] = 'frm_style_' . $style->post_name . '.';
314 314
 		}
315 315
 
316
-		$settings['style_class']   .= 'with_frm_style';
316
+		$settings['style_class'] .= 'with_frm_style';
317 317
 		$settings['font']          = stripslashes( $settings['font'] );
318 318
 		$settings['change_margin'] = self::description_margin_for_screensize( $settings['width'] );
319 319
 
320 320
 		$checkbox_opts = array( 'important_style', 'auto_width', 'submit_style', 'collapse_icon', 'center_form' );
321 321
 		foreach ( $checkbox_opts as $opt ) {
322
-			if ( ! isset( $settings[ $opt ] ) ) {
323
-				$settings[ $opt ] = 0;
322
+			if ( ! isset( $settings[$opt] ) ) {
323
+				$settings[$opt] = 0;
324 324
 			}
325 325
 		}
326 326
 
@@ -339,7 +339,7 @@  discard block
 block discarded – undo
339 339
 				$css = '';
340 340
 			}
341 341
 			foreach ( $opts as $opt ) {
342
-				self::get_color_output( $css, $settings[ $opt ] );
342
+				self::get_color_output( $css, $settings[$opt] );
343 343
 			}
344 344
 		}
345 345
 	}
Please login to merge, or discard this patch.
classes/models/FrmDb.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -166,7 +166,7 @@
 block discarded – undo
166 166
 	 * @since 2.02.05
167 167
 	 *
168 168
 	 * @param string $key
169
-	 * @param int|string $value
169
+	 * @param string $value
170 170
 	 * @param string $where
171 171
 	 */
172 172
 	private static function add_query_placeholder( $key, $value, &$where ) {
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 		}
62 62
 
63 63
 		foreach ( $args as $key => $value ) {
64
-			$where          .= empty( $where ) ? $base_where : $condition;
64
+			$where .= empty( $where ) ? $base_where : $condition;
65 65
 			$array_inc_null = ( ! is_numeric( $key ) && is_array( $value ) && in_array( null, $value ) );
66 66
 			if ( is_numeric( $key ) || $array_inc_null ) {
67 67
 				$where        .= ' ( ';
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 
97 97
 		if ( strpos( $key, 'created_at' ) !== false || strpos( $key, 'updated_at' ) !== false ) {
98 98
 			$k        = explode( ' ', $key );
99
-			$where    .= ' DATE_FORMAT(' . reset( $k ) . ', %s) ' . str_replace( reset( $k ), '', $key );
99
+			$where .= ' DATE_FORMAT(' . reset( $k ) . ', %s) ' . str_replace( reset( $k ), '', $key );
100 100
 			$values[] = '%Y-%m-%d %H:%i:%s';
101 101
 		} else {
102 102
 			$where .= ' ' . $key;
@@ -116,12 +116,12 @@  discard block
 block discarded – undo
116 116
 						$where .= ' OR ';
117 117
 					}
118 118
 					$start    = false;
119
-					$where    .= $key . ' %s';
119
+					$where .= $key . ' %s';
120 120
 					$values[] = '%' . self::esc_like( $v ) . '%';
121 121
 				}
122 122
 				$where .= ')';
123 123
 			} elseif ( ! empty( $value ) ) {
124
-				$where  .= ' in (' . self::prepare_array_values( $value, '%s' ) . ')';
124
+				$where .= ' in (' . self::prepare_array_values( $value, '%s' ) . ')';
125 125
 				$values = array_merge( $values, $value );
126 126
 			}
127 127
 		} elseif ( strpos( $lowercase_key, 'like' ) !== false ) {
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
 				$where .= 'like';
142 142
 			}
143 143
 
144
-			$where    .= ' %s';
144
+			$where .= ' %s';
145 145
 			$values[] = $start . self::esc_like( $value ) . $end;
146 146
 
147 147
 		} 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 <=
@@ -360,13 +360,13 @@  discard block
 block discarded – undo
360 360
 		$temp_args = $args;
361 361
 		foreach ( $temp_args as $k => $v ) {
362 362
 			if ( $v == '' ) {
363
-				unset( $args[ $k ] );
363
+				unset( $args[$k] );
364 364
 				continue;
365 365
 			}
366 366
 
367 367
 			$db_name = strtoupper( str_replace( '_', ' ', $k ) );
368 368
 			if ( strpos( $v, $db_name ) === false ) {
369
-				$args[ $k ] = $db_name . ' ' . $v;
369
+				$args[$k] = $db_name . ' ' . $v;
370 370
 			}
371 371
 		}
372 372
 
@@ -440,13 +440,13 @@  discard block
 block discarded – undo
440 440
 	private static function esc_query_args( &$args ) {
441 441
 		foreach ( $args as $param => $value ) {
442 442
 			if ( $param == 'order_by' ) {
443
-				$args[ $param ] = self::esc_order( $value );
443
+				$args[$param] = self::esc_order( $value );
444 444
 			} elseif ( $param == 'limit' ) {
445
-				$args[ $param ] = self::esc_limit( $value );
445
+				$args[$param] = self::esc_limit( $value );
446 446
 			}
447 447
 
448
-			if ( $args[ $param ] == '' ) {
449
-				unset( $args[ $param ] );
448
+			if ( $args[$param] == '' ) {
449
+				unset( $args[$param] );
450 450
 			}
451 451
 		}
452 452
 	}
@@ -529,7 +529,7 @@  discard block
 block discarded – undo
529 529
 		$limit = explode( ',', trim( $limit ) );
530 530
 		foreach ( $limit as $k => $l ) {
531 531
 			if ( is_numeric( $l ) ) {
532
-				$limit[ $k ] = $l;
532
+				$limit[$k] = $l;
533 533
 			}
534 534
 		}
535 535
 
@@ -665,7 +665,7 @@  discard block
 block discarded – undo
665 665
 	 */
666 666
 	public static function add_key_to_group_cache( $key, $group ) {
667 667
 		$cached         = self::get_group_cached_keys( $group );
668
-		$cached[ $key ] = $key;
668
+		$cached[$key] = $key;
669 669
 		wp_cache_set( 'cached_keys', $cached, $group, 300 );
670 670
 	}
671 671
 
Please login to merge, or discard this patch.
classes/models/FrmEntry.php 2 patches
Doc Comments   +4 added lines patch added patch discarded remove patch
@@ -202,6 +202,7 @@  discard block
 block discarded – undo
202 202
 	 *
203 203
 	 * @param int $id
204 204
 	 * @param array $values
205
+	 * @param string $update_type
205 206
 	 *
206 207
 	 * @return boolean|int $query_results
207 208
 	 */
@@ -612,6 +613,9 @@  discard block
 block discarded – undo
612 613
 		return $new_values;
613 614
 	}
614 615
 
616
+	/**
617
+	 * @param string $name
618
+	 */
615 619
 	private static function get_entry_value( $values, $name, $default ) {
616 620
 		return isset( $values[ $name ] ) ? $values[ $name ] : $default;
617 621
 	}
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 			$metas       = FrmEntryMeta::get_entry_meta_info( $entry_exist );
77 77
 			$field_metas = array();
78 78
 			foreach ( $metas as $meta ) {
79
-				$field_metas[ $meta->field_id ] = $meta->meta_value;
79
+				$field_metas[$meta->field_id] = $meta->meta_value;
80 80
 			}
81 81
 
82 82
 			// If prev entry is empty and current entry is not, they are not duplicates
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
 		$query = "SELECT it.*, fr.name as form_name, fr.form_key as form_key FROM {$wpdb->prefix}frm_items it
304 304
                   LEFT OUTER JOIN {$wpdb->prefix}frm_forms fr ON it.form_id=fr.id WHERE ";
305 305
 
306
-		$query      .= is_numeric( $id ) ? 'it.id=%d' : 'it.item_key=%s';
306
+		$query .= is_numeric( $id ) ? 'it.id=%d' : 'it.item_key=%s';
307 307
 		$query_args = array( $id );
308 308
 		$query      = $wpdb->prepare( $query, $query_args ); // WPCS: unprepared SQL ok.
309 309
 
@@ -348,7 +348,7 @@  discard block
 block discarded – undo
348 348
 	private static function prepare_entries( &$entries ) {
349 349
 		foreach ( $entries as $k => $entry ) {
350 350
 			self::prepare_entry( $entry );
351
-			$entries[ $k ] = $entry;
351
+			$entries[$k] = $entry;
352 352
 		}
353 353
 	}
354 354
 
@@ -373,20 +373,20 @@  discard block
 block discarded – undo
373 373
 		foreach ( $metas as $meta_val ) {
374 374
 			if ( $meta_val->item_id == $entry->id ) {
375 375
 				FrmAppHelper::unserialize_or_decode( $meta_val->meta_value );
376
-				$entry->metas[ $meta_val->field_id ] = $meta_val->meta_value;
376
+				$entry->metas[$meta_val->field_id] = $meta_val->meta_value;
377 377
 				if ( $include_key ) {
378
-					$entry->metas[ $meta_val->field_key ] = $entry->metas[ $meta_val->field_id ];
378
+					$entry->metas[$meta_val->field_key] = $entry->metas[$meta_val->field_id];
379 379
 				}
380 380
 				continue;
381 381
 			}
382 382
 
383 383
 			// include sub entries in an array
384
-			if ( ! isset( $entry_metas[ $meta_val->field_id ] ) ) {
385
-				$entry->metas[ $meta_val->field_id ] = array();
384
+			if ( ! isset( $entry_metas[$meta_val->field_id] ) ) {
385
+				$entry->metas[$meta_val->field_id] = array();
386 386
 			}
387 387
 
388 388
 			FrmAppHelper::unserialize_or_decode( $meta_val->meta_value );
389
-			$entry->metas[ $meta_val->field_id ][] = $meta_val->meta_value;
389
+			$entry->metas[$meta_val->field_id][] = $meta_val->meta_value;
390 390
 
391 391
 			unset( $meta_val );
392 392
 		}
@@ -433,13 +433,13 @@  discard block
 block discarded – undo
433 433
 
434 434
 			if ( $inc_form ) {
435 435
 				$fields = 'it.*, fr.name as form_name,fr.form_key as form_key';
436
-				$table  .= 'LEFT OUTER JOIN ' . $wpdb->prefix . 'frm_forms fr ON it.form_id=fr.id ';
436
+				$table .= 'LEFT OUTER JOIN ' . $wpdb->prefix . 'frm_forms fr ON it.form_id=fr.id ';
437 437
 			}
438 438
 
439 439
 			if ( preg_match( '/ meta_([0-9]+)/', $order_by, $order_matches ) ) {
440 440
 				// sort by a requested field
441 441
 				$field_id = (int) $order_matches[1];
442
-				$fields   .= ', (SELECT meta_value FROM ' . $wpdb->prefix . 'frm_item_metas WHERE field_id = ' . $field_id . ' AND item_id = it.id) as meta_' . $field_id;
442
+				$fields .= ', (SELECT meta_value FROM ' . $wpdb->prefix . 'frm_item_metas WHERE field_id = ' . $field_id . ' AND item_id = it.id) as meta_' . $field_id;
443 443
 				unset( $order_matches, $field_id );
444 444
 			}
445 445
 
@@ -479,16 +479,16 @@  discard block
 block discarded – undo
479 479
 		}
480 480
 
481 481
 		foreach ( $metas as $m_key => $meta_val ) {
482
-			if ( ! isset( $entries[ $meta_val->item_id ] ) ) {
482
+			if ( ! isset( $entries[$meta_val->item_id] ) ) {
483 483
 				continue;
484 484
 			}
485 485
 
486
-			if ( ! isset( $entries[ $meta_val->item_id ]->metas ) ) {
487
-				$entries[ $meta_val->item_id ]->metas = array();
486
+			if ( ! isset( $entries[$meta_val->item_id]->metas ) ) {
487
+				$entries[$meta_val->item_id]->metas = array();
488 488
 			}
489 489
 
490 490
 			FrmAppHelper::unserialize_or_decode( $meta_val->meta_value );
491
-			$entries[ $meta_val->item_id ]->metas[ $meta_val->field_id ] = $meta_val->meta_value;
491
+			$entries[$meta_val->item_id]->metas[$meta_val->field_id] = $meta_val->meta_value;
492 492
 			unset( $m_key, $meta_val );
493 493
 		}
494 494
 
@@ -646,7 +646,7 @@  discard block
 block discarded – undo
646 646
 	}
647 647
 
648 648
 	private static function get_entry_value( $values, $name, $default ) {
649
-		return isset( $values[ $name ] ) ? $values[ $name ] : $default;
649
+		return isset( $values[$name] ) ? $values[$name] : $default;
650 650
 	}
651 651
 
652 652
 	/**
Please login to merge, or discard this patch.