Completed
Push — master ( 414a92...ad72a2 )
by Stephanie
03:03
created
classes/models/fields/FrmFieldType.php 2 patches
Doc Comments   +9 added lines patch added patch discarded remove patch
@@ -299,6 +299,9 @@  discard block
 block discarded – undo
299 299
 		return $this->alter_builder_classes( $classes );
300 300
 	}
301 301
 
302
+	/**
303
+	 * @param string $classes
304
+	 */
302 305
 	protected function alter_builder_classes( $classes ) {
303 306
 		return $classes;
304 307
 	}
@@ -493,6 +496,11 @@  discard block
 block discarded – undo
493 496
 		return $html;
494 497
 	}
495 498
 
499
+	/**
500
+	 * @param string $html
501
+	 *
502
+	 * @return string
503
+	 */
496 504
 	protected function after_replace_html_shortcodes( $args, $html ) {
497 505
 		return $html;
498 506
 	}
@@ -788,6 +796,7 @@  discard block
 block discarded – undo
788 796
 	 * Link input to field description for screen readers
789 797
 	 *
790 798
 	 * @since 3.0
799
+	 * @param string $input_html
791 800
 	 */
792 801
 	protected function add_aria_description( $args, &$input_html ) {
793 802
 		$describedby = '';
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -104,8 +104,8 @@  discard block
 block discarded – undo
104 104
 		$field_val = '';
105 105
 		if ( is_object( $this->field ) ) {
106 106
 			$field_val = $this->field->{$column};
107
-		} elseif ( is_array( $this->field ) && isset( $this->field[ $column ] ) ) {
108
-			$field_val = $this->field[ $column ];
107
+		} elseif ( is_array( $this->field ) && isset( $this->field[$column] ) ) {
108
+			$field_val = $this->field[$column];
109 109
 		}
110 110
 		return $field_val;
111 111
 	}
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
 		if ( is_object( $this->field ) ) {
119 119
 			$this->field->{$column} = $value;
120 120
 		} elseif ( is_array( $this->field ) ) {
121
-			$this->field[ $column ] = $value;
121
+			$this->field[$column] = $value;
122 122
 		}
123 123
 	}
124 124
 
@@ -359,8 +359,8 @@  discard block
 block discarded – undo
359 359
 		$fields = FrmField::field_selection();
360 360
 		$fields = array_merge( $fields, FrmField::pro_field_selection() );
361 361
 
362
-		if ( isset( $fields[ $this->type ] ) ) {
363
-			$name = is_array( $fields[ $this->type ] ) ? $fields[ $this->type ]['name'] : $fields[ $this->type ];
362
+		if ( isset( $fields[$this->type] ) ) {
363
+			$name = is_array( $fields[$this->type] ) ? $fields[$this->type]['name'] : $fields[$this->type];
364 364
 		}
365 365
 
366 366
 		return $name;
@@ -703,8 +703,8 @@  discard block
 block discarded – undo
703 703
 		$selected = $values['field_value'];
704 704
 
705 705
 		if ( isset( $values['combo_name'] ) ) {
706
-			$options = $options[ $values['combo_name'] ];
707
-			$selected = ( is_array( $selected ) && isset( $selected[ $values['combo_name'] ] ) ) ? $selected[ $values['combo_name'] ] : '';
706
+			$options = $options[$values['combo_name']];
707
+			$selected = ( is_array( $selected ) && isset( $selected[$values['combo_name']] ) ) ? $selected[$values['combo_name']] : '';
708 708
 		}
709 709
 
710 710
 		$input = $this->select_tag( $values );
@@ -795,7 +795,7 @@  discard block
 block discarded – undo
795 795
 			$describedby = 'frm_desc_' . $args['html_id'];
796 796
 		}
797 797
 
798
-		if ( isset( $args['errors'][ 'field' . $args['field_id'] ] ) ) {
798
+		if ( isset( $args['errors']['field' . $args['field_id']] ) ) {
799 799
 			$describedby .= ' frm_error_' . $args['html_id'];
800 800
 		}
801 801
 
@@ -849,8 +849,8 @@  discard block
 block discarded – undo
849 849
 		$value = $this->prepare_display_value( $value, $atts );
850 850
 
851 851
 		if ( is_array( $value ) ) {
852
-			if ( isset( $atts['show'] ) && $atts['show'] && isset( $value[ $atts['show'] ] ) ) {
853
-				$value = $value[ $atts['show'] ];
852
+			if ( isset( $atts['show'] ) && $atts['show'] && isset( $value[$atts['show']] ) ) {
853
+				$value = $value[$atts['show']];
854 854
 			} elseif ( ! isset( $atts['return_array'] ) || ! $atts['return_array'] ) {
855 855
 				$sep = isset( $atts['sep'] ) ? $atts['sep'] : ', ';
856 856
 				$value = implode( $sep, $value );
@@ -917,8 +917,8 @@  discard block
 block discarded – undo
917 917
 		$saved_entries = $atts['ids'];
918 918
 		$new_value = array();
919 919
 		foreach ( (array) $value as $old_child_id ) {
920
-			if ( isset( $saved_entries[ $old_child_id ] ) ) {
921
-				$new_value[] = $saved_entries[ $old_child_id ];
920
+			if ( isset( $saved_entries[$old_child_id] ) ) {
921
+				$new_value[] = $saved_entries[$old_child_id];
922 922
 			}
923 923
 		}
924 924
 
Please login to merge, or discard this patch.
classes/models/FrmFieldFormHtml.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -41,8 +41,8 @@  discard block
 block discarded – undo
41 41
 	 * @param array $atts
42 42
 	 */
43 43
 	private function _set( $param, $atts ) {
44
-		if ( isset( $atts[ $param ] ) ) {
45
-			$this->{$param} = $atts[ $param ];
44
+		if ( isset( $atts[$param] ) ) {
45
+			$this->{$param} = $atts[$param];
46 46
 		}
47 47
 	}
48 48
 
@@ -86,8 +86,8 @@  discard block
 block discarded – undo
86 86
 		$exclude = array( 'field_obj', 'html' );
87 87
 
88 88
 		foreach ( $exclude as $ex ) {
89
-			if ( isset( $atts[ $ex ] ) ) {
90
-				unset( $this->pass_args[ $ex ] );
89
+			if ( isset( $atts[$ex] ) ) {
90
+				unset( $this->pass_args[$ex] );
91 91
 			}
92 92
 		}
93 93
 	}
@@ -99,8 +99,8 @@  discard block
 block discarded – undo
99 99
 	 * @param array $set
100 100
 	 */
101 101
 	private function set_from_field( $atts, $set ) {
102
-		if ( isset( $atts[ $set['param'] ] ) ) {
103
-			$this->{$set['param']} = $atts[ $set['param'] ];
102
+		if ( isset( $atts[$set['param']] ) ) {
103
+			$this->{$set['param']} = $atts[$set['param']];
104 104
 		} else {
105 105
 			$this->{$set['param']} = $this->field_obj->get_field_column( $set['default'] );
106 106
 		}
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
 	 */
226 226
 	private function replace_error_shortcode() {
227 227
 		$this->maybe_add_error_id();
228
-		$error = isset( $this->pass_args['errors'][ 'field' . $this->field_id ] ) ? $this->pass_args['errors'][ 'field' . $this->field_id ] : false;
228
+		$error = isset( $this->pass_args['errors']['field' . $this->field_id] ) ? $this->pass_args['errors']['field' . $this->field_id] : false;
229 229
 		FrmShortcodeHelper::remove_inline_conditions( ! empty( $error ), 'error', $error, $this->html );
230 230
 	}
231 231
 
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
 	 * @since 3.06.02
237 237
 	 */
238 238
 	private function maybe_add_error_id() {
239
-		if ( ! isset( $this->pass_args['errors'][ 'field' . $this->field_id ] ) ) {
239
+		if ( ! isset( $this->pass_args['errors']['field' . $this->field_id] ) ) {
240 240
 			return;
241 241
 		}
242 242
 
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
 		preg_match_all( "/\[(input|deletelink)\b(.*?)(?:(\/))?\]/s", $this->html, $shortcodes, PREG_PATTERN_ORDER );
317 317
 
318 318
 		foreach ( $shortcodes[0] as $short_key => $tag ) {
319
-			$shortcode_atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[2][ $short_key ] );
319
+			$shortcode_atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[2][$short_key] );
320 320
 			$tag = FrmShortcodeHelper::get_shortcode_tag( $shortcodes, $short_key );
321 321
 
322 322
 			$replace_with = '';
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
 				$replace_with = $this->replace_input_shortcode( $shortcode_atts );
328 328
 			}
329 329
 
330
-			$this->html = str_replace( $shortcodes[0][ $short_key ], $replace_with, $this->html );
330
+			$this->html = str_replace( $shortcodes[0][$short_key], $replace_with, $this->html );
331 331
 		}
332 332
 	}
333 333
 
@@ -348,7 +348,7 @@  discard block
 block discarded – undo
348 348
 	 */
349 349
 	private function prepare_input_shortcode_atts( $shortcode_atts ) {
350 350
 		if ( isset( $shortcode_atts['opt'] ) ) {
351
-			$shortcode_atts['opt']--;
351
+			$shortcode_atts['opt'] --;
352 352
 		}
353 353
 
354 354
 		$field_class = isset( $shortcode_atts['class'] ) ? $shortcode_atts['class'] : '';
@@ -358,7 +358,7 @@  discard block
 block discarded – undo
358 358
 			unset( $shortcode_atts['class'] );
359 359
 		}
360 360
 
361
-		if ( isset( $this->pass_args['errors'][ 'field' . $this->field_id ] ) ) {
361
+		if ( isset( $this->pass_args['errors']['field' . $this->field_id] ) ) {
362 362
 			$shortcode_atts['aria-invalid'] = 'true';
363 363
 		}
364 364
 
@@ -416,7 +416,7 @@  discard block
 block discarded – undo
416 416
 	 */
417 417
 	private function get_field_div_classes() {
418 418
 		// Add error class
419
-		$classes = isset( $this->pass_args['errors'][ 'field' . $this->field_id ] ) ? ' frm_blank_field' : '';
419
+		$classes = isset( $this->pass_args['errors']['field' . $this->field_id] ) ? ' frm_blank_field' : '';
420 420
 
421 421
 		// Add label position class
422 422
 		$settings = $this->field_obj->display_field_settings();
Please login to merge, or discard this patch.