Completed
Branch 4.0Builder (9ef7e0)
by Stephanie
03:43
created
classes/controllers/FrmFormsController.php 3 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1082,7 +1082,8 @@
 block discarded – undo
1082 1082
 	private static function maybe_get_form_to_show( $id ) {
1083 1083
 		$form = false;
1084 1084
 
1085
-		if ( ! empty( $id ) ) { // no form id or key set
1085
+		if ( ! empty( $id ) ) {
1086
+// no form id or key set
1086 1087
 			$form = FrmForm::getOne( $id );
1087 1088
 			if ( ! $form || $form->parent_form_id || $form->status == 'trash' ) {
1088 1089
 				$form = false;
Please login to merge, or discard this patch.
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/models/FrmFieldValueSelector.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@
 block discarded – undo
75 75
 	/**
76 76
 	 * FrmFieldValueSelector constructor
77 77
 	 *
78
-	 * @param int|string $field_id
78
+	 * @param integer $field_id
79 79
 	 */
80 80
 	public function __construct( $field_id, $args ) {
81 81
 		$this->set_html_name( $args );
Please login to merge, or discard this patch.
classes/models/FrmEntryShortcodeFormatter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -285,7 +285,7 @@
 block discarded – undo
285 285
 			'type'  => $field->type,
286 286
 		);
287 287
 
288
-		$this->array_content[ $field->id ] = apply_filters( 'frm_field_shortcodes_for_default_html_email', $array, $field );
288
+		$this->array_content[$field->id] = apply_filters( 'frm_field_shortcodes_for_default_html_email', $array, $field );
289 289
 	}
290 290
 
291 291
 	/**
Please login to merge, or discard this patch.
classes/models/FrmEntryFormatter.php 2 patches
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -363,7 +363,7 @@  discard block
 block discarded – undo
363 363
 	 *
364 364
 	 * @since 2.04
365 365
 	 *
366
-	 * @param array $field_values
366
+	 * @param FrmFieldValue[] $field_values
367 367
 	 * @param array $output
368 368
 	 */
369 369
 	protected function push_field_values_to_array( $field_values, &$output ) {
@@ -570,7 +570,7 @@  discard block
 block discarded – undo
570 570
 	 *
571 571
 	 * @param mixed $value
572 572
 	 *
573
-	 * @return mixed|string
573
+	 * @return FrmFieldValue
574 574
 	 */
575 575
 	protected function prepare_display_value_for_array( $value ) {
576 576
 		return $this->strip_html( $value );
@@ -585,7 +585,7 @@  discard block
 block discarded – undo
585 585
 	 * @param mixed $display_value
586 586
 	 * @param string $field_type
587 587
 	 *
588
-	 * @return mixed|string
588
+	 * @return string
589 589
 	 */
590 590
 	protected function prepare_display_value_for_html_table( $display_value, $field_type = '' ) {
591 591
 		$display_value = $this->flatten_array( $display_value );
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -161,8 +161,8 @@  discard block
 block discarded – undo
161 161
 
162 162
 		$conditionally_add = array( 'include_fields', 'fields', 'exclude_fields' );
163 163
 		foreach ( $conditionally_add as $index ) {
164
-			if ( isset( $atts[ $index ] ) ) {
165
-				$entry_atts[ $index ] = $atts[ $index ];
164
+			if ( isset( $atts[$index] ) ) {
165
+				$entry_atts[$index] = $atts[$index];
166 166
 			}
167 167
 		}
168 168
 
@@ -331,8 +331,8 @@  discard block
 block discarded – undo
331 331
 
332 332
 		$unset = array( 'id', 'entry', 'form_id', 'format', 'plain_text' );
333 333
 		foreach ( $unset as $param ) {
334
-			if ( isset( $atts[ $param ] ) ) {
335
-				unset( $atts[ $param ] );
334
+			if ( isset( $atts[$param] ) ) {
335
+				unset( $atts[$param] );
336 336
 			}
337 337
 		}
338 338
 
@@ -485,11 +485,11 @@  discard block
 block discarded – undo
485 485
 
486 486
 			$displayed_value = $this->prepare_display_value_for_array( $field_value->get_displayed_value() );
487 487
 
488
-			$output[ $this->get_key_or_id( $field_value ) ] = $displayed_value;
488
+			$output[$this->get_key_or_id( $field_value )] = $displayed_value;
489 489
 
490 490
 			$has_separate_value = (bool) $field_value->get_field_option( 'separate_value' );
491 491
 			if ( $has_separate_value || $displayed_value !== $field_value->get_saved_value() ) {
492
-				$output[ $this->get_key_or_id( $field_value ) . '-value' ] = $field_value->get_saved_value();
492
+				$output[$this->get_key_or_id( $field_value ) . '-value'] = $field_value->get_saved_value();
493 493
 			}
494 494
 		}
495 495
 	}
@@ -876,7 +876,7 @@  discard block
 block discarded – undo
876 876
 
877 877
 			if ( is_array( $value ) ) {
878 878
 				foreach ( $value as $key => $single_value ) {
879
-					$value[ $key ] = $this->strip_html( $single_value );
879
+					$value[$key] = $this->strip_html( $single_value );
880 880
 				}
881 881
 			} elseif ( $this->is_plain_text && ! is_array( $value ) ) {
882 882
 				if ( strpos( $value, '<img' ) !== false ) {
Please login to merge, or discard this patch.
classes/factories/FrmFieldFactory.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -86,7 +86,7 @@
 block discarded – undo
86 86
 			'captcha'  => 'FrmFieldCaptcha',
87 87
 		);
88 88
 
89
-		$class = isset( $type_classes[ $field_type ] ) ? $type_classes[ $field_type ] : '';
89
+		$class = isset( $type_classes[$field_type] ) ? $type_classes[$field_type] : '';
90 90
 		return apply_filters( 'frm_get_field_type_class', $class, $field_type );
91 91
 	}
92 92
 
Please login to merge, or discard this patch.
Doc Comments   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 	 * @since 3.0
56 56
 	 *
57 57
 	 * @param string $field_type
58
-	 * @param int|array|object $field
58
+	 * @param integer $field
59 59
 	 *
60 60
 	 * @return stdClass
61 61
 	 */
@@ -111,6 +111,7 @@  discard block
 block discarded – undo
111 111
 
112 112
 	/**
113 113
 	 * @since 3.0
114
+	 * @param string $property
114 115
 	 */
115 116
 	public static function field_has_property( $type, $property ) {
116 117
 		$field = self::get_field_type( $type );
Please login to merge, or discard this patch.
classes/controllers/FrmFieldsController.php 2 patches
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -246,6 +246,7 @@
 block discarded – undo
246 246
 
247 247
 	/**
248 248
 	 * @since 3.0
249
+	 * @param stdClass $field_info
249 250
 	 */
250 251
 	private static function get_classes_for_builder_field( $field, $display, $field_info ) {
251 252
 		$li_classes = $field_info->form_builder_classes( $display['type'] );
Please login to merge, or discard this patch.
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 
14 14
 		$_GET['page'] = 'formidable';
15 15
 
16
-		$values     = array(
16
+		$values = array(
17 17
 			'id'         => FrmAppHelper::get_post_param( 'form_id', '', 'absint' ),
18 18
 			'doing_ajax' => true,
19 19
 		);
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 
37 37
 			ob_start();
38 38
 			self::load_single_field( $field, $values );
39
-			$field_html[ absint( $field->id ) ] = ob_get_contents();
39
+			$field_html[absint( $field->id )] = ob_get_contents();
40 40
 			ob_end_clean();
41 41
 		}
42 42
 
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
 			foreach ( $opts as $opt_key => $opt ) {
238 238
 				if ( strpos( $opt, '|' ) !== false ) {
239 239
 					$vals = explode( '|', $opt );
240
-					$opts[ $opt_key ] = array(
240
+					$opts[$opt_key] = array(
241 241
 						'label' => trim( $vals[0] ),
242 242
 						'value' => trim( $vals[1] ),
243 243
 					);
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
 			$other_array = array();
253 253
 			foreach ( $field['options'] as $opt_key => $opt ) {
254 254
 				if ( FrmFieldsHelper::is_other_opt( $opt_key ) ) {
255
-					$other_array[ $opt_key ] = $opt;
255
+					$other_array[$opt_key] = $opt;
256 256
 				}
257 257
 				unset( $opt_key, $opt );
258 258
 			}
@@ -294,15 +294,15 @@  discard block
 block discarded – undo
294 294
 		$disabled_fields     = FrmAppHelper::pro_is_installed() ? array() : $pro_field_selection;
295 295
 		$frm_settings        = FrmAppHelper::get_settings();
296 296
 
297
-		if ( ! isset( $all_field_types[ $field['type'] ] ) ) {
297
+		if ( ! isset( $all_field_types[$field['type']] ) ) {
298 298
 			// Add fallback for an add-on field type that has been deactivated.
299
-			$all_field_types[ $field['type'] ] = array(
299
+			$all_field_types[$field['type']] = array(
300 300
 				'name' => ucfirst( $field['type'] ),
301 301
 				'icon' => 'frm_icon_font frm_pencil_icon',
302 302
 			);
303
-		} elseif ( ! is_array( $all_field_types[ $field['type'] ] ) ) {
303
+		} elseif ( ! is_array( $all_field_types[$field['type']] ) ) {
304 304
 			// Fallback for fields added in a more basic way.
305
-			FrmFormsHelper::prepare_field_type( $all_field_types[ $field['type'] ] );
305
+			FrmFormsHelper::prepare_field_type( $all_field_types[$field['type']] );
306 306
 		}
307 307
 
308 308
 		$display_type = self::displayed_field_type( $field );
@@ -376,13 +376,13 @@  discard block
 block discarded – undo
376 376
 		$active   = 'default_value';
377 377
 
378 378
 		foreach ( $settings as $type ) {
379
-			if ( ! empty( $field[ $type ] ) ) {
379
+			if ( ! empty( $field[$type] ) ) {
380 380
 				$active = $type;
381 381
 			}
382 382
 		}
383 383
 
384
-		$types[ $active ]['class']  .= ' current';
385
-		$types[ $active ]['current'] = true;
384
+		$types[$active]['class']  .= ' current';
385
+		$types[$active]['current'] = true;
386 386
 
387 387
 		return $types;
388 388
 	}
@@ -396,8 +396,8 @@  discard block
 block discarded – undo
396 396
 			'website' => 'url',
397 397
 			'image'   => 'url',
398 398
 		);
399
-		if ( isset( $type_switch[ $type ] ) ) {
400
-			$type = $type_switch[ $type ];
399
+		if ( isset( $type_switch[$type] ) ) {
400
+			$type = $type_switch[$type];
401 401
 		}
402 402
 
403 403
 		$pro_fields = FrmField::pro_field_selection();
@@ -521,11 +521,11 @@  discard block
 block discarded – undo
521 521
 		// include "col" for valid html
522 522
 		$unit = trim( preg_replace( '/[0-9]+/', '', $field['size'] ) );
523 523
 
524
-		if ( ! isset( $calc[ $unit ] ) ) {
524
+		if ( ! isset( $calc[$unit] ) ) {
525 525
 			return;
526 526
 		}
527 527
 
528
-		$size = (float) str_replace( $unit, '', $field['size'] ) / $calc[ $unit ];
528
+		$size = (float) str_replace( $unit, '', $field['size'] ) / $calc[$unit];
529 529
 
530 530
 		$add_html['cols'] = 'cols="' . absint( $size ) . '"';
531 531
 	}
@@ -685,10 +685,10 @@  discard block
 block discarded – undo
685 685
 
686 686
 			if ( is_numeric( $k ) && strpos( $v, '=' ) ) {
687 687
 				$add_html[] = $v;
688
-			} elseif ( ! empty( $k ) && isset( $add_html[ $k ] ) ) {
689
-				$add_html[ $k ] = str_replace( $k . '="', $k . '="' . $v, $add_html[ $k ] );
688
+			} elseif ( ! empty( $k ) && isset( $add_html[$k] ) ) {
689
+				$add_html[$k] = str_replace( $k . '="', $k . '="' . $v, $add_html[$k] );
690 690
 			} else {
691
-				$add_html[ $k ] = $k . '="' . esc_attr( $v ) . '"';
691
+				$add_html[$k] = $k . '="' . esc_attr( $v ) . '"';
692 692
 			}
693 693
 
694 694
 			unset( $k, $v );
Please login to merge, or discard this patch.
classes/controllers/FrmStylesController.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -149,6 +149,9 @@
 block discarded – undo
149 149
 		return $name;
150 150
 	}
151 151
 
152
+	/**
153
+	 * @param string $version
154
+	 */
152 155
 	private static function get_css_version( $css_key, $version ) {
153 156
 		if ( 'formidable' == $css_key ) {
154 157
 			$this_version = get_option( 'frm_last_style_update' );
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
 		$styles    = $frm_style->get_all();
235 235
 
236 236
 		if ( is_numeric( $style ) ) {
237
-			$style = $styles[ $style ];
237
+			$style = $styles[$style];
238 238
 		} elseif ( 'default' == $style ) {
239 239
 			$style = $frm_style->get_default_style( $styles );
240 240
 		}
@@ -270,8 +270,8 @@  discard block
 block discarded – undo
270 270
 
271 271
 		$forms = FrmForm::get_published_forms();
272 272
 		foreach ( $forms as $form ) {
273
-			$new_style      = ( isset( $_POST['style'] ) && isset( $_POST['style'][ $form->id ] ) ) ? sanitize_text_field( wp_unslash( $_POST['style'][ $form->id ] ) ) : '';
274
-			$previous_style = ( isset( $_POST['prev_style'] ) && isset( $_POST['prev_style'][ $form->id ] ) ) ? sanitize_text_field( wp_unslash( $_POST['prev_style'][ $form->id ] ) ) : '';
273
+			$new_style      = ( isset( $_POST['style'] ) && isset( $_POST['style'][$form->id] ) ) ? sanitize_text_field( wp_unslash( $_POST['style'][$form->id] ) ) : '';
274
+			$previous_style = ( isset( $_POST['prev_style'] ) && isset( $_POST['prev_style'][$form->id] ) ) ? sanitize_text_field( wp_unslash( $_POST['prev_style'][$form->id] ) ) : '';
275 275
 			if ( $new_style == $previous_style ) {
276 276
 				continue;
277 277
 			}
@@ -530,8 +530,8 @@  discard block
 block discarded – undo
530 530
 	 */
531 531
 	public static function get_style_val( $val, $form = 'default' ) {
532 532
 		$style = self::get_form_style( $form );
533
-		if ( $style && isset( $style->post_content[ $val ] ) ) {
534
-			return $style->post_content[ $val ];
533
+		if ( $style && isset( $style->post_content[$val] ) ) {
534
+			return $style->post_content[$val];
535 535
 		}
536 536
 	}
537 537
 
@@ -550,7 +550,7 @@  discard block
 block discarded – undo
550 550
 			} elseif ( 'alt_bg_color' == $name ) {
551 551
 				$setting = 'bg_color_active';
552 552
 			}
553
-			$default_styles[ $name ] = $style->post_content[ $setting ];
553
+			$default_styles[$name] = $style->post_content[$setting];
554 554
 			unset( $name, $val );
555 555
 		}
556 556
 
Please login to merge, or discard this patch.
classes/views/xml/xml.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -7,17 +7,17 @@  discard block
 block discarded – undo
7 7
 <?php
8 8
 foreach ( $type as $tb_type ) {
9 9
 
10
-	if ( ! isset( $tables[ $tb_type ] ) ) {
10
+	if ( ! isset( $tables[$tb_type] ) ) {
11 11
 		do_action( 'frm_xml_import_' . $tb_type, $args );
12 12
 		continue;
13 13
 	}
14 14
 
15 15
 	//no records
16
-	if ( ! isset( $records[ $tb_type ] ) ) {
16
+	if ( ! isset( $records[$tb_type] ) ) {
17 17
 		continue;
18 18
 	}
19 19
 
20
-	$item_ids = $records[ $tb_type ];
20
+	$item_ids = $records[$tb_type];
21 21
 	if ( in_array( $tb_type, array( 'styles', 'actions' ), true ) ) {
22 22
 		include( dirname( __FILE__ ) . '/posts_xml.php' );
23 23
 	} elseif ( file_exists( dirname( __FILE__ ) . '/' . $tb_type . '_xml.php' ) ) {
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 		include( FrmProAppHelper::plugin_path() . '/classes/views/xml/' . $tb_type . '_xml.php' );
27 27
 	}
28 28
 
29
-	unset( $item_ids, $records[ $tb_type ], $tb_type );
29
+	unset( $item_ids, $records[$tb_type], $tb_type );
30 30
 }
31 31
 
32 32
 ?>
Please login to merge, or discard this patch.
classes/models/FrmEntryValues.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -136,12 +136,12 @@  discard block
 block discarded – undo
136 136
 	 * @return array
137 137
 	 */
138 138
 	private function prepare_array_property( $index, $atts ) {
139
-		if ( isset( $atts[ $index ] ) && ! empty( $atts[ $index ] ) ) {
139
+		if ( isset( $atts[$index] ) && ! empty( $atts[$index] ) ) {
140 140
 
141
-			if ( is_array( $atts[ $index ] ) ) {
142
-				$property = $atts[ $index ];
141
+			if ( is_array( $atts[$index] ) ) {
142
+				$property = $atts[$index];
143 143
 			} else {
144
-				$property = explode( ',', $atts[ $index ] );
144
+				$property = explode( ',', $atts[$index] );
145 145
 			}
146 146
 		} else {
147 147
 			$property = array();
@@ -274,6 +274,6 @@  discard block
 block discarded – undo
274 274
 	 * @param stdClass $field
275 275
 	 */
276 276
 	protected function add_field_values( $field ) {
277
-		$this->field_values[ $field->id ] = new FrmFieldValue( $field, $this->entry );
277
+		$this->field_values[$field->id] = new FrmFieldValue( $field, $this->entry );
278 278
 	}
279 279
 }
Please login to merge, or discard this patch.