Completed
Pull Request — master (#112)
by Stephanie
03:20
created
classes/controllers/FrmFormsController.php 2 patches
Doc Comments   +8 added lines patch added patch discarded remove patch
@@ -1126,6 +1126,7 @@  discard block
 block discarded – undo
1126 1126
 	 * Get an array of the helper shortcodes to display in the customization panel
1127 1127
 	 *
1128 1128
 	 * @since 2.0.6
1129
+	 * @param boolean $settings_tab
1129 1130
 	 */
1130 1131
 	private static function get_shortcode_helpers( $settings_tab ) {
1131 1132
 		$entry_shortcodes = array(
@@ -1204,6 +1205,9 @@  discard block
 block discarded – undo
1204 1205
 		return $content;
1205 1206
 	}
1206 1207
 
1208
+	/**
1209
+	 * @param boolean $entry
1210
+	 */
1207 1211
 	private static function get_entry_by_param( &$entry ) {
1208 1212
 		if ( ! $entry || ! is_object( $entry ) ) {
1209 1213
 			if ( ! $entry || ! is_numeric( $entry ) ) {
@@ -1498,6 +1502,9 @@  discard block
 block discarded – undo
1498 1502
 		return $form;
1499 1503
 	}
1500 1504
 
1505
+	/**
1506
+	 * @param string $id
1507
+	 */
1501 1508
 	private static function maybe_get_form_to_show( $id ) {
1502 1509
 		$form = false;
1503 1510
 
@@ -1921,6 +1928,7 @@  discard block
 block discarded – undo
1921 1928
 
1922 1929
 	/**
1923 1930
 	 * @since 2.0.8
1931
+	 * @param string $content
1924 1932
 	 */
1925 1933
 	private static function maybe_minimize_form( $atts, &$content ) {
1926 1934
 		// check if minimizing is turned on
Please login to merge, or discard this patch.
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -409,11 +409,11 @@  discard block
 block discarded – undo
409 409
 			),
410 410
 		);
411 411
 
412
-		if ( ! isset( $available_status[ $status ] ) ) {
412
+		if ( ! isset( $available_status[$status] ) ) {
413 413
 			return;
414 414
 		}
415 415
 
416
-		FrmAppHelper::permission_check( $available_status[ $status ]['permission'] );
416
+		FrmAppHelper::permission_check( $available_status[$status]['permission'] );
417 417
 
418 418
 		$params = FrmForm::list_page_params();
419 419
 
@@ -421,7 +421,7 @@  discard block
 block discarded – undo
421 421
 		check_admin_referer( $status . '_form_' . $params['id'] );
422 422
 
423 423
 		$count = 0;
424
-		if ( FrmForm::set_status( $params['id'], $available_status[ $status ]['new_status'] ) ) {
424
+		if ( FrmForm::set_status( $params['id'], $available_status[$status]['new_status'] ) ) {
425 425
 			$count ++;
426 426
 		}
427 427
 
@@ -438,7 +438,7 @@  discard block
 block discarded – undo
438 438
 		/* translators: %1$s: Number of forms, %2$s: Start link HTML, %3$s: End link HTML */
439 439
 		$available_status['trash']['message']   = sprintf( _n( '%1$s form moved to the Trash. %2$sUndo%3$s', '%1$s forms moved to the Trash. %2$sUndo%3$s', $count, 'formidable' ), $count, '<a href="' . esc_url( wp_nonce_url( '?page=formidable&frm_action=untrash&form_type=' . $form_type . '&id=' . $params['id'], 'untrash_form_' . $params['id'] ) ) . '">', '</a>' );
440 440
 
441
-		$message = $available_status[ $status ]['message'];
441
+		$message = $available_status[$status]['message'];
442 442
 
443 443
 		self::display_forms_list( $params, $message );
444 444
 	}
@@ -459,7 +459,7 @@  discard block
 block discarded – undo
459 459
 				'type'  => 'request',
460 460
 			)
461 461
 		);
462
-		$message      = sprintf(
462
+		$message = sprintf(
463 463
 			/* translators: %1$s: Number of forms, %2$s: Start link HTML, %3$s: End link HTML */
464 464
 			_n( '%1$s form moved to the Trash. %2$sUndo%3$s', '%1$s forms moved to the Trash. %2$sUndo%3$s', $count, 'formidable' ),
465 465
 			$count,
@@ -976,7 +976,7 @@  discard block
 block discarded – undo
976 976
 				$section['id'] = $section['anchor'];
977 977
 			}
978 978
 
979
-			$sections[ $key ] = $section;
979
+			$sections[$key] = $section;
980 980
 		}
981 981
 
982 982
 		return $sections;
@@ -1055,7 +1055,7 @@  discard block
 block discarded – undo
1055 1055
 		if ( ! empty( $user_fields ) ) {
1056 1056
 			$user_helpers = array();
1057 1057
 			foreach ( $user_fields as $uk => $uf ) {
1058
-				$user_helpers[ '|user_id| show="' . $uk . '"' ] = $uf;
1058
+				$user_helpers['|user_id| show="' . $uk . '"'] = $uf;
1059 1059
 				unset( $uk, $uf );
1060 1060
 			}
1061 1061
 
@@ -1288,7 +1288,7 @@  discard block
 block discarded – undo
1288 1288
 				add_filter( 'frm_validate_form', 'FrmFormsController::json_error' );
1289 1289
 			} else {
1290 1290
 				$vars   = FrmAppHelper::json_to_array( $json_vars );
1291
-				$action = $vars[ $action ];
1291
+				$action = $vars[$action];
1292 1292
 				unset( $_REQUEST['frm_compact_fields'], $_POST['frm_compact_fields'] );
1293 1293
 				$_REQUEST = array_merge( $_REQUEST, $vars );
1294 1294
 				$_POST    = array_merge( $_POST, $_REQUEST );
@@ -1367,7 +1367,7 @@  discard block
 block discarded – undo
1367 1367
 		$actions = array();
1368 1368
 		foreach ( $frm_vars['forms_loaded'] as $form ) {
1369 1369
 			if ( is_object( $form ) ) {
1370
-				$actions[ $form->id ] = $form->name;
1370
+				$actions[$form->id] = $form->name;
1371 1371
 			}
1372 1372
 			unset( $form );
1373 1373
 		}
@@ -1594,8 +1594,8 @@  discard block
 block discarded – undo
1594 1594
 	private static function get_saved_errors( $form, $params ) {
1595 1595
 		global $frm_vars;
1596 1596
 
1597
-		if ( $params['posted_form_id'] == $form->id && $_POST && isset( $frm_vars['created_entries'][ $form->id ] ) ) {
1598
-			$errors = $frm_vars['created_entries'][ $form->id ]['errors'];
1597
+		if ( $params['posted_form_id'] == $form->id && $_POST && isset( $frm_vars['created_entries'][$form->id] ) ) {
1598
+			$errors = $frm_vars['created_entries'][$form->id]['errors'];
1599 1599
 		} else {
1600 1600
 			$errors = array();
1601 1601
 		}
@@ -1609,7 +1609,7 @@  discard block
 block discarded – undo
1609 1609
 	public static function just_created_entry( $form_id ) {
1610 1610
 		global $frm_vars;
1611 1611
 
1612
-		return ( isset( $frm_vars['created_entries'] ) && isset( $frm_vars['created_entries'][ $form_id ] ) && isset( $frm_vars['created_entries'][ $form_id ]['entry_id'] ) ) ? $frm_vars['created_entries'][ $form_id ]['entry_id'] : 0;
1612
+		return ( isset( $frm_vars['created_entries'] ) && isset( $frm_vars['created_entries'][$form_id] ) && isset( $frm_vars['created_entries'][$form_id]['entry_id'] ) ) ? $frm_vars['created_entries'][$form_id]['entry_id'] : 0;
1613 1613
 	}
1614 1614
 
1615 1615
 	/**
@@ -1617,7 +1617,7 @@  discard block
 block discarded – undo
1617 1617
 	 */
1618 1618
 	private static function get_confirmation_method( $atts ) {
1619 1619
 		$opt    = 'success_action';
1620
-		$method = ( isset( $atts['form']->options[ $opt ] ) && ! empty( $atts['form']->options[ $opt ] ) ) ? $atts['form']->options[ $opt ] : 'message';
1620
+		$method = ( isset( $atts['form']->options[$opt] ) && ! empty( $atts['form']->options[$opt] ) ) ? $atts['form']->options[$opt] : 'message';
1621 1621
 		$method = apply_filters( 'frm_success_filter', $method, $atts['form'], 'create' );
1622 1622
 
1623 1623
 		if ( $method != 'message' && ( ! $atts['entry_id'] || ! is_numeric( $atts['entry_id'] ) ) ) {
@@ -1630,7 +1630,7 @@  discard block
 block discarded – undo
1630 1630
 	public static function maybe_trigger_redirect( $form, $params, $args ) {
1631 1631
 		if ( ! isset( $params['id'] ) ) {
1632 1632
 			global $frm_vars;
1633
-			$params['id'] = $frm_vars['created_entries'][ $form->id ]['entry_id'];
1633
+			$params['id'] = $frm_vars['created_entries'][$form->id]['entry_id'];
1634 1634
 		}
1635 1635
 
1636 1636
 		$conf_method = self::get_confirmation_method(
@@ -1674,7 +1674,7 @@  discard block
 block discarded – undo
1674 1674
 		$opt = ( ! isset( $args['action'] ) || $args['action'] == 'create' ) ? 'success' : 'edit';
1675 1675
 
1676 1676
 		$args['success_opt'] = $opt;
1677
-		if ( $args['conf_method'] == 'page' && is_numeric( $args['form']->options[ $opt . '_page_id' ] ) ) {
1677
+		if ( $args['conf_method'] == 'page' && is_numeric( $args['form']->options[$opt . '_page_id'] ) ) {
1678 1678
 			self::load_page_after_submit( $args );
1679 1679
 		} elseif ( $args['conf_method'] == 'redirect' ) {
1680 1680
 			self::redirect_after_submit( $args );
@@ -1689,8 +1689,8 @@  discard block
 block discarded – undo
1689 1689
 	private static function load_page_after_submit( $args ) {
1690 1690
 		global $post;
1691 1691
 		$opt = $args['success_opt'];
1692
-		if ( ! $post || $args['form']->options[ $opt . '_page_id' ] != $post->ID ) {
1693
-			$page     = get_post( $args['form']->options[ $opt . '_page_id' ] );
1692
+		if ( ! $post || $args['form']->options[$opt . '_page_id'] != $post->ID ) {
1693
+			$page     = get_post( $args['form']->options[$opt . '_page_id'] );
1694 1694
 			$old_post = $post;
1695 1695
 			$post     = $page;
1696 1696
 			$content  = apply_filters( 'frm_content', $page->post_content, $args['form'], $args['entry_id'] );
@@ -1708,11 +1708,11 @@  discard block
 block discarded – undo
1708 1708
 		add_filter( 'frm_use_wpautop', '__return_false' );
1709 1709
 
1710 1710
 		$opt         = $args['success_opt'];
1711
-		$success_url = trim( $args['form']->options[ $opt . '_url' ] );
1711
+		$success_url = trim( $args['form']->options[$opt . '_url'] );
1712 1712
 		$success_url = apply_filters( 'frm_content', $success_url, $args['form'], $args['entry_id'] );
1713 1713
 		$success_url = do_shortcode( $success_url );
1714 1714
 
1715
-		$success_msg = isset( $args['form']->options[ $opt . '_msg' ] ) ? $args['form']->options[ $opt . '_msg' ] : __( 'Please wait while you are redirected.', 'formidable' );
1715
+		$success_msg = isset( $args['form']->options[$opt . '_msg'] ) ? $args['form']->options[$opt . '_msg'] : __( 'Please wait while you are redirected.', 'formidable' );
1716 1716
 
1717 1717
 		$redirect_msg = self::get_redirect_message( $success_url, $success_msg, $args );
1718 1718
 
@@ -1819,7 +1819,7 @@  discard block
 block discarded – undo
1819 1819
 			'description' => false,
1820 1820
 			'reset'       => false,
1821 1821
 		);
1822
-		$args     = wp_parse_args( $args, $defaults );
1822
+		$args = wp_parse_args( $args, $defaults );
1823 1823
 	}
1824 1824
 
1825 1825
 	/**
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
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
 		$export_format = apply_filters( 'frm_export_formats', $export_format );
194 194
 
195 195
 		$file_type = strtolower( pathinfo( wp_unslash( $_FILES['frm_import_file']['name'], PATHINFO_EXTENSION ) ) );
196
-		if ( 'xml' !== $file_type && isset( $export_format[ $file_type ] ) ) {
196
+		if ( 'xml' !== $file_type && isset( $export_format[$file_type] ) ) {
197 197
 			// allow other file types to be imported
198 198
 			do_action( 'frm_before_import_' . $file_type );
199 199
 
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
 		foreach ( $type as $tb_type ) {
277 277
 			$where = array();
278 278
 			$join  = '';
279
-			$table = $tables[ $tb_type ];
279
+			$table = $tables[$tb_type];
280 280
 
281 281
 			$select     = $table . '.id';
282 282
 			$query_vars = array();
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
 							$table . '.parent_form_id' => $args['ids'],
292 292
 						);
293 293
 					} else {
294
-						$where[ $table . '.status !' ] = 'draft';
294
+						$where[$table . '.status !'] = 'draft';
295 295
 					}
296 296
 					break;
297 297
 				case 'actions':
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
 				case 'items':
305 305
 					// $join = "INNER JOIN {$wpdb->prefix}frm_item_metas im ON ($table.id = im.item_id)";
306 306
 					if ( $args['ids'] ) {
307
-						$where[ $table . '.form_id' ] = $args['ids'];
307
+						$where[$table . '.form_id'] = $args['ids'];
308 308
 					}
309 309
 					break;
310 310
 				case 'styles':
@@ -345,7 +345,7 @@  discard block
 block discarded – undo
345 345
 					}
346 346
 			}
347 347
 
348
-			$records[ $tb_type ] = FrmDb::get_col( $table . $join, $where, $select );
348
+			$records[$tb_type] = FrmDb::get_col( $table . $join, $where, $select );
349 349
 			unset( $tb_type );
350 350
 		}
351 351
 
@@ -490,7 +490,7 @@  discard block
 block discarded – undo
490 490
 		$no_export_fields = FrmField::no_save_fields();
491 491
 		foreach ( $csv_fields as $k => $f ) {
492 492
 			if ( in_array( $f->type, $no_export_fields ) ) {
493
-				unset( $csv_fields[ $k ] );
493
+				unset( $csv_fields[$k] );
494 494
 			}
495 495
 		}
496 496
 
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   +35 added lines, -35 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,16 +180,16 @@  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.
189
-			$value = maybe_unserialize( wp_unslash( $_POST['field_options'][ $setting ] ) );
189
+			$value = maybe_unserialize( wp_unslash( $_POST['field_options'][$setting] ) );
190 190
 		} else {
191 191
 			// TODO: Remove stripslashes on output, and use on input only.
192
-			$value = maybe_unserialize( $_POST['field_options'][ $setting ] ); // WPCS: sanitization ok.
192
+			$value = maybe_unserialize( $_POST['field_options'][$setting] ); // WPCS: sanitization ok.
193 193
 		}
194 194
 	}
195 195
 
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
 		$values['default_value'] = maybe_serialize( $field->default_value );
262 262
 
263 263
 		foreach ( array( 'name', 'description', 'type', 'field_order', 'field_options', 'required' ) as $col ) {
264
-			$values[ $col ] = $field->{$col};
264
+			$values[$col] = $field->{$col};
265 265
 		}
266 266
 	}
267 267
 
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
 		);
302 302
 
303 303
 		$msg = FrmField::get_option( $field, $error );
304
-		$msg = empty( $msg ) ? $defaults[ $error ]['part'] : $msg;
304
+		$msg = empty( $msg ) ? $defaults[$error]['part'] : $msg;
305 305
 		$msg = do_shortcode( $msg );
306 306
 
307 307
 		return $msg;
@@ -409,7 +409,7 @@  discard block
 block discarded – undo
409 409
 		}
410 410
 
411 411
 		$base_name = 'default_value_' . $field['id'];
412
-		$html_id    = isset( $field['html_id'] ) ? $field['html_id'] : self::get_html_id( $field );
412
+		$html_id = isset( $field['html_id'] ) ? $field['html_id'] : self::get_html_id( $field );
413 413
 
414 414
 		$default_type = self::get_default_value_type( $field );
415 415
 
@@ -705,7 +705,7 @@  discard block
 block discarded – undo
705 705
 				continue;
706 706
 			}
707 707
 
708
-			$atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[3][ $short_key ] );
708
+			$atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[3][$short_key] );
709 709
 			$tag  = FrmShortcodeHelper::get_shortcode_tag( $shortcodes, $short_key );
710 710
 
711 711
 			$atts['entry'] = $entry;
@@ -714,7 +714,7 @@  discard block
 block discarded – undo
714 714
 
715 715
 			if ( $replace_with !== null ) {
716 716
 				self::sanitize_embedded_shortcodes( compact( 'entry' ), $replace_with );
717
-				$content = str_replace( $shortcodes[0][ $short_key ], $replace_with, $content );
717
+				$content = str_replace( $shortcodes[0][$short_key], $replace_with, $content );
718 718
 			}
719 719
 
720 720
 			unset( $atts, $replace_with );
@@ -757,8 +757,8 @@  discard block
 block discarded – undo
757 757
 
758 758
 		$dynamic_default = array( 'admin_email', 'siteurl', 'frmurl', 'sitename', 'get' );
759 759
 
760
-		if ( isset( $shortcode_values[ $atts['tag'] ] ) ) {
761
-			$replace_with = $shortcode_values[ $atts['tag'] ];
760
+		if ( isset( $shortcode_values[$atts['tag']] ) ) {
761
+			$replace_with = $shortcode_values[$atts['tag']];
762 762
 		} elseif ( in_array( $atts['tag'], $dynamic_default ) ) {
763 763
 			$replace_with = self::dynamic_default_values( $atts['tag'], $atts );
764 764
 		} elseif ( $clean_tag == 'user_agent' ) {
@@ -967,8 +967,8 @@  discard block
 block discarded – undo
967 967
 			self::field_types_for_input( $single_input, $field_selection, $field_types );
968 968
 		} elseif ( in_array( $type, $multiple_input ) ) {
969 969
 			self::field_types_for_input( $multiple_input, $field_selection, $field_types );
970
-		} elseif ( isset( $field_selection[ $type ] ) ) {
971
-			$field_types[ $type ] = $field_selection[ $type ];
970
+		} elseif ( isset( $field_selection[$type] ) ) {
971
+			$field_types[$type] = $field_selection[$type];
972 972
 		}
973 973
 
974 974
 		$field_types = apply_filters( 'frm_switch_field_types', $field_types, compact( 'type' ) );
@@ -1001,7 +1001,7 @@  discard block
 block discarded – undo
1001 1001
 
1002 1002
 	private static function field_types_for_input( $inputs, $fields, &$field_types ) {
1003 1003
 		foreach ( $inputs as $input ) {
1004
-			$field_types[ $input ] = $fields[ $input ];
1004
+			$field_types[$input] = $fields[$input];
1005 1005
 			unset( $input );
1006 1006
 		}
1007 1007
 	}
@@ -1033,7 +1033,7 @@  discard block
 block discarded – undo
1033 1033
 			'parent'  => false,
1034 1034
 			'pointer' => false,
1035 1035
 		);
1036
-		$args     = wp_parse_args( $args, $defaults );
1036
+		$args = wp_parse_args( $args, $defaults );
1037 1037
 
1038 1038
 		$opt_key   = $args['opt_key'];
1039 1039
 		$field     = $args['field'];
@@ -1050,22 +1050,22 @@  discard block
 block discarded – undo
1050 1050
 		// Check posted vals before checking saved values
1051 1051
 
1052 1052
 		// For fields inside repeating sections - note, don't check if $pointer is true because it will often be zero
1053
-		if ( $parent && isset( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ] ) ) {
1053
+		if ( $parent && isset( $_POST['item_meta'][$parent][$pointer]['other'][$field['id']] ) ) {
1054 1054
 			if ( FrmField::is_field_with_multiple_values( $field ) ) {
1055
-				$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 ] ) ) : '';
1055
+				$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] ) ) : '';
1056 1056
 			} else {
1057
-				$other_val = sanitize_text_field( wp_unslash( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ] ) );
1057
+				$other_val = sanitize_text_field( wp_unslash( $_POST['item_meta'][$parent][$pointer]['other'][$field['id']] ) );
1058 1058
 			}
1059 1059
 
1060 1060
 			return $other_val;
1061 1061
 
1062
-		} elseif ( isset( $field['id'] ) && isset( $_POST['item_meta']['other'][ $field['id'] ] ) ) {
1062
+		} elseif ( isset( $field['id'] ) && isset( $_POST['item_meta']['other'][$field['id']] ) ) {
1063 1063
 			// For normal fields
1064 1064
 
1065 1065
 			if ( FrmField::is_field_with_multiple_values( $field ) ) {
1066
-				$other_val = isset( $_POST['item_meta']['other'][ $field['id'] ][ $opt_key ] ) ? sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][ $field['id'] ][ $opt_key ] ) ) : '';
1066
+				$other_val = isset( $_POST['item_meta']['other'][$field['id']][$opt_key] ) ? sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][$field['id']][$opt_key] ) ) : '';
1067 1067
 			} else {
1068
-				$other_val = sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][ $field['id'] ] ) );
1068
+				$other_val = sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][$field['id']] ) );
1069 1069
 			}
1070 1070
 
1071 1071
 			return $other_val;
@@ -1075,8 +1075,8 @@  discard block
 block discarded – undo
1075 1075
 		if ( $field['type'] == 'checkbox' && is_array( $field['value'] ) ) {
1076 1076
 			// Check if there is an "other" val in saved value and make sure the
1077 1077
 			// "other" val is not equal to the Other checkbox option
1078
-			if ( isset( $field['value'][ $opt_key ] ) && $field['options'][ $opt_key ] != $field['value'][ $opt_key ] ) {
1079
-				$other_val = $field['value'][ $opt_key ];
1078
+			if ( isset( $field['value'][$opt_key] ) && $field['options'][$opt_key] != $field['value'][$opt_key] ) {
1079
+				$other_val = $field['value'][$opt_key];
1080 1080
 			}
1081 1081
 		} else {
1082 1082
 			/**
@@ -1088,8 +1088,8 @@  discard block
 block discarded – undo
1088 1088
 				// Multi-select dropdowns - key is not preserved
1089 1089
 				if ( is_array( $field['value'] ) ) {
1090 1090
 					$o_key = array_search( $temp_val, $field['value'] );
1091
-					if ( isset( $field['value'][ $o_key ] ) ) {
1092
-						unset( $field['value'][ $o_key ], $o_key );
1091
+					if ( isset( $field['value'][$o_key] ) ) {
1092
+						unset( $field['value'][$o_key], $o_key );
1093 1093
 					}
1094 1094
 				} elseif ( $temp_val == $field['value'] ) {
1095 1095
 					// For radio and regular dropdowns
@@ -1276,7 +1276,7 @@  discard block
 block discarded – undo
1276 1276
 		}
1277 1277
 		if ( is_array( $val ) ) {
1278 1278
 			foreach ( $val as $k => $v ) {
1279
-				$val[ $k ] = str_replace( $replace, $replace_with, $v );
1279
+				$val[$k] = str_replace( $replace, $replace_with, $v );
1280 1280
 				unset( $k, $v );
1281 1281
 			}
1282 1282
 		} else {
@@ -1574,19 +1574,19 @@  discard block
 block discarded – undo
1574 1574
 	}
1575 1575
 
1576 1576
 	public static function get_bulk_prefilled_opts( array &$prepop ) {
1577
-		$prepop[ __( 'Countries', 'formidable' ) ] = self::get_countries();
1577
+		$prepop[__( 'Countries', 'formidable' )] = self::get_countries();
1578 1578
 
1579 1579
 		$states    = self::get_us_states();
1580 1580
 		$state_abv = array_keys( $states );
1581 1581
 		sort( $state_abv );
1582
-		$prepop[ __( 'U.S. State Abbreviations', 'formidable' ) ] = $state_abv;
1582
+		$prepop[__( 'U.S. State Abbreviations', 'formidable' )] = $state_abv;
1583 1583
 
1584 1584
 		$states = array_values( $states );
1585 1585
 		sort( $states );
1586
-		$prepop[ __( 'U.S. States', 'formidable' ) ] = $states;
1586
+		$prepop[__( 'U.S. States', 'formidable' )] = $states;
1587 1587
 		unset( $state_abv, $states );
1588 1588
 
1589
-		$prepop[ __( 'Age', 'formidable' ) ] = array(
1589
+		$prepop[__( 'Age', 'formidable' )] = array(
1590 1590
 			__( 'Under 18', 'formidable' ),
1591 1591
 			__( '18-24', 'formidable' ),
1592 1592
 			__( '25-34', 'formidable' ),
@@ -1597,7 +1597,7 @@  discard block
 block discarded – undo
1597 1597
 			__( 'Prefer Not to Answer', 'formidable' ),
1598 1598
 		);
1599 1599
 
1600
-		$prepop[ __( 'Satisfaction', 'formidable' ) ] = array(
1600
+		$prepop[__( 'Satisfaction', 'formidable' )] = array(
1601 1601
 			__( 'Very Satisfied', 'formidable' ),
1602 1602
 			__( 'Satisfied', 'formidable' ),
1603 1603
 			__( 'Neutral', 'formidable' ),
@@ -1606,7 +1606,7 @@  discard block
 block discarded – undo
1606 1606
 			__( 'N/A', 'formidable' ),
1607 1607
 		);
1608 1608
 
1609
-		$prepop[ __( 'Importance', 'formidable' ) ] = array(
1609
+		$prepop[__( 'Importance', 'formidable' )] = array(
1610 1610
 			__( 'Very Important', 'formidable' ),
1611 1611
 			__( 'Important', 'formidable' ),
1612 1612
 			__( 'Neutral', 'formidable' ),
@@ -1615,7 +1615,7 @@  discard block
 block discarded – undo
1615 1615
 			__( 'N/A', 'formidable' ),
1616 1616
 		);
1617 1617
 
1618
-		$prepop[ __( 'Agreement', 'formidable' ) ] = array(
1618
+		$prepop[__( 'Agreement', 'formidable' )] = array(
1619 1619
 			__( 'Strongly Agree', 'formidable' ),
1620 1620
 			__( 'Agree', 'formidable' ),
1621 1621
 			__( '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   +19 added lines, -19 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
 
@@ -236,8 +236,8 @@  discard block
 block discarded – undo
236 236
 			'description' => '',
237 237
 		);
238 238
 		foreach ( $defaults as $var => $default ) {
239
-			if ( ! isset( $values[ $var ] ) ) {
240
-				$values[ $var ] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' );
239
+			if ( ! isset( $values[$var] ) ) {
240
+				$values[$var] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' );
241 241
 			}
242 242
 		}
243 243
 
@@ -252,8 +252,8 @@  discard block
 block discarded – undo
252 252
 			'parent_form_id' => 0,
253 253
 		);
254 254
 		foreach ( $defaults as $var => $default ) {
255
-			if ( ! isset( $values[ $var ] ) ) {
256
-				$values[ $var ] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' );
255
+			if ( ! isset( $values[$var] ) ) {
256
+				$values[$var] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' );
257 257
 			}
258 258
 		}
259 259
 		unset( $defaults );
@@ -290,16 +290,16 @@  discard block
 block discarded – undo
290 290
 		$defaults = self::get_default_opts();
291 291
 		foreach ( $defaults as $var => $default ) {
292 292
 			if ( is_array( $default ) ) {
293
-				if ( ! isset( $values[ $var ] ) ) {
294
-					$values[ $var ] = ( $record && isset( $record->options[ $var ] ) ) ? $record->options[ $var ] : array();
293
+				if ( ! isset( $values[$var] ) ) {
294
+					$values[$var] = ( $record && isset( $record->options[$var] ) ) ? $record->options[$var] : array();
295 295
 				}
296 296
 
297 297
 				foreach ( $default as $k => $v ) {
298
-					$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 );
298
+					$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 );
299 299
 
300 300
 					if ( is_array( $v ) ) {
301 301
 						foreach ( $v as $k1 => $v1 ) {
302
-							$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 );
302
+							$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 );
303 303
 							unset( $k1, $v1 );
304 304
 						}
305 305
 					}
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
 					unset( $k, $v );
308 308
 				}
309 309
 			} else {
310
-				$values[ $var ] = ( $post_values && isset( $post_values['options'][ $var ] ) ) ? $post_values['options'][ $var ] : ( ( $record && isset( $record->options[ $var ] ) ) ? $record->options[ $var ] : $default );
310
+				$values[$var] = ( $post_values && isset( $post_values['options'][$var] ) ) ? $post_values['options'][$var] : ( ( $record && isset( $record->options[$var] ) ) ? $record->options[$var] : $default );
311 311
 			}
312 312
 
313 313
 			unset( $var, $default );
@@ -345,7 +345,7 @@  discard block
 block discarded – undo
345 345
 	public static function fill_form_options( &$options, $values ) {
346 346
 		$defaults = self::get_default_opts();
347 347
 		foreach ( $defaults as $var => $default ) {
348
-			$options[ $var ] = isset( $values['options'][ $var ] ) ? $values['options'][ $var ] : $default;
348
+			$options[$var] = isset( $values['options'][$var] ) ? $values['options'][$var] : $default;
349 349
 			unset( $var, $default );
350 350
 		}
351 351
 	}
@@ -501,7 +501,7 @@  discard block
 block discarded – undo
501 501
 	public static function insert_opt_html( $args ) {
502 502
 		$class  = isset( $args['class'] ) ? $args['class'] : '';
503 503
 		$fields = FrmField::all_field_selection();
504
-		$field  = isset( $fields[ $args['type'] ] ) ? $fields[ $args['type'] ] : array();
504
+		$field  = isset( $fields[$args['type']] ) ? $fields[$args['type']] : array();
505 505
 
506 506
 		self::prepare_field_type( $field );
507 507
 
@@ -653,7 +653,7 @@  discard block
 block discarded – undo
653 653
 			FrmField::update( $field->id, array( 'field_order' => $field->field_order + 2 ) );
654 654
 		}
655 655
 
656
-		$add_order    += 2;
656
+		$add_order += 2;
657 657
 		$open         = false;
658 658
 		$reset_fields = true;
659 659
 	}
@@ -1005,10 +1005,10 @@  discard block
 block discarded – undo
1005 1005
 				$link .= ' onclick="return confirm(\'' . esc_attr( $link_details['confirm'] ) . '\')"';
1006 1006
 			}
1007 1007
 
1008
-			$label = ( isset( $link_details[ $length ] ) ? $link_details[ $length ] : $link_details['label'] );
1009
-			if ( $length == 'icon' && isset( $link_details[ $length ] ) ) {
1008
+			$label = ( isset( $link_details[$length] ) ? $link_details[$length] : $link_details['label'] );
1009
+			if ( $length == 'icon' && isset( $link_details[$length] ) ) {
1010 1010
 				$label = '<span class="' . $label . '" title="' . esc_attr( $link_details['label'] ) . '" aria-hidden="true"></span>';
1011
-				$link  .= ' aria-label="' . esc_attr( $link_details['label'] ) . '"';
1011
+				$link .= ' aria-label="' . esc_attr( $link_details['label'] ) . '"';
1012 1012
 			}
1013 1013
 
1014 1014
 			$link .= '>' . $label . '</a>';
@@ -1156,7 +1156,7 @@  discard block
 block discarded – undo
1156 1156
 			$status = 'publish';
1157 1157
 		}
1158 1158
 
1159
-		$name = $nice_names[ $status ];
1159
+		$name = $nice_names[$status];
1160 1160
 
1161 1161
 		return $name;
1162 1162
 	}
@@ -1194,7 +1194,7 @@  discard block
 block discarded – undo
1194 1194
 
1195 1195
 		foreach ( $item['categories'] as $k => $category ) {
1196 1196
 			if ( in_array( $category, $plans ) ) {
1197
-				unset( $item['categories'][ $k ] );
1197
+				unset( $item['categories'][$k] );
1198 1198
 				return $category;
1199 1199
 			}
1200 1200
 		}
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 ) {
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
 		<select name="<?php echo esc_attr( $frm_style->get_field_name( $name ) ); ?>"
221 221
 			id="frm_<?php echo esc_attr( $name ); ?>" class="frm_icon_font frm_multiselect hide-if-js">
222 222
 			<?php foreach ( $icons as $key => $icon ) { ?>
223
-				<option value="<?php echo esc_attr( $key ); ?>" <?php selected( $style->post_content[ $name ], $key ); ?>>
223
+				<option value="<?php echo esc_attr( $key ); ?>" <?php selected( $style->post_content[$name], $key ); ?>>
224 224
 					<?php echo '&#xe' . esc_html( $icon['+'] ) . '; &#xe' . esc_html( $icon['-'] ) . ';'; ?>
225 225
 				</option>
226 226
 			<?php } ?>
@@ -228,8 +228,8 @@  discard block
 block discarded – undo
228 228
 
229 229
 		<div class="btn-group hide-if-no-js" id="frm_<?php echo esc_attr( $name ); ?>_select">
230 230
 			<button class="multiselect dropdown-toggle btn btn-default" data-toggle="dropdown" type="button">
231
-				<?php FrmAppHelper::icon_by_class( 'frmfont ' . self::icon_key_to_class( $style->post_content[ $name ], '+', $type ) ); ?>
232
-				<?php FrmAppHelper::icon_by_class( 'frmfont ' . self::icon_key_to_class( $style->post_content[ $name ], '-', $type ) ); ?>
231
+				<?php FrmAppHelper::icon_by_class( 'frmfont ' . self::icon_key_to_class( $style->post_content[$name], '+', $type ) ); ?>
232
+				<?php FrmAppHelper::icon_by_class( 'frmfont ' . self::icon_key_to_class( $style->post_content[$name], '-', $type ) ); ?>
233 233
 				<b class="caret"></b>
234 234
 			</button>
235 235
 			<ul class="multiselect-container frm-dropdown-menu">
@@ -322,14 +322,14 @@  discard block
 block discarded – undo
322 322
 			$settings['style_class'] = 'frm_style_' . $style->post_name . '.';
323 323
 		}
324 324
 
325
-		$settings['style_class']   .= 'with_frm_style';
325
+		$settings['style_class'] .= 'with_frm_style';
326 326
 		$settings['font']          = stripslashes( $settings['font'] );
327 327
 		$settings['change_margin'] = self::description_margin_for_screensize( $settings['width'] );
328 328
 
329 329
 		$checkbox_opts = array( 'important_style', 'auto_width', 'submit_style', 'collapse_icon', 'center_form' );
330 330
 		foreach ( $checkbox_opts as $opt ) {
331
-			if ( ! isset( $settings[ $opt ] ) ) {
332
-				$settings[ $opt ] = 0;
331
+			if ( ! isset( $settings[$opt] ) ) {
332
+				$settings[$opt] = 0;
333 333
 			}
334 334
 		}
335 335
 
@@ -348,7 +348,7 @@  discard block
 block discarded – undo
348 348
 				$css = '';
349 349
 			}
350 350
 			foreach ( $opts as $opt ) {
351
-				self::get_color_output( $css, $settings[ $opt ] );
351
+				self::get_color_output( $css, $settings[$opt] );
352 352
 			}
353 353
 		}
354 354
 	}
Please login to merge, or discard this patch.
classes/models/FrmAddon.php 2 patches
Doc Comments   +7 added lines patch added patch discarded remove patch
@@ -234,6 +234,9 @@  discard block
 block discarded – undo
234 234
 		$this->delete_cache();
235 235
 	}
236 236
 
237
+	/**
238
+	 * @param string|false $is_active
239
+	 */
237 240
 	public function set_active( $is_active ) {
238 241
 		update_option( $this->option_name . 'active', $is_active );
239 242
 		$this->delete_cache();
@@ -352,6 +355,7 @@  discard block
 block discarded – undo
352 355
 	 * Get the API info for this plugin
353 356
 	 *
354 357
 	 * @since 3.04.03
358
+	 * @param string $license
355 359
 	 */
356 360
 	protected function get_api_info( $license ) {
357 361
 		$api   = new FrmFormApi( $license );
@@ -582,6 +586,9 @@  discard block
 block discarded – undo
582 586
 		wp_die();
583 587
 	}
584 588
 
589
+	/**
590
+	 * @param string $action
591
+	 */
585 592
 	public function send_mothership_request( $action ) {
586 593
 		$api_params = array(
587 594
 			'edd_action' => $action,
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 	}
42 42
 
43 43
 	public function insert_installed_addon( $plugins ) {
44
-		$plugins[ $this->plugin_slug ] = $this;
44
+		$plugins[$this->plugin_slug] = $this;
45 45
 
46 46
 		return $plugins;
47 47
 	}
@@ -49,8 +49,8 @@  discard block
 block discarded – undo
49 49
 	public static function get_addon( $plugin_slug ) {
50 50
 		$plugins = apply_filters( 'frm_installed_addons', array() );
51 51
 		$plugin  = false;
52
-		if ( isset( $plugins[ $plugin_slug ] ) ) {
53
-			$plugin = $plugins[ $plugin_slug ];
52
+		if ( isset( $plugins[$plugin_slug] ) ) {
53
+			$plugin = $plugins[$plugin_slug];
54 54
 		}
55 55
 
56 56
 		return $plugin;
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 		} else {
110 110
 			$api     = new FrmFormApi( $this->license );
111 111
 			$plugins = $api->get_api_info();
112
-			$_data   = $plugins[ $item_id ];
112
+			$_data   = $plugins[$item_id];
113 113
 		}
114 114
 
115 115
 		$_data['sections'] = array(
@@ -301,19 +301,19 @@  discard block
 block discarded – undo
301 301
 
302 302
 		if ( $this->is_current_version( $transient ) ) {
303 303
 			//make sure it doesn't show there is an update if plugin is up-to-date
304
-			if ( isset( $transient->response[ $this->plugin_folder ] ) ) {
305
-				unset( $transient->response[ $this->plugin_folder ] );
304
+			if ( isset( $transient->response[$this->plugin_folder] ) ) {
305
+				unset( $transient->response[$this->plugin_folder] );
306 306
 			}
307
-		} elseif ( isset( $transient->response ) && isset( $transient->response[ $this->plugin_folder ] ) ) {
308
-			$this->prepare_update_details( $transient->response[ $this->plugin_folder ] );
307
+		} elseif ( isset( $transient->response ) && isset( $transient->response[$this->plugin_folder] ) ) {
308
+			$this->prepare_update_details( $transient->response[$this->plugin_folder] );
309 309
 
310 310
 			// if the transient has expired, clear the update and trigger it again
311
-			if ( $transient->response[ $this->plugin_folder ] === false ) {
311
+			if ( $transient->response[$this->plugin_folder] === false ) {
312 312
 				if ( ! $this->has_been_cleared() ) {
313 313
 					$this->cleared_plugins();
314 314
 					$this->manually_queue_update();
315 315
 				}
316
-				unset( $transient->response[ $this->plugin_folder ] );
316
+				unset( $transient->response[$this->plugin_folder] );
317 317
 			}
318 318
 		}
319 319
 
@@ -401,7 +401,7 @@  discard block
 block discarded – undo
401 401
 	}
402 402
 
403 403
 	private function is_current_version( $transient ) {
404
-		if ( empty( $transient->checked ) || ! isset( $transient->checked[ $this->plugin_folder ] ) ) {
404
+		if ( empty( $transient->checked ) || ! isset( $transient->checked[$this->plugin_folder] ) ) {
405 405
 			return false;
406 406
 		}
407 407
 
@@ -410,7 +410,7 @@  discard block
 block discarded – undo
410 410
 			return true;
411 411
 		}
412 412
 
413
-		return isset( $transient->response ) && isset( $transient->response[ $this->plugin_folder ] ) && $transient->checked[ $this->plugin_folder ] === $transient->response[ $this->plugin_folder ]->new_version;
413
+		return isset( $transient->response ) && isset( $transient->response[$this->plugin_folder] ) && $transient->checked[$this->plugin_folder] === $transient->response[$this->plugin_folder]->new_version;
414 414
 	}
415 415
 
416 416
 	private function has_been_cleared() {
@@ -491,8 +491,8 @@  discard block
 block discarded – undo
491 491
 			$response['message'] = $response['status'];
492 492
 		} else {
493 493
 			$messages = $this->get_messages();
494
-			if ( is_string( $response['status'] ) && isset( $messages[ $response['status'] ] ) ) {
495
-				$response['message'] = $messages[ $response['status'] ];
494
+			if ( is_string( $response['status'] ) && isset( $messages[$response['status']] ) ) {
495
+				$response['message'] = $messages[$response['status']];
496 496
 			} else {
497 497
 				$response['message'] = FrmAppHelper::kses( $response['status'], array( 'a' ) );
498 498
 			}
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   +14 added lines, -14 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
 
@@ -344,19 +344,19 @@  discard block
 block discarded – undo
344 344
 		$include_key = apply_filters( 'frm_include_meta_keys', false, array( 'form_id' => $entry->form_id ) );
345 345
 		foreach ( $metas as $meta_val ) {
346 346
 			if ( $meta_val->item_id == $entry->id ) {
347
-				$entry->metas[ $meta_val->field_id ] = maybe_unserialize( $meta_val->meta_value );
347
+				$entry->metas[$meta_val->field_id] = maybe_unserialize( $meta_val->meta_value );
348 348
 				if ( $include_key ) {
349
-					$entry->metas[ $meta_val->field_key ] = $entry->metas[ $meta_val->field_id ];
349
+					$entry->metas[$meta_val->field_key] = $entry->metas[$meta_val->field_id];
350 350
 				}
351 351
 				continue;
352 352
 			}
353 353
 
354 354
 			// include sub entries in an array
355
-			if ( ! isset( $entry_metas[ $meta_val->field_id ] ) ) {
356
-				$entry->metas[ $meta_val->field_id ] = array();
355
+			if ( ! isset( $entry_metas[$meta_val->field_id] ) ) {
356
+				$entry->metas[$meta_val->field_id] = array();
357 357
 			}
358 358
 
359
-			$entry->metas[ $meta_val->field_id ][] = maybe_unserialize( $meta_val->meta_value );
359
+			$entry->metas[$meta_val->field_id][] = maybe_unserialize( $meta_val->meta_value );
360 360
 
361 361
 			unset( $meta_val );
362 362
 		}
@@ -403,13 +403,13 @@  discard block
 block discarded – undo
403 403
 
404 404
 			if ( $inc_form ) {
405 405
 				$fields = 'it.*, fr.name as form_name,fr.form_key as form_key';
406
-				$table  .= 'LEFT OUTER JOIN ' . $wpdb->prefix . 'frm_forms fr ON it.form_id=fr.id ';
406
+				$table .= 'LEFT OUTER JOIN ' . $wpdb->prefix . 'frm_forms fr ON it.form_id=fr.id ';
407 407
 			}
408 408
 
409 409
 			if ( preg_match( '/ meta_([0-9]+)/', $order_by, $order_matches ) ) {
410 410
 				// sort by a requested field
411 411
 				$field_id = (int) $order_matches[1];
412
-				$fields   .= ', (SELECT meta_value FROM ' . $wpdb->prefix . 'frm_item_metas WHERE field_id = ' . $field_id . ' AND item_id = it.id) as meta_' . $field_id;
412
+				$fields .= ', (SELECT meta_value FROM ' . $wpdb->prefix . 'frm_item_metas WHERE field_id = ' . $field_id . ' AND item_id = it.id) as meta_' . $field_id;
413 413
 				unset( $order_matches, $field_id );
414 414
 			}
415 415
 
@@ -447,15 +447,15 @@  discard block
 block discarded – undo
447 447
 		}
448 448
 
449 449
 		foreach ( $metas as $m_key => $meta_val ) {
450
-			if ( ! isset( $entries[ $meta_val->item_id ] ) ) {
450
+			if ( ! isset( $entries[$meta_val->item_id] ) ) {
451 451
 				continue;
452 452
 			}
453 453
 
454
-			if ( ! isset( $entries[ $meta_val->item_id ]->metas ) ) {
455
-				$entries[ $meta_val->item_id ]->metas = array();
454
+			if ( ! isset( $entries[$meta_val->item_id]->metas ) ) {
455
+				$entries[$meta_val->item_id]->metas = array();
456 456
 			}
457 457
 
458
-			$entries[ $meta_val->item_id ]->metas[ $meta_val->field_id ] = maybe_unserialize( $meta_val->meta_value );
458
+			$entries[$meta_val->item_id]->metas[$meta_val->field_id] = maybe_unserialize( $meta_val->meta_value );
459 459
 
460 460
 			unset( $m_key, $meta_val );
461 461
 		}
@@ -613,7 +613,7 @@  discard block
 block discarded – undo
613 613
 	}
614 614
 
615 615
 	private static function get_entry_value( $values, $name, $default ) {
616
-		return isset( $values[ $name ] ) ? $values[ $name ] : $default;
616
+		return isset( $values[$name] ) ? $values[$name] : $default;
617 617
 	}
618 618
 
619 619
 	/**
Please login to merge, or discard this patch.