Completed
Push — master ( 4940f1...2d5989 )
by Stephanie
16s queued 12s
created
classes/helpers/FrmXMLHelper.php 3 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -78,7 +78,8 @@
 block discarded – undo
78 78
 
79 79
 		if ( ! isset( $imported['form_status'] ) || empty( $imported['form_status'] ) ) {
80 80
 			// Check for an error message in the XML.
81
-			if ( isset( $xml->Code ) && isset( $xml->Message ) ) { // phpcs:ignore WordPress.NamingConventions
81
+			if ( isset( $xml->Code ) && isset( $xml->Message ) ) {
82
+// phpcs:ignore WordPress.NamingConventions
82 83
 				$imported['error'] = reset( $xml->Message ); // phpcs:ignore WordPress.NamingConventions
83 84
 			}
84 85
 		}
Please login to merge, or discard this patch.
Spacing   +76 added lines, -76 removed lines patch added patch discarded remove patch
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
 
130 130
 			if ( $term && is_array( $term ) ) {
131 131
 				$imported['imported']['terms'] ++;
132
-				$imported['terms'][ (int) $t->term_id ] = $term['term_id'];
132
+				$imported['terms'][(int) $t->term_id] = $term['term_id'];
133 133
 			}
134 134
 
135 135
 			unset( $term, $t );
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
 					}
186 186
 
187 187
 					// Keep track of whether this specific form was updated or not.
188
-					$imported['form_status'][ $form_id ] = 'imported';
188
+					$imported['form_status'][$form_id] = 'imported';
189 189
 				}
190 190
 			}
191 191
 
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
 			// Update field ids/keys to new ones.
201 201
 			do_action( 'frm_after_duplicate_form', $form_id, $form, array( 'old_id' => $old_id ) );
202 202
 
203
-			$imported['forms'][ (int) $item->id ] = $form_id;
203
+			$imported['forms'][(int) $item->id] = $form_id;
204 204
 
205 205
 			// Send pre 2.0 form options through function that creates actions.
206 206
 			self::migrate_form_settings_to_actions( $form['options'], $form_id, $imported, true );
@@ -263,15 +263,15 @@  discard block
 block discarded – undo
263 263
 		}
264 264
 
265 265
 		// Keep track of whether this specific form was updated or not
266
-		$imported['form_status'][ $form_id ] = 'updated';
266
+		$imported['form_status'][$form_id] = 'updated';
267 267
 	}
268 268
 
269 269
 	private static function get_form_fields( $form_id ) {
270 270
 		$form_fields = FrmField::get_all_for_form( $form_id, '', 'exclude', 'exclude' );
271 271
 		$old_fields  = array();
272 272
 		foreach ( $form_fields as $f ) {
273
-			$old_fields[ $f->id ]        = $f;
274
-			$old_fields[ $f->field_key ] = $f->id;
273
+			$old_fields[$f->id]        = $f;
274
+			$old_fields[$f->field_key] = $f->id;
275 275
 			unset( $f );
276 276
 		}
277 277
 		$form_fields = $old_fields;
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
 	 */
329 329
 	private static function track_imported_child_forms( $form_id, $parent_form_id, &$child_forms ) {
330 330
 		if ( $parent_form_id ) {
331
-			$child_forms[ $form_id ] = $parent_form_id;
331
+			$child_forms[$form_id] = $parent_form_id;
332 332
 		}
333 333
 	}
334 334
 
@@ -343,9 +343,9 @@  discard block
 block discarded – undo
343 343
 	 */
344 344
 	private static function maybe_update_child_form_parent_id( $imported_forms, $child_forms ) {
345 345
 		foreach ( $child_forms as $child_form_id => $old_parent_form_id ) {
346
-			if ( isset( $imported_forms[ $old_parent_form_id ] ) && (int) $imported_forms[ $old_parent_form_id ] !== (int) $old_parent_form_id ) {
346
+			if ( isset( $imported_forms[$old_parent_form_id] ) && (int) $imported_forms[$old_parent_form_id] !== (int) $old_parent_form_id ) {
347 347
 				// Update all children with this old parent_form_id
348
-				$new_parent_form_id = (int) $imported_forms[ $old_parent_form_id ];
348
+				$new_parent_form_id = (int) $imported_forms[$old_parent_form_id];
349 349
 				FrmForm::update( $child_form_id, array( 'parent_form_id' => $new_parent_form_id ) );
350 350
 				do_action( 'frm_update_child_form_parent_id', $child_form_id, $new_parent_form_id );
351 351
 			}
@@ -375,27 +375,27 @@  discard block
 block discarded – undo
375 375
 
376 376
 			if ( ! empty( $this_form ) ) {
377 377
 				// check for field to edit by field id
378
-				if ( isset( $form_fields[ $f['id'] ] ) ) {
378
+				if ( isset( $form_fields[$f['id']] ) ) {
379 379
 					FrmField::update( $f['id'], $f );
380 380
 					$imported['updated']['fields'] ++;
381 381
 
382
-					unset( $form_fields[ $f['id'] ] );
382
+					unset( $form_fields[$f['id']] );
383 383
 
384 384
 					//unset old field key
385
-					if ( isset( $form_fields[ $f['field_key'] ] ) ) {
386
-						unset( $form_fields[ $f['field_key'] ] );
385
+					if ( isset( $form_fields[$f['field_key']] ) ) {
386
+						unset( $form_fields[$f['field_key']] );
387 387
 					}
388
-				} elseif ( isset( $form_fields[ $f['field_key'] ] ) ) {
389
-					$keys_by_original_field_id[ $f['id'] ] = $f['field_key'];
388
+				} elseif ( isset( $form_fields[$f['field_key']] ) ) {
389
+					$keys_by_original_field_id[$f['id']] = $f['field_key'];
390 390
 
391 391
 					// check for field to edit by field key
392 392
 					unset( $f['id'] );
393 393
 
394
-					FrmField::update( $form_fields[ $f['field_key'] ], $f );
394
+					FrmField::update( $form_fields[$f['field_key']], $f );
395 395
 					$imported['updated']['fields'] ++;
396 396
 
397
-					unset( $form_fields[ $form_fields[ $f['field_key'] ] ] ); //unset old field id
398
-					unset( $form_fields[ $f['field_key'] ] ); //unset old field key
397
+					unset( $form_fields[$form_fields[$f['field_key']]] ); //unset old field id
398
+					unset( $form_fields[$f['field_key']] ); //unset old field key
399 399
 				} else {
400 400
 					// if no matching field id or key in this form, create the field
401 401
 					self::create_imported_field( $f, $imported );
@@ -504,8 +504,8 @@  discard block
 block discarded – undo
504 504
 		if ( $f['type'] == 'form' || ( $f['type'] == 'divider' && FrmField::is_option_true( $f['field_options'], 'repeat' ) ) ) {
505 505
 			if ( FrmField::is_option_true( $f['field_options'], 'form_select' ) ) {
506 506
 				$form_select = (int) $f['field_options']['form_select'];
507
-				if ( isset( $imported['forms'][ $form_select ] ) ) {
508
-					$f['field_options']['form_select'] = $imported['forms'][ $form_select ];
507
+				if ( isset( $imported['forms'][$form_select] ) ) {
508
+					$f['field_options']['form_select'] = $imported['forms'][$form_select];
509 509
 				}
510 510
 			}
511 511
 		}
@@ -526,8 +526,8 @@  discard block
 block discarded – undo
526 526
 
527 527
 		if ( FrmField::is_option_true_in_array( $f['field_options'], 'get_values_form' ) ) {
528 528
 			$old_form = $f['field_options']['get_values_form'];
529
-			if ( isset( $imported['forms'][ $old_form ] ) ) {
530
-				$f['field_options']['get_values_form'] = $imported['forms'][ $old_form ];
529
+			if ( isset( $imported['forms'][$old_form] ) ) {
530
+				$f['field_options']['get_values_form'] = $imported['forms'][$old_form];
531 531
 			}
532 532
 		}
533 533
 	}
@@ -548,12 +548,12 @@  discard block
 block discarded – undo
548 548
 	private static function migrate_placeholders( &$f ) {
549 549
 		$update_values = self::migrate_field_placeholder( $f, 'clear_on_focus' );
550 550
 		foreach ( $update_values as $k => $v ) {
551
-			$f[ $k ] = $v;
551
+			$f[$k] = $v;
552 552
 		}
553 553
 
554 554
 		$update_values = self::migrate_field_placeholder( $f, 'default_blank' );
555 555
 		foreach ( $update_values as $k => $v ) {
556
-			$f[ $k ] = $v;
556
+			$f[$k] = $v;
557 557
 		}
558 558
 	}
559 559
 
@@ -567,7 +567,7 @@  discard block
 block discarded – undo
567 567
 	public static function migrate_field_placeholder( $field, $type ) {
568 568
 		$field = (array) $field;
569 569
 		$field_options = $field['field_options'];
570
-		if ( empty( $field_options[ $type ] ) || empty( $field['default_value'] ) ) {
570
+		if ( empty( $field_options[$type] ) || empty( $field['default_value'] ) ) {
571 571
 			return array();
572 572
 		}
573 573
 
@@ -593,7 +593,7 @@  discard block
 block discarded – undo
593 593
 				}
594 594
 
595 595
 				if ( $opt == $default_value ) {
596
-					unset( $options[ $opt_key ] );
596
+					unset( $options[$opt_key] );
597 597
 					break;
598 598
 				}
599 599
 			}
@@ -788,17 +788,17 @@  discard block
 block discarded – undo
788 788
 			self::update_postmeta( $post, $post_id );
789 789
 
790 790
 			$this_type = 'posts';
791
-			if ( isset( $post_types[ $post['post_type'] ] ) ) {
792
-				$this_type = $post_types[ $post['post_type'] ];
791
+			if ( isset( $post_types[$post['post_type']] ) ) {
792
+				$this_type = $post_types[$post['post_type']];
793 793
 			}
794 794
 
795 795
 			if ( isset( $post['ID'] ) && $post_id == $post['ID'] ) {
796
-				$imported['updated'][ $this_type ] ++;
796
+				$imported['updated'][$this_type] ++;
797 797
 			} else {
798
-				$imported['imported'][ $this_type ] ++;
798
+				$imported['imported'][$this_type] ++;
799 799
 			}
800 800
 
801
-			$imported['posts'][ (int) $old_id ] = $post_id;
801
+			$imported['posts'][(int) $old_id] = $post_id;
802 802
 
803 803
 			do_action( 'frm_after_import_view', $post_id, $post );
804 804
 
@@ -815,9 +815,9 @@  discard block
 block discarded – undo
815 815
 			$post['attachment_url'] = (string) $item->attachment_url;
816 816
 		}
817 817
 
818
-		if ( $post['post_type'] == FrmFormActionsController::$action_post_type && isset( $imported['forms'][ (int) $post['menu_order'] ] ) ) {
818
+		if ( $post['post_type'] == FrmFormActionsController::$action_post_type && isset( $imported['forms'][(int) $post['menu_order']] ) ) {
819 819
 			// update to new form id
820
-			$post['menu_order'] = $imported['forms'][ (int) $post['menu_order'] ];
820
+			$post['menu_order'] = $imported['forms'][(int) $post['menu_order']];
821 821
 		}
822 822
 
823 823
 		// Don't allow default styles to take over a site's default style
@@ -844,8 +844,8 @@  discard block
 block discarded – undo
844 844
 		);
845 845
 
846 846
 		//switch old form and field ids to new ones
847
-		if ( $m['key'] == 'frm_form_id' && isset( $imported['forms'][ (int) $m['value'] ] ) ) {
848
-			$m['value'] = $imported['forms'][ (int) $m['value'] ];
847
+		if ( $m['key'] == 'frm_form_id' && isset( $imported['forms'][(int) $m['value']] ) ) {
848
+			$m['value'] = $imported['forms'][(int) $m['value']];
849 849
 		} else {
850 850
 			$m['value'] = FrmAppHelper::maybe_json_decode( $m['value'] );
851 851
 
@@ -856,15 +856,15 @@  discard block
 block discarded – undo
856 856
 				} elseif ( $m['key'] == 'frm_options' ) {
857 857
 
858 858
 					foreach ( array( 'date_field_id', 'edate_field_id' ) as $setting_name ) {
859
-						if ( isset( $m['value'][ $setting_name ] ) && is_numeric( $m['value'][ $setting_name ] ) && isset( $frm_duplicate_ids[ $m['value'][ $setting_name ] ] ) ) {
860
-							$m['value'][ $setting_name ] = $frm_duplicate_ids[ $m['value'][ $setting_name ] ];
859
+						if ( isset( $m['value'][$setting_name] ) && is_numeric( $m['value'][$setting_name] ) && isset( $frm_duplicate_ids[$m['value'][$setting_name]] ) ) {
860
+							$m['value'][$setting_name] = $frm_duplicate_ids[$m['value'][$setting_name]];
861 861
 						}
862 862
 					}
863 863
 
864 864
 					$check_dup_array = array();
865 865
 					if ( isset( $m['value']['order_by'] ) && ! empty( $m['value']['order_by'] ) ) {
866
-						if ( is_numeric( $m['value']['order_by'] ) && isset( $frm_duplicate_ids[ $m['value']['order_by'] ] ) ) {
867
-							$m['value']['order_by'] = $frm_duplicate_ids[ $m['value']['order_by'] ];
866
+						if ( is_numeric( $m['value']['order_by'] ) && isset( $frm_duplicate_ids[$m['value']['order_by']] ) ) {
867
+							$m['value']['order_by'] = $frm_duplicate_ids[$m['value']['order_by']];
868 868
 						} elseif ( is_array( $m['value']['order_by'] ) ) {
869 869
 							$check_dup_array[] = 'order_by';
870 870
 						}
@@ -875,9 +875,9 @@  discard block
 block discarded – undo
875 875
 					}
876 876
 
877 877
 					foreach ( $check_dup_array as $check_k ) {
878
-						foreach ( (array) $m['value'][ $check_k ] as $mk => $mv ) {
879
-							if ( isset( $frm_duplicate_ids[ $mv ] ) ) {
880
-								$m['value'][ $check_k ][ $mk ] = $frm_duplicate_ids[ $mv ];
878
+						foreach ( (array) $m['value'][$check_k] as $mk => $mv ) {
879
+							if ( isset( $frm_duplicate_ids[$mv] ) ) {
880
+								$m['value'][$check_k][$mk] = $frm_duplicate_ids[$mv];
881 881
 							}
882 882
 							unset( $mk, $mv );
883 883
 						}
@@ -890,7 +890,7 @@  discard block
 block discarded – undo
890 890
 			$m['value'] = FrmAppHelper::maybe_json_decode( $m['value'] );
891 891
 		}
892 892
 
893
-		$post['postmeta'][ (string) $meta->meta_key ] = $m['value'];
893
+		$post['postmeta'][(string) $meta->meta_key] = $m['value'];
894 894
 	}
895 895
 
896 896
 	/**
@@ -918,11 +918,11 @@  discard block
 block discarded – undo
918 918
 				$name = (string) $c;
919 919
 			}
920 920
 
921
-			if ( ! isset( $post['tax_input'][ $taxonomy ] ) ) {
922
-				$post['tax_input'][ $taxonomy ] = array();
921
+			if ( ! isset( $post['tax_input'][$taxonomy] ) ) {
922
+				$post['tax_input'][$taxonomy] = array();
923 923
 			}
924 924
 
925
-			$post['tax_input'][ $taxonomy ][] = $name;
925
+			$post['tax_input'][$taxonomy][] = $name;
926 926
 			unset( $name );
927 927
 		}
928 928
 	}
@@ -1021,7 +1021,7 @@  discard block
 block discarded – undo
1021 1021
 
1022 1022
 		$message = '<ul>';
1023 1023
 		foreach ( $result as $type => $results ) {
1024
-			if ( ! isset( $t_strings[ $type ] ) ) {
1024
+			if ( ! isset( $t_strings[$type] ) ) {
1025 1025
 				// only print imported and updated
1026 1026
 				continue;
1027 1027
 			}
@@ -1033,7 +1033,7 @@  discard block
 block discarded – undo
1033 1033
 			}
1034 1034
 
1035 1035
 			if ( ! empty( $s_message ) ) {
1036
-				$message .= '<li><strong>' . $t_strings[ $type ] . ':</strong> ';
1036
+				$message .= '<li><strong>' . $t_strings[$type] . ':</strong> ';
1037 1037
 				$message .= implode( ', ', $s_message );
1038 1038
 				$message .= '</li>';
1039 1039
 			}
@@ -1073,7 +1073,7 @@  discard block
 block discarded – undo
1073 1073
 			'actions' => sprintf( _n( '%1$s Form Action', '%1$s Form Actions', $m, 'formidable' ), $m ),
1074 1074
 		);
1075 1075
 
1076
-		$s_message[] = isset( $strings[ $type ] ) ? $strings[ $type ] : ' ' . $m . ' ' . ucfirst( $type );
1076
+		$s_message[] = isset( $strings[$type] ) ? $strings[$type] : ' ' . $m . ' ' . ucfirst( $type );
1077 1077
 	}
1078 1078
 
1079 1079
 	/**
@@ -1205,10 +1205,10 @@  discard block
 block discarded – undo
1205 1205
 		$array_defaults = array_filter( $defaults, 'is_array' );
1206 1206
 		foreach ( $array_defaults as $d => $default ) {
1207 1207
 			// compare array defaults
1208
-			if ( $default == $saved[ $d ] ) {
1209
-				unset( $saved[ $d ] );
1208
+			if ( $default == $saved[$d] ) {
1209
+				unset( $saved[$d] );
1210 1210
 			}
1211
-			unset( $defaults[ $d ] );
1211
+			unset( $defaults[$d] );
1212 1212
 		}
1213 1213
 		$saved = array_diff_assoc( (array) $saved, $defaults );
1214 1214
 	}
@@ -1219,14 +1219,14 @@  discard block
 block discarded – undo
1219 1219
 	 * @since 3.06
1220 1220
 	 */
1221 1221
 	private static function remove_default_html( $html_name, $defaults, &$options ) {
1222
-		if ( ! isset( $options[ $html_name ] ) || ! isset( $defaults[ $html_name ] ) ) {
1222
+		if ( ! isset( $options[$html_name] ) || ! isset( $defaults[$html_name] ) ) {
1223 1223
 			return;
1224 1224
 		}
1225 1225
 
1226
-		$old_html     = str_replace( "\r\n", "\n", $options[ $html_name ] );
1227
-		$default_html = $defaults[ $html_name ];
1226
+		$old_html     = str_replace( "\r\n", "\n", $options[$html_name] );
1227
+		$default_html = $defaults[$html_name];
1228 1228
 		if ( $old_html == $default_html ) {
1229
-			unset( $options[ $html_name ] );
1229
+			unset( $options[$html_name] );
1230 1230
 
1231 1231
 			return;
1232 1232
 		}
@@ -1234,7 +1234,7 @@  discard block
 block discarded – undo
1234 1234
 		// Account for some of the older field default HTML.
1235 1235
 		$default_html = str_replace( ' id="frm_desc_field_[key]"', '', $default_html );
1236 1236
 		if ( $old_html == $default_html ) {
1237
-			unset( $options[ $html_name ] );
1237
+			unset( $options[$html_name] );
1238 1238
 		}
1239 1239
 	}
1240 1240
 
@@ -1320,8 +1320,8 @@  discard block
 block discarded – undo
1320 1320
 		);
1321 1321
 
1322 1322
 		foreach ( $post_settings as $post_setting ) {
1323
-			if ( isset( $form_options[ $post_setting ] ) ) {
1324
-				$new_action['post_content'][ $post_setting ] = $form_options[ $post_setting ];
1323
+			if ( isset( $form_options[$post_setting] ) ) {
1324
+				$new_action['post_content'][$post_setting] = $form_options[$post_setting];
1325 1325
 			}
1326 1326
 			unset( $post_setting );
1327 1327
 		}
@@ -1391,11 +1391,11 @@  discard block
 block discarded – undo
1391 1391
 		foreach ( $post_content as $key => $setting ) {
1392 1392
 			if ( ! is_array( $setting ) && in_array( $key, $basic_fields ) ) {
1393 1393
 				// Replace old IDs with new IDs
1394
-				$post_content[ $key ] = str_replace( $old, $new, $setting );
1394
+				$post_content[$key] = str_replace( $old, $new, $setting );
1395 1395
 			} elseif ( is_array( $setting ) && in_array( $key, $array_fields ) ) {
1396 1396
 				foreach ( $setting as $k => $val ) {
1397 1397
 					// Replace old IDs with new IDs
1398
-					$post_content[ $key ][ $k ] = str_replace( $old, $new, $val );
1398
+					$post_content[$key][$k] = str_replace( $old, $new, $val );
1399 1399
 				}
1400 1400
 			}
1401 1401
 			unset( $key, $setting );
@@ -1471,8 +1471,8 @@  discard block
 block discarded – undo
1471 1471
 	private static function remove_deprecated_notification_settings( $form_id, $form_options ) {
1472 1472
 		$delete_settings = array( 'notification', 'autoresponder', 'email_to' );
1473 1473
 		foreach ( $delete_settings as $index ) {
1474
-			if ( isset( $form_options[ $index ] ) ) {
1475
-				unset( $form_options[ $index ] );
1474
+			if ( isset( $form_options[$index] ) ) {
1475
+				unset( $form_options[$index] );
1476 1476
 			}
1477 1477
 		}
1478 1478
 		FrmForm::update( $form_id, array( 'options' => $form_options ) );
@@ -1525,12 +1525,12 @@  discard block
 block discarded – undo
1525 1525
 			'reply_to_name' => '',
1526 1526
 		);
1527 1527
 		foreach ( $reply_fields as $f => $val ) {
1528
-			if ( isset( $notification[ $f ] ) ) {
1529
-				$atts[ $f ] = $notification[ $f ];
1530
-				if ( 'custom' == $notification[ $f ] ) {
1531
-					$atts[ $f ] = $notification[ 'cust_' . $f ];
1532
-				} elseif ( is_numeric( $atts[ $f ] ) && ! empty( $atts[ $f ] ) ) {
1533
-					$atts[ $f ] = '[' . $atts[ $f ] . ']';
1528
+			if ( isset( $notification[$f] ) ) {
1529
+				$atts[$f] = $notification[$f];
1530
+				if ( 'custom' == $notification[$f] ) {
1531
+					$atts[$f] = $notification['cust_' . $f];
1532
+				} elseif ( is_numeric( $atts[$f] ) && ! empty( $atts[$f] ) ) {
1533
+					$atts[$f] = '[' . $atts[$f] . ']';
1534 1534
 				}
1535 1535
 			}
1536 1536
 			unset( $f, $val );
@@ -1561,13 +1561,13 @@  discard block
 block discarded – undo
1561 1561
 		foreach ( $atts['email_to'] as $key => $email_field ) {
1562 1562
 
1563 1563
 			if ( is_numeric( $email_field ) ) {
1564
-				$atts['email_to'][ $key ] = '[' . $email_field . ']';
1564
+				$atts['email_to'][$key] = '[' . $email_field . ']';
1565 1565
 			}
1566 1566
 
1567 1567
 			if ( strpos( $email_field, '|' ) ) {
1568 1568
 				$email_opt = explode( '|', $email_field );
1569 1569
 				if ( isset( $email_opt[0] ) ) {
1570
-					$atts['email_to'][ $key ] = '[' . $email_opt[0] . ' show=' . $email_opt[1] . ']';
1570
+					$atts['email_to'][$key] = '[' . $email_opt[0] . ' show=' . $email_opt[1] . ']';
1571 1571
 				}
1572 1572
 				unset( $email_opt );
1573 1573
 			}
@@ -1588,12 +1588,12 @@  discard block
 block discarded – undo
1588 1588
 		// Add more fields to the new notification
1589 1589
 		$add_fields = array( 'email_message', 'email_subject', 'plain_text', 'inc_user_info', 'conditions' );
1590 1590
 		foreach ( $add_fields as $add_field ) {
1591
-			if ( isset( $notification[ $add_field ] ) ) {
1592
-				$new_notification['post_content'][ $add_field ] = $notification[ $add_field ];
1591
+			if ( isset( $notification[$add_field] ) ) {
1592
+				$new_notification['post_content'][$add_field] = $notification[$add_field];
1593 1593
 			} elseif ( in_array( $add_field, array( 'plain_text', 'inc_user_info' ) ) ) {
1594
-				$new_notification['post_content'][ $add_field ] = 0;
1594
+				$new_notification['post_content'][$add_field] = 0;
1595 1595
 			} else {
1596
-				$new_notification['post_content'][ $add_field ] = '';
1596
+				$new_notification['post_content'][$add_field] = '';
1597 1597
 			}
1598 1598
 			unset( $add_field );
1599 1599
 		}
@@ -1617,7 +1617,7 @@  discard block
 block discarded – undo
1617 1617
 		if ( isset( $post_content['conditions'] ) && is_array( $post_content['conditions'] ) ) {
1618 1618
 			foreach ( $post_content['conditions'] as $email_key => $val ) {
1619 1619
 				if ( is_numeric( $email_key ) ) {
1620
-					$post_content['conditions'][ $email_key ] = self::switch_action_field_ids( $val, array( 'hide_field' ) );
1620
+					$post_content['conditions'][$email_key] = self::switch_action_field_ids( $val, array( 'hide_field' ) );
1621 1621
 				}
1622 1622
 				unset( $email_key, $val );
1623 1623
 			}
Please login to merge, or discard this patch.
Doc Comments   +10 added lines, -3 removed lines patch added patch discarded remove patch
@@ -562,6 +562,7 @@  discard block
 block discarded – undo
562 562
 	 * Also called during database migration in FrmMigrate.
563 563
 	 *
564 564
 	 * @since 4.0
565
+	 * @param string $type
565 566
 	 * @return array
566 567
 	 */
567 568
 	public static function migrate_field_placeholder( $field, $type ) {
@@ -1217,6 +1218,7 @@  discard block
 block discarded – undo
1217 1218
 	 * The line endings may prevent html from being equal when it should
1218 1219
 	 *
1219 1220
 	 * @since 3.06
1221
+	 * @param string $html_name
1220 1222
 	 */
1221 1223
 	private static function remove_default_html( $html_name, $defaults, &$options ) {
1222 1224
 		if ( ! isset( $options[ $html_name ] ) || ! isset( $defaults[ $html_name ] ) ) {
@@ -1290,6 +1292,7 @@  discard block
 block discarded – undo
1290 1292
 	 * Migrate post settings to form action
1291 1293
 	 *
1292 1294
 	 * @param string $post_type
1295
+	 * @param boolean $switch
1293 1296
 	 */
1294 1297
 	private static function migrate_post_settings_to_action( $form_options, $form_id, $post_type, &$imported, $switch ) {
1295 1298
 		if ( ! isset( $form_options['create_post'] ) || ! $form_options['create_post'] ) {
@@ -1368,8 +1371,8 @@  discard block
 block discarded – undo
1368 1371
 	 * @since 2.0
1369 1372
 	 *
1370 1373
 	 * @param array $post_content - check for old field IDs
1371
-	 * @param array $basic_fields - fields with string or int saved
1372
-	 * @param array $array_fields - fields with arrays saved
1374
+	 * @param string[] $basic_fields - fields with string or int saved
1375
+	 * @param string[] $array_fields - fields with arrays saved
1373 1376
 	 *
1374 1377
 	 * @return string $post_content - new field IDs
1375 1378
 	 */
@@ -1404,6 +1407,10 @@  discard block
 block discarded – undo
1404 1407
 		return $post_content;
1405 1408
 	}
1406 1409
 
1410
+	/**
1411
+	 * @param string $post_type
1412
+	 * @param boolean $switch
1413
+	 */
1407 1414
 	private static function migrate_email_settings_to_action( $form_options, $form_id, $post_type, &$imported, $switch ) {
1408 1415
 		// No old notifications or autoresponders to carry over
1409 1416
 		if ( ! isset( $form_options['auto_responder'] ) && ! isset( $form_options['notification'] ) && ! isset( $form_options['email_to'] ) ) {
@@ -1671,8 +1678,8 @@  discard block
 block discarded – undo
1671 1678
 	/**
1672 1679
 	 * PHP 8 backward compatibility for the libxml_disable_entity_loader function
1673 1680
 	 *
1674
-	 * @param  boolean $disable
1675 1681
 	 *
1682
+	 * @param boolean $loader
1676 1683
 	 * @return boolean
1677 1684
 	 */
1678 1685
 	public static function maybe_libxml_disable_entity_loader( $loader ) {
Please login to merge, or discard this patch.
classes/views/solutions/_import.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
 				$info['url'] = $xml;
7 7
 			}
8 8
 
9
-			$disabled = isset( $imported[ $info['form'] ] ) ? ' disabled' : '';
9
+			$disabled = isset( $imported[$info['form']] ) ? ' disabled' : '';
10 10
 			$url   = isset( $info['url'] ) ? $info['url'] : '';
11 11
 			$value = $importing === 'form' ? $info['form'] : $info['key'];
12 12
 			if ( ! isset( $info['img'] ) ) {
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 				continue;
17 17
 			}
18 18
 
19
-			$hide_views = $importing === 'view' && ( ( $selected && $info['form'] !== $selected ) || isset( $imported[ $info['form'] ] ) );
19
+			$hide_views = $importing === 'view' && ( ( $selected && $info['form'] !== $selected ) || isset( $imported[$info['form']] ) );
20 20
 			?>
21 21
 			<div class="frm_radio radio-inline radio frm_image_option<?php echo esc_attr( $importing === 'view' ? ' show_sub_opt show_' . $info['form'] : '' ); ?>" style="<?php echo esc_attr( $hide_views ? 'display:none' : '' ); ?>">
22 22
 				<?php if ( $importing === 'form' ) { ?>
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 					<?php } ?>
37 37
 					/>
38 38
 					<div class="frm_image_option_container frm_label_with_image">
39
-						<?php echo FrmAppHelper::kses( $info['img'], array( 'svg', 'rect', 'path' ) );  // WPCS: XSS ok. ?>
39
+						<?php echo FrmAppHelper::kses( $info['img'], array( 'svg', 'rect', 'path' ) ); // WPCS: XSS ok. ?>
40 40
 						<span class="frm_text_label_for_image">
41 41
 							<?php
42 42
 							if ( ! empty( $disabled ) ) {
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 							}
50 50
 
51 51
 							if ( $importing === 'form' && $disabled ) {
52
-								echo FrmFormsHelper::edit_form_link( $imported[ $info['form'] ] ); // WPCS: XSS ok.
52
+								echo FrmFormsHelper::edit_form_link( $imported[$info['form']] ); // WPCS: XSS ok.
53 53
 							} else {
54 54
 								echo esc_html( $info['name'] );
55 55
 							}
Please login to merge, or discard this patch.
classes/models/fields/FrmFieldCaptcha.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -144,11 +144,11 @@
 block discarded – undo
144 144
 		if ( isset( $response['success'] ) && ! $response['success'] ) {
145 145
 			// What happens when the CAPTCHA was entered incorrectly
146 146
 			$invalid_message                 = FrmField::get_option( $this->field, 'invalid' );
147
-			$errors[ 'field' . $args['id'] ] = ( $invalid_message == '' ? $frm_settings->re_msg : $invalid_message );
147
+			$errors['field' . $args['id']] = ( $invalid_message == '' ? $frm_settings->re_msg : $invalid_message );
148 148
 		} elseif ( is_wp_error( $resp ) ) {
149 149
 			$error_string                     = $resp->get_error_message();
150
-			$errors[ 'field' . $args['id'] ]  = __( 'There was a problem verifying your recaptcha', 'formidable' );
151
-			$errors[ 'field' . $args['id'] ] .= ' ' . $error_string;
150
+			$errors['field' . $args['id']]  = __( 'There was a problem verifying your recaptcha', 'formidable' );
151
+			$errors['field' . $args['id']] .= ' ' . $error_string;
152 152
 		}
153 153
 
154 154
 		return $errors;
Please login to merge, or discard this patch.
classes/models/FrmFieldFormHtml.php 1 patch
Spacing   +12 added lines, -12 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
 
87 87
 		$exclude = array( 'field_obj', 'html' );
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
 
@@ -359,7 +359,7 @@  discard block
 block discarded – undo
359 359
 			unset( $shortcode_atts['class'] );
360 360
 		}
361 361
 
362
-		$shortcode_atts['aria-invalid'] = isset( $this->pass_args['errors'][ 'field' . $this->field_id ] ) ? 'true' : 'false';
362
+		$shortcode_atts['aria-invalid'] = isset( $this->pass_args['errors']['field' . $this->field_id] ) ? 'true' : 'false';
363 363
 
364 364
 		$this->field_obj->set_field_column( 'shortcodes', $shortcode_atts );
365 365
 
@@ -414,7 +414,7 @@  discard block
 block discarded – undo
414 414
 	 */
415 415
 	private function get_field_div_classes() {
416 416
 		// Add error class
417
-		$classes = isset( $this->pass_args['errors'][ 'field' . $this->field_id ] ) ? ' frm_blank_field' : '';
417
+		$classes = isset( $this->pass_args['errors']['field' . $this->field_id] ) ? ' frm_blank_field' : '';
418 418
 
419 419
 		// Add label position class
420 420
 		$settings = $this->field_obj->display_field_settings();
Please login to merge, or discard this patch.
classes/views/frm-fields/back-end/field-multiple.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,6 +9,6 @@
 block discarded – undo
9 9
 	$type = $field['type'];
10 10
 	do_action( 'frm_after_checkbox', compact( 'field', 'field_name', 'type' ) );
11 11
 } else {
12
-	$read_only  = $field['read_only'];
12
+	$read_only = $field['read_only'];
13 13
 	include dirname( __FILE__ ) . '/' . $field['type'] . '-field.php';
14 14
 }
Please login to merge, or discard this patch.
classes/views/frm-forms/list-templates.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -16,8 +16,8 @@  discard block
 block discarded – undo
16 16
 	</li><?php
17 17
 	$render_icon = true;
18 18
 	foreach ( array( 20872734, 20874748, 20882522, 20874739 ) as $template ) {
19
-		if ( isset( $templates[ $template ] ) ) {
20
-			$template = $templates[ $template ];
19
+		if ( isset( $templates[$template] ) ) {
20
+			$template = $templates[$template];
21 21
 			require $view_path . 'list-template.php';
22 22
 		}
23 23
 	}
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 	<ul class="frm-templates-list frm-categories-list">
46 46
 		<?php foreach ( $categories as $category ) { ?>
47 47
 			<?php
48
-			$category_templates = $templates_by_category[ $category ];
48
+			$category_templates = $templates_by_category[$category];
49 49
 			$count              = count( $category_templates );
50 50
 			$available          = FrmFormsHelper::available_count( $category_templates, $args );
51 51
 			?>
Please login to merge, or discard this patch.
classes/controllers/FrmAppController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -283,7 +283,7 @@
 block discarded – undo
283 283
 				'content' => 'upgrade',
284 284
 			)
285 285
 		);
286
-		$renew_link       = FrmAppHelper::admin_upgrade_link(
286
+		$renew_link = FrmAppHelper::admin_upgrade_link(
287 287
 			array(
288 288
 				'medium'  => 'new-template',
289 289
 				'content' => 'renew',
Please login to merge, or discard this patch.
classes/helpers/FrmFormsHelper.php 2 patches
Spacing   +22 added lines, -22 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
 
@@ -276,8 +276,8 @@  discard block
 block discarded – undo
276 276
 			'description' => '',
277 277
 		);
278 278
 		foreach ( $defaults as $var => $default ) {
279
-			if ( ! isset( $values[ $var ] ) ) {
280
-				$values[ $var ] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' );
279
+			if ( ! isset( $values[$var] ) ) {
280
+				$values[$var] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' );
281 281
 			}
282 282
 		}
283 283
 
@@ -292,8 +292,8 @@  discard block
 block discarded – undo
292 292
 			'parent_form_id' => 0,
293 293
 		);
294 294
 		foreach ( $defaults as $var => $default ) {
295
-			if ( ! isset( $values[ $var ] ) ) {
296
-				$values[ $var ] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' );
295
+			if ( ! isset( $values[$var] ) ) {
296
+				$values[$var] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' );
297 297
 			}
298 298
 		}
299 299
 		unset( $defaults );
@@ -330,16 +330,16 @@  discard block
 block discarded – undo
330 330
 		$defaults = self::get_default_opts();
331 331
 		foreach ( $defaults as $var => $default ) {
332 332
 			if ( is_array( $default ) ) {
333
-				if ( ! isset( $values[ $var ] ) ) {
334
-					$values[ $var ] = ( $record && isset( $record->options[ $var ] ) ) ? $record->options[ $var ] : array();
333
+				if ( ! isset( $values[$var] ) ) {
334
+					$values[$var] = ( $record && isset( $record->options[$var] ) ) ? $record->options[$var] : array();
335 335
 				}
336 336
 
337 337
 				foreach ( $default as $k => $v ) {
338
-					$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 );
338
+					$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 );
339 339
 
340 340
 					if ( is_array( $v ) ) {
341 341
 						foreach ( $v as $k1 => $v1 ) {
342
-							$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 );
342
+							$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 );
343 343
 							unset( $k1, $v1 );
344 344
 						}
345 345
 					}
@@ -347,7 +347,7 @@  discard block
 block discarded – undo
347 347
 					unset( $k, $v );
348 348
 				}
349 349
 			} else {
350
-				$values[ $var ] = ( $post_values && isset( $post_values['options'][ $var ] ) ) ? $post_values['options'][ $var ] : ( ( $record && isset( $record->options[ $var ] ) ) ? $record->options[ $var ] : $default );
350
+				$values[$var] = ( $post_values && isset( $post_values['options'][$var] ) ) ? $post_values['options'][$var] : ( ( $record && isset( $record->options[$var] ) ) ? $record->options[$var] : $default );
351 351
 			}
352 352
 
353 353
 			unset( $var, $default );
@@ -385,7 +385,7 @@  discard block
 block discarded – undo
385 385
 	public static function fill_form_options( &$options, $values ) {
386 386
 		$defaults = self::get_default_opts();
387 387
 		foreach ( $defaults as $var => $default ) {
388
-			$options[ $var ] = isset( $values['options'][ $var ] ) ? $values['options'][ $var ] : $default;
388
+			$options[$var] = isset( $values['options'][$var] ) ? $values['options'][$var] : $default;
389 389
 			unset( $var, $default );
390 390
 		}
391 391
 	}
@@ -541,7 +541,7 @@  discard block
 block discarded – undo
541 541
 	public static function insert_opt_html( $args ) {
542 542
 		$class  = isset( $args['class'] ) ? $args['class'] : '';
543 543
 		$fields = FrmField::all_field_selection();
544
-		$field  = isset( $fields[ $args['type'] ] ) ? $fields[ $args['type'] ] : array();
544
+		$field  = isset( $fields[$args['type']] ) ? $fields[$args['type']] : array();
545 545
 
546 546
 		self::prepare_field_type( $field );
547 547
 
@@ -693,7 +693,7 @@  discard block
 block discarded – undo
693 693
 			FrmField::update( $field->id, array( 'field_order' => $field->field_order + 2 ) );
694 694
 		}
695 695
 
696
-		$add_order    += 2;
696
+		$add_order += 2;
697 697
 		$open         = false;
698 698
 		$reset_fields = true;
699 699
 	}
@@ -1045,10 +1045,10 @@  discard block
 block discarded – undo
1045 1045
 				$link .= ' onclick="return confirm(\'' . esc_attr( $link_details['confirm'] ) . '\')"';
1046 1046
 			}
1047 1047
 
1048
-			$label = ( isset( $link_details[ $length ] ) ? $link_details[ $length ] : $link_details['label'] );
1049
-			if ( $length == 'icon' && isset( $link_details[ $length ] ) ) {
1048
+			$label = ( isset( $link_details[$length] ) ? $link_details[$length] : $link_details['label'] );
1049
+			if ( $length == 'icon' && isset( $link_details[$length] ) ) {
1050 1050
 				$label = '<span class="' . $label . '" title="' . esc_attr( $link_details['label'] ) . '" aria-hidden="true"></span>';
1051
-				$link  .= ' aria-label="' . esc_attr( $link_details['label'] ) . '"';
1051
+				$link .= ' aria-label="' . esc_attr( $link_details['label'] ) . '"';
1052 1052
 			}
1053 1053
 
1054 1054
 			$link .= '>' . $label . '</a>';
@@ -1204,7 +1204,7 @@  discard block
 block discarded – undo
1204 1204
 			$status = 'publish';
1205 1205
 		}
1206 1206
 
1207
-		$name = $nice_names[ $status ];
1207
+		$name = $nice_names[$status];
1208 1208
 
1209 1209
 		return $name;
1210 1210
 	}
@@ -1237,17 +1237,17 @@  discard block
 block discarded – undo
1237 1237
 			''                    => array( 'align_right' ),
1238 1238
 		);
1239 1239
 
1240
-		$icons[ __( 'My Templates', 'formidable' ) ] = array( 'user', 'var(--orange)' );
1240
+		$icons[__( 'My Templates', 'formidable' )] = array( 'user', 'var(--orange)' );
1241 1241
 
1242 1242
 		$icon = $icons[''];
1243 1243
 
1244 1244
 		if ( count( $categories ) === 1 ) {
1245 1245
 			$category = reset( $categories );
1246
-			$icon     = isset( $icons[ $category ] ) ? $icons[ $category ] : $icon;
1246
+			$icon     = isset( $icons[$category] ) ? $icons[$category] : $icon;
1247 1247
 		} elseif ( ! empty( $categories ) ) {
1248 1248
 			foreach ( $icons as $cat => $icon ) {
1249 1249
 				if ( ! in_array( $cat, $categories ) ) {
1250
-					unset( $icons[ $cat ] );
1250
+					unset( $icons[$cat] );
1251 1251
 				}
1252 1252
 			}
1253 1253
 			$icon = reset( $icons );
@@ -1373,7 +1373,7 @@  discard block
 block discarded – undo
1373 1373
 
1374 1374
 		foreach ( $item['categories'] as $k => $category ) {
1375 1375
 			if ( in_array( $category, $plans, true ) ) {
1376
-				unset( $item['categories'][ $k ] );
1376
+				unset( $item['categories'][$k] );
1377 1377
 
1378 1378
 				if ( $category === 'Personal' ) {
1379 1379
 					// Show the current package name.
Please login to merge, or discard this patch.
Doc Comments   +11 added lines, -4 removed lines patch added patch discarded remove patch
@@ -219,6 +219,7 @@  discard block
 block discarded – undo
219 219
 
220 220
 	/**
221 221
 	 * @since 3.0
222
+	 * @return string
222 223
 	 */
223 224
 	public static function get_field_link_icon( $field_type ) {
224 225
 		if ( is_array( $field_type ) && isset( $field_type['icon'] ) ) {
@@ -698,6 +699,9 @@  discard block
 block discarded – undo
698 699
 		$reset_fields = true;
699 700
 	}
700 701
 
702
+	/**
703
+	 * @return string
704
+	 */
701 705
 	public static function replace_shortcodes( $html, $form, $title = false, $description = false, $values = array() ) {
702 706
 		$codes = array(
703 707
 			'form_name'        => $title,
@@ -858,7 +862,7 @@  discard block
 block discarded – undo
858 862
 	}
859 863
 
860 864
 	/**
861
-	 * @param object|string|boolean $form
865
+	 * @param string|boolean $form
862 866
 	 *
863 867
 	 * @return string
864 868
 	 */
@@ -1018,6 +1022,9 @@  discard block
 block discarded – undo
1018 1022
 		return $link;
1019 1023
 	}
1020 1024
 
1025
+	/**
1026
+	 * @return integer
1027
+	 */
1021 1028
 	public static function edit_form_link_label( $data ) {
1022 1029
 		$name = self::get_form_name_from_data( $data );
1023 1030
 		if ( ! $name ) {
@@ -1444,7 +1451,7 @@  discard block
 block discarded – undo
1444 1451
 	 *
1445 1452
 	 * @param array $values The $_POST array, which contains the values submitted in a form.
1446 1453
 	 *
1447
-	 * @return bool|string A warning message about unsafe params or false.
1454
+	 * @return false|string A warning message about unsafe params or false.
1448 1455
 	 */
1449 1456
 	private static function check_redirect_url_for_unsafe_params( $values ) {
1450 1457
 		if ( ! isset( $values['options'] ) ) {
@@ -1492,7 +1499,7 @@  discard block
 block discarded – undo
1492 1499
 	 *
1493 1500
 	 * @param array $unsafe_params_in_redirect Array of params from the redirect URL whose names are reserved words.
1494 1501
 	 *
1495
-	 * @return bool|string A string with an unsafe param message or false.
1502
+	 * @return false|string A string with an unsafe param message or false.
1496 1503
 	 */
1497 1504
 	private static function create_unsafe_param_warning( $unsafe_params_in_redirect ) {
1498 1505
 		$count                = count( $unsafe_params_in_redirect );
@@ -1523,7 +1530,7 @@  discard block
 block discarded – undo
1523 1530
 	 *
1524 1531
 	 * @since 4.04
1525 1532
 	 *
1526
-	 * @return array Array of WordPress reserved words.
1533
+	 * @return string[] Array of WordPress reserved words.
1527 1534
 	 */
1528 1535
 	public static function reserved_words() {
1529 1536
 		return array(
Please login to merge, or discard this patch.
classes/controllers/FrmAddonsController.php 2 patches
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 		} else {
75 75
 			foreach ( $addons as $k => $addon ) {
76 76
 				if ( empty( $addon['excerpt'] ) && $k !== 'error' ) {
77
-					unset( $addons[ $k ] );
77
+					unset( $addons[$k] );
78 78
 				}
79 79
 			}
80 80
 		}
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
 
171 171
 		foreach ( $list as $k => $info ) {
172 172
 			$info['slug'] = $k;
173
-			$list[ $k ]   = array_merge( $defaults, $info );
173
+			$list[$k]   = array_merge( $defaults, $info );
174 174
 		}
175 175
 		return $list;
176 176
 	}
@@ -349,16 +349,16 @@  discard block
 block discarded – undo
349 349
 				continue;
350 350
 			}
351 351
 
352
-			$wp_plugin  = isset( $wp_plugins[ $folder ] ) ? $wp_plugins[ $folder ] : array();
352
+			$wp_plugin  = isset( $wp_plugins[$folder] ) ? $wp_plugins[$folder] : array();
353 353
 			$wp_version = isset( $wp_plugin['Version'] ) ? $wp_plugin['Version'] : '1.0';
354 354
 
355 355
 			if ( version_compare( $wp_version, $plugin->new_version, '<' ) ) {
356 356
 				$slug                           = explode( '/', $folder );
357 357
 				$plugin->slug                   = $slug[0];
358
-				$transient->response[ $folder ] = $plugin;
358
+				$transient->response[$folder] = $plugin;
359 359
 			}
360 360
 
361
-			$transient->checked[ $folder ] = $wp_version;
361
+			$transient->checked[$folder] = $wp_version;
362 362
 
363 363
 		}
364 364
 
@@ -381,7 +381,7 @@  discard block
 block discarded – undo
381 381
 
382 382
 		$all_plugins = get_plugins();
383 383
 
384
-		return isset( $all_plugins[ $plugin ] );
384
+		return isset( $all_plugins[$plugin] );
385 385
 	}
386 386
 
387 387
 	/**
@@ -420,13 +420,13 @@  discard block
 block discarded – undo
420 420
 			}
421 421
 
422 422
 			$download_id = isset( $plugin['id'] ) ? $plugin['id'] : 0;
423
-			if ( ! empty( $download_id ) && ! isset( $version_info[ $download_id ]['package'] ) ) {
423
+			if ( ! empty( $download_id ) && ! isset( $version_info[$download_id]['package'] ) ) {
424 424
 				// if this addon is using its own license, get the update url
425 425
 				$addon_info = $api->get_api_info();
426 426
 
427
-				$version_info[ $download_id ] = $addon_info[ $download_id ];
427
+				$version_info[$download_id] = $addon_info[$download_id];
428 428
 				if ( isset( $addon_info['error'] ) ) {
429
-					$version_info[ $download_id ]['error'] = array(
429
+					$version_info[$download_id]['error'] = array(
430 430
 						'message' => $addon_info['error']['message'],
431 431
 						'code'    => $addon_info['error']['code'],
432 432
 					);
@@ -520,8 +520,8 @@  discard block
 block discarded – undo
520 520
 					return $addon;
521 521
 				}
522 522
 			}
523
-		} elseif ( isset( $addons[ $download_id ] ) ) {
524
-			$plugin = $addons[ $download_id ];
523
+		} elseif ( isset( $addons[$download_id] ) ) {
524
+			$plugin = $addons[$download_id];
525 525
 		}
526 526
 
527 527
 		return $plugin;
@@ -575,7 +575,7 @@  discard block
 block discarded – undo
575 575
 			self::prepare_addon_link( $addon['link'] );
576 576
 
577 577
 			self::set_addon_status( $addon );
578
-			$addons[ $id ] = $addon;
578
+			$addons[$id] = $addon;
579 579
 		}
580 580
 	}
581 581
 
@@ -593,7 +593,7 @@  discard block
 block discarded – undo
593 593
 			'utm_medium'   => 'addons',
594 594
 			'utm_campaign' => 'liteplugin',
595 595
 		);
596
-		$link       = add_query_arg( $query_args, $link );
596
+		$link = add_query_arg( $query_args, $link );
597 597
 	}
598 598
 
599 599
 	/**
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -4 removed lines patch added patch discarded remove patch
@@ -564,6 +564,7 @@  discard block
 block discarded – undo
564 564
 
565 565
 	/**
566 566
 	 * @since 3.04.02
567
+	 * @param string $link
567 568
 	 */
568 569
 	protected static function prepare_addon_link( &$link ) {
569 570
 		$site_url = 'https://formidableforms.com/';
@@ -1100,10 +1101,6 @@  discard block
 block discarded – undo
1100 1101
 	 * Render a conditional action button for an add on
1101 1102
 	 *
1102 1103
 	 * @since 4.09.01
1103
-	 * @param array $addon
1104
-	 * @param string|false $license_type
1105
-	 * @param string $plan_required
1106
-	 * @param string $upgrade_link
1107 1104
 	 */
1108 1105
 	public static function show_conditional_action_button( $atts ) {
1109 1106
 		if ( is_callable( 'FrmProAddonsController::show_conditional_action_button' ) ) {
Please login to merge, or discard this patch.