Completed
Push — master ( d12974...745295 )
by Stephanie
17s queued 11s
created
classes/views/frm-forms/list-templates.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -30,11 +30,11 @@  discard block
 block discarded – undo
30 30
 			</li>
31 31
 			<?php
32 32
 			foreach ( array( 20872734, 20874748, 20882522, 20874739 ) as $template ) {
33
-				if ( ! isset( $templates[ $template ] ) ) {
33
+				if ( ! isset( $templates[$template] ) ) {
34 34
 					continue;
35 35
 				}
36 36
 
37
-				$template      = $templates[ $template ];
37
+				$template      = $templates[$template];
38 38
 				$plan_required = FrmFormsHelper::get_plan_required( $template );
39 39
 				$link          = FrmFormsHelper::get_template_install_link( $template, compact( 'pricing', 'license_type', 'plan_required' ) );
40 40
 				?>
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
 					</div>
139 139
 				</td>
140 140
 				</tr>
141
-				<?php unset( $template, $templates[ $k ] ); ?>
141
+				<?php unset( $template, $templates[$k] ); ?>
142 142
 			<?php } ?>
143 143
 		</tbody>
144 144
 </table>
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
 							</div>
239 239
 						</td>
240 240
 					</tr>
241
-					<?php unset( $template, $templates[ $k ] ); ?>
241
+					<?php unset( $template, $templates[$k] ); ?>
242 242
 				<?php } ?>
243 243
 				</tbody>
244 244
 			</table>
Please login to merge, or discard this patch.
classes/models/FrmMigrate.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -329,7 +329,7 @@  discard block
 block discarded – undo
329 329
 
330 330
 		foreach ( (array) $fields as $f ) {
331 331
 			FrmAppHelper::unserialize_or_decode( $f->field_options );
332
-			$size             = $f->field_options['size'];
332
+			$size = $f->field_options['size'];
333 333
 			$this->maybe_convert_migrated_size( $size );
334 334
 
335 335
 			if ( $size === $f->field_options['size'] ) {
@@ -392,7 +392,7 @@  discard block
 block discarded – undo
392 392
 				continue;
393 393
 			}
394 394
 
395
-			$this->maybe_convert_migrated_size( $widgets[ $k ]['size'] );
395
+			$this->maybe_convert_migrated_size( $widgets[$k]['size'] );
396 396
 		}
397 397
 		update_option( 'widget_frm_show_form', $widgets );
398 398
 	}
@@ -491,7 +491,7 @@  discard block
 block discarded – undo
491 491
 			if ( ! is_array( $widget ) || ! isset( $widget['size'] ) ) {
492 492
 				continue;
493 493
 			}
494
-			$this->convert_character_to_px( $widgets[ $k ]['size'] );
494
+			$this->convert_character_to_px( $widgets[$k]['size'] );
495 495
 		}
496 496
 		update_option( 'widget_frm_show_form', $widgets );
497 497
 	}
Please login to merge, or discard this patch.
classes/models/FrmForm.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 
141 141
 		foreach ( $values as $value_key => $value ) {
142 142
 			if ( $value_key && in_array( $value_key, $form_fields ) ) {
143
-				$new_values[ $value_key ] = $value;
143
+				$new_values[$value_key] = $value;
144 144
 			}
145 145
 		}
146 146
 
@@ -210,15 +210,15 @@  discard block
 block discarded – undo
210 210
 		$existing_keys = array_keys( $values['item_meta'] );
211 211
 		foreach ( $all_fields as $fid ) {
212 212
 			if ( ! in_array( $fid->id, $existing_keys ) && ( isset( $values['frm_fields_submitted'] ) && in_array( $fid->id, $values['frm_fields_submitted'] ) ) || isset( $values['options'] ) ) {
213
-				$values['item_meta'][ $fid->id ] = '';
213
+				$values['item_meta'][$fid->id] = '';
214 214
 			}
215
-			$field_array[ $fid->id ] = $fid;
215
+			$field_array[$fid->id] = $fid;
216 216
 		}
217 217
 		unset( $all_fields );
218 218
 
219 219
 		foreach ( $values['item_meta'] as $field_id => $default_value ) {
220
-			if ( isset( $field_array[ $field_id ] ) ) {
221
-				$field = $field_array[ $field_id ];
220
+			if ( isset( $field_array[$field_id] ) ) {
221
+				$field = $field_array[$field_id];
222 222
 			} else {
223 223
 				$field = FrmField::getOne( $field_id );
224 224
 			}
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
 				continue;
228 228
 			}
229 229
 
230
-			$is_settings_page = ( isset( $values['options'] ) || isset( $values['field_options'][ 'custom_html_' . $field_id ] ) );
230
+			$is_settings_page = ( isset( $values['options'] ) || isset( $values['field_options']['custom_html_' . $field_id] ) );
231 231
 			if ( $is_settings_page ) {
232 232
 				self::get_settings_page_html( $values, $field );
233 233
 
@@ -242,15 +242,15 @@  discard block
 block discarded – undo
242 242
 			$update_options = apply_filters( 'frm_field_options_to_update', $update_options );
243 243
 
244 244
 			foreach ( $update_options as $opt => $default ) {
245
-				$field->field_options[ $opt ] = isset( $values['field_options'][ $opt . '_' . $field_id ] ) ? $values['field_options'][ $opt . '_' . $field_id ] : $default;
246
-				self::sanitize_field_opt( $opt, $field->field_options[ $opt ] );
245
+				$field->field_options[$opt] = isset( $values['field_options'][$opt . '_' . $field_id] ) ? $values['field_options'][$opt . '_' . $field_id] : $default;
246
+				self::sanitize_field_opt( $opt, $field->field_options[$opt] );
247 247
 			}
248 248
 
249 249
 			$field->field_options = apply_filters( 'frm_update_field_options', $field->field_options, $field, $values );
250 250
 
251 251
 			$new_field = array(
252 252
 				'field_options' => $field->field_options,
253
-				'default_value' => isset( $values[ 'default_value_' . $field_id ] ) ? FrmAppHelper::maybe_json_encode( $values[ 'default_value_' . $field_id ] ) : '',
253
+				'default_value' => isset( $values['default_value_' . $field_id] ) ? FrmAppHelper::maybe_json_encode( $values['default_value_' . $field_id] ) : '',
254 254
 			);
255 255
 
256 256
 			self::prepare_field_update_values( $field, $values, $new_field );
@@ -279,11 +279,11 @@  discard block
 block discarded – undo
279 279
 	 * Updating the settings page
280 280
 	 */
281 281
 	private static function get_settings_page_html( $values, &$field ) {
282
-		if ( isset( $values['field_options'][ 'custom_html_' . $field->id ] ) ) {
282
+		if ( isset( $values['field_options']['custom_html_' . $field->id] ) ) {
283 283
 			$prev_opts     = array();
284 284
 			$fallback_html = isset( $field->field_options['custom_html'] ) ? $field->field_options['custom_html'] : FrmFieldsHelper::get_default_html( $field->type );
285 285
 
286
-			$field->field_options['custom_html'] = isset( $values['field_options'][ 'custom_html_' . $field->id ] ) ? $values['field_options'][ 'custom_html_' . $field->id ] : $fallback_html;
286
+			$field->field_options['custom_html'] = isset( $values['field_options']['custom_html_' . $field->id] ) ? $values['field_options']['custom_html_' . $field->id] : $fallback_html;
287 287
 		} elseif ( $field->type == 'hidden' || $field->type == 'user_id' ) {
288 288
 			$prev_opts = $field->field_options;
289 289
 		}
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
 		foreach ( $field_cols as $col => $default ) {
310 310
 			$default = ( $default === '' ) ? $field->{$col} : $default;
311 311
 
312
-			$new_field[ $col ] = isset( $values['field_options'][ $col . '_' . $field->id ] ) ? $values['field_options'][ $col . '_' . $field->id ] : $default;
312
+			$new_field[$col] = isset( $values['field_options'][$col . '_' . $field->id] ) ? $values['field_options'][$col . '_' . $field->id] : $default;
313 313
 		}
314 314
 
315 315
 		// Don't save the template option.
@@ -723,8 +723,8 @@  discard block
 block discarded – undo
723 723
 			self::maybe_get_form( $form );
724 724
 		}
725 725
 
726
-		if ( isset( $frm_vars['form_params'] ) && is_array( $frm_vars['form_params'] ) && isset( $frm_vars['form_params'][ $form->id ] ) ) {
727
-			return $frm_vars['form_params'][ $form->id ];
726
+		if ( isset( $frm_vars['form_params'] ) && is_array( $frm_vars['form_params'] ) && isset( $frm_vars['form_params'][$form->id] ) ) {
727
+			return $frm_vars['form_params'][$form->id];
728 728
 		}
729 729
 
730 730
 		$action_var = isset( $_REQUEST['frm_action'] ) ? 'frm_action' : 'action'; // WPCS: CSRF ok.
@@ -753,15 +753,15 @@  discard block
 block discarded – undo
753 753
 			//if there are two forms on the same page, make sure not to submit both
754 754
 			foreach ( $default_values as $var => $default ) {
755 755
 				if ( $var == 'action' ) {
756
-					$values[ $var ] = FrmAppHelper::get_param( $action_var, $default, 'get', 'sanitize_title' );
756
+					$values[$var] = FrmAppHelper::get_param( $action_var, $default, 'get', 'sanitize_title' );
757 757
 				} else {
758
-					$values[ $var ] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' );
758
+					$values[$var] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' );
759 759
 				}
760 760
 				unset( $var, $default );
761 761
 			}
762 762
 		} else {
763 763
 			foreach ( $default_values as $var => $default ) {
764
-				$values[ $var ] = $default;
764
+				$values[$var] = $default;
765 765
 				unset( $var, $default );
766 766
 			}
767 767
 		}
@@ -787,7 +787,7 @@  discard block
 block discarded – undo
787 787
 			'sdir'     => '',
788 788
 		);
789 789
 		foreach ( $defaults as $var => $default ) {
790
-			$values[ $var ] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' );
790
+			$values[$var] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' );
791 791
 		}
792 792
 
793 793
 		return $values;
@@ -815,7 +815,7 @@  discard block
 block discarded – undo
815 815
 			'keep_post' => '',
816 816
 		);
817 817
 		foreach ( $defaults as $var => $default ) {
818
-			$values[ $var ] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' );
818
+			$values[$var] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' );
819 819
 		}
820 820
 
821 821
 		return $values;
@@ -900,7 +900,7 @@  discard block
 block discarded – undo
900 900
 	public static function get_option( $atts ) {
901 901
 		$form = $atts['form'];
902 902
 
903
-		return isset( $form->options[ $atts['option'] ] ) ? $form->options[ $atts['option'] ] : $atts['default'];
903
+		return isset( $form->options[$atts['option']] ) ? $form->options[$atts['option']] : $atts['default'];
904 904
 	}
905 905
 
906 906
 	/**
Please login to merge, or discard this patch.
classes/helpers/FrmCSVExportHelper.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 		self::print_file_headers( $filename );
38 38
 		unset( $filename );
39 39
 
40
-		$comment_count       = FrmDb::get_count(
40
+		$comment_count = FrmDb::get_count(
41 41
 			'frm_item_metas',
42 42
 			array(
43 43
 				'item_id'         => $atts['entry_ids'],
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
 	private static function prepare_csv_headings() {
104 104
 		$headings = array();
105 105
 		self::csv_headings( $headings );
106
-		$headings       = apply_filters(
106
+		$headings = apply_filters(
107 107
 			'frm_csv_columns',
108 108
 			$headings,
109 109
 			self::$form_id,
@@ -121,10 +121,10 @@  discard block
 block discarded – undo
121 121
 			$field_headings = array();
122 122
 			$separate_values = array( 'user_id', 'file', 'data', 'date' );
123 123
 			if ( isset( $col->field_options['separate_value'] ) && $col->field_options['separate_value'] && ! in_array( $col->type, $separate_values, true ) ) {
124
-				$field_headings[ $col->id . '_label' ] = strip_tags( $col->name . ' ' . __( '(label)', 'formidable' ) );
124
+				$field_headings[$col->id . '_label'] = strip_tags( $col->name . ' ' . __( '(label)', 'formidable' ) );
125 125
 			}
126 126
 
127
-			$field_headings[ $col->id ] = strip_tags( $col->name );
127
+			$field_headings[$col->id] = strip_tags( $col->name );
128 128
 			$field_headings             = apply_filters(
129 129
 				'frm_csv_field_columns',
130 130
 				$field_headings,
@@ -138,9 +138,9 @@  discard block
 block discarded – undo
138 138
 
139 139
 		if ( self::$comment_count ) {
140 140
 			for ( $i = 0; $i < self::$comment_count; $i ++ ) {
141
-				$headings[ 'comment' . $i ]            = __( 'Comment', 'formidable' );
142
-				$headings[ 'comment_user_id' . $i ]    = __( 'Comment User', 'formidable' );
143
-				$headings[ 'comment_created_at' . $i ] = __( 'Comment Date', 'formidable' );
141
+				$headings['comment' . $i]            = __( 'Comment', 'formidable' );
142
+				$headings['comment_user_id' . $i]    = __( 'Comment User', 'formidable' );
143
+				$headings['comment_created_at' . $i] = __( 'Comment Date', 'formidable' );
144 144
 			}
145 145
 			unset( $i );
146 146
 		}
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
 
165 165
 	private static function prepare_next_csv_rows( $next_set ) {
166 166
 		// order by parent_item_id so children will be first
167
-		$where   = array(
167
+		$where = array(
168 168
 			'or'             => 1,
169 169
 			'id'             => $next_set,
170 170
 			'parent_item_id' => $next_set,
@@ -209,30 +209,30 @@  discard block
 block discarded – undo
209 209
 					continue;
210 210
 				}
211 211
 
212
-				if ( ! isset( $entries[ self::$entry->parent_item_id ]->metas[ $meta_id ] ) ) {
213
-					$entries[ self::$entry->parent_item_id ]->metas[ $meta_id ] = array();
214
-				} elseif ( ! is_array( $entries[ self::$entry->parent_item_id ]->metas[ $meta_id ] ) ) {
212
+				if ( ! isset( $entries[self::$entry->parent_item_id]->metas[$meta_id] ) ) {
213
+					$entries[self::$entry->parent_item_id]->metas[$meta_id] = array();
214
+				} elseif ( ! is_array( $entries[self::$entry->parent_item_id]->metas[$meta_id] ) ) {
215 215
 					// if the data is here, it should be an array but if this field has collected data
216 216
 					// both while inside and outside of the repeating section, it's possible this is a string
217
-					$entries[ self::$entry->parent_item_id ]->metas[ $meta_id ] = (array) $entries[ self::$entry->parent_item_id ]->metas[ $meta_id ];
217
+					$entries[self::$entry->parent_item_id]->metas[$meta_id] = (array) $entries[self::$entry->parent_item_id]->metas[$meta_id];
218 218
 				}
219 219
 
220 220
 				//add the repeated values
221
-				$entries[ self::$entry->parent_item_id ]->metas[ $meta_id ][] = $meta_value;
221
+				$entries[self::$entry->parent_item_id]->metas[$meta_id][] = $meta_value;
222 222
 			}
223
-			$entries[ self::$entry->parent_item_id ]->metas += self::$entry->metas;
223
+			$entries[self::$entry->parent_item_id]->metas += self::$entry->metas;
224 224
 		}
225 225
 
226 226
 		// add the embedded form id
227
-		if ( ! isset( $entries[ self::$entry->parent_item_id ]->embedded_fields ) ) {
228
-			$entries[ self::$entry->parent_item_id ]->embedded_fields = array();
227
+		if ( ! isset( $entries[self::$entry->parent_item_id]->embedded_fields ) ) {
228
+			$entries[self::$entry->parent_item_id]->embedded_fields = array();
229 229
 		}
230
-		$entries[ self::$entry->parent_item_id ]->embedded_fields[ self::$entry->id ] = self::$entry->form_id;
230
+		$entries[self::$entry->parent_item_id]->embedded_fields[self::$entry->id] = self::$entry->form_id;
231 231
 	}
232 232
 
233 233
 	private static function add_field_values_to_csv( &$row ) {
234 234
 		foreach ( self::$fields as $col ) {
235
-			$field_value = isset( self::$entry->metas[ $col->id ] ) ? self::$entry->metas[ $col->id ] : false;
235
+			$field_value = isset( self::$entry->metas[$col->id] ) ? self::$entry->metas[$col->id] : false;
236 236
 
237 237
 			FrmAppHelper::unserialize_or_decode( $field_value );
238 238
 			self::add_array_values_to_columns( $row, compact( 'col', 'field_value' ) );
@@ -257,15 +257,15 @@  discard block
 block discarded – undo
257 257
 						'show_icon'         => false,
258 258
 						'entry_id'          => self::$entry->id,
259 259
 						'sep'               => self::$separator,
260
-						'embedded_field_id' => ( isset( self::$entry->embedded_fields ) && isset( self::$entry->embedded_fields[ self::$entry->id ] ) ) ? 'form' . self::$entry->embedded_fields[ self::$entry->id ] : 0,
260
+						'embedded_field_id' => ( isset( self::$entry->embedded_fields ) && isset( self::$entry->embedded_fields[self::$entry->id] ) ) ? 'form' . self::$entry->embedded_fields[self::$entry->id] : 0,
261 261
 					)
262 262
 				);
263 263
 
264
-				$row[ $col->id . '_label' ] = $sep_value;
264
+				$row[$col->id . '_label'] = $sep_value;
265 265
 				unset( $sep_value );
266 266
 			}
267 267
 
268
-			$row[ $col->id ] = $field_value;
268
+			$row[$col->id] = $field_value;
269 269
 
270 270
 			unset( $col, $field_value );
271 271
 		}
@@ -278,8 +278,8 @@  discard block
 block discarded – undo
278 278
 		if ( is_array( $atts['field_value'] ) ) {
279 279
 			foreach ( $atts['field_value'] as $key => $sub_value ) {
280 280
 				$column_key = $atts['col']->id . '_' . $key;
281
-				if ( ! is_numeric( $key ) && isset( self::$headings[ $column_key ] ) ) {
282
-					$row[ $column_key ] = $sub_value;
281
+				if ( ! is_numeric( $key ) && isset( self::$headings[$column_key] ) ) {
282
+					$row[$column_key] = $sub_value;
283 283
 				}
284 284
 			}
285 285
 		}
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
 		$sep = '';
304 304
 
305 305
 		foreach ( self::$headings as $k => $heading ) {
306
-			$row = isset( $rows[ $k ] ) ? $rows[ $k ] : '';
306
+			$row = isset( $rows[$k] ) ? $rows[$k] : '';
307 307
 			if ( is_array( $row ) ) {
308 308
 				// implode the repeated field values
309 309
 				$row = implode( self::$separator, FrmAppHelper::array_flatten( $row, 'reset' ) );
Please login to merge, or discard this patch.
classes/helpers/FrmEntriesHelper.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -136,6 +136,9 @@
 block discarded – undo
136 136
 		return apply_filters( 'frm_setup_edit_entry_vars', $values, $record );
137 137
 	}
138 138
 
139
+	/**
140
+	 * @param string $message
141
+	 */
139 142
 	public static function replace_default_message( $message, $atts ) {
140 143
 		if ( strpos( $message, '[default-message' ) === false &&
141 144
 			strpos( $message, '[default_message' ) === false &&
Please login to merge, or discard this patch.
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -117,10 +117,10 @@  discard block
 block discarded – undo
117 117
 		if ( $_POST ) {
118 118
 			$repeating = isset( $args['repeating'] ) && $args['repeating'];
119 119
 			if ( $repeating ) {
120
-				if ( isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field->id ] ) ) {
120
+				if ( isset( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']][$field->id] ) ) {
121 121
 					$value_is_posted = true;
122 122
 				}
123
-			} elseif ( isset( $_POST['item_meta'][ $field->id ] ) ) {
123
+			} elseif ( isset( $_POST['item_meta'][$field->id] ) ) {
124 124
 				$value_is_posted = true;
125 125
 			}
126 126
 		}
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
 		preg_match_all( "/\[(default-message|default_message)\b(.*?)(?:(\/))?\]/s", $message, $shortcodes, PREG_PATTERN_ORDER );
151 151
 
152 152
 		foreach ( $shortcodes[0] as $short_key => $tag ) {
153
-			$add_atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[2][ $short_key ] );
153
+			$add_atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[2][$short_key] );
154 154
 			if ( ! empty( $add_atts ) ) {
155 155
 				$this_atts = array_merge( $atts, $add_atts );
156 156
 			} else {
@@ -160,14 +160,14 @@  discard block
 block discarded – undo
160 160
 			$default = FrmEntriesController::show_entry_shortcode( $this_atts );
161 161
 
162 162
 			// Add the default message.
163
-			$message = str_replace( $shortcodes[0][ $short_key ], $default, $message );
163
+			$message = str_replace( $shortcodes[0][$short_key], $default, $message );
164 164
 		}
165 165
 
166 166
 		return $message;
167 167
 	}
168 168
 
169 169
 	public static function prepare_display_value( $entry, $field, $atts ) {
170
-		$field_value = isset( $entry->metas[ $field->id ] ) ? $entry->metas[ $field->id ] : false;
170
+		$field_value = isset( $entry->metas[$field->id] ) ? $entry->metas[$field->id] : false;
171 171
 
172 172
 		if ( FrmAppHelper::pro_is_installed() ) {
173 173
 			FrmProEntriesHelper::get_dynamic_list_values( $field, $entry, $field_value );
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
 			$child_entries = FrmEntry::getAll( array( 'it.parent_item_id' => $entry->id ) );
186 186
 		} else {
187 187
 			// Get all values for this field.
188
-			$child_values = isset( $entry->metas[ $atts['embedded_field_id'] ] ) ? $entry->metas[ $atts['embedded_field_id'] ] : false;
188
+			$child_values = isset( $entry->metas[$atts['embedded_field_id']] ) ? $entry->metas[$atts['embedded_field_id']] : false;
189 189
 
190 190
 			if ( $child_values ) {
191 191
 				$child_entries = FrmEntry::getAll( array( 'it.id' => (array) $child_values ) );
@@ -299,7 +299,7 @@  discard block
 block discarded – undo
299 299
 			$value = $args['temp_value'];
300 300
 		}
301 301
 		if ( empty( $args['parent_field_id'] ) ) {
302
-			$_POST['item_meta'][ $field->id ] = $value;
302
+			$_POST['item_meta'][$field->id] = $value;
303 303
 		} else {
304 304
 			self::set_parent_field_posted_value( $field, $value, $args );
305 305
 		}
@@ -311,20 +311,20 @@  discard block
 block discarded – undo
311 311
 	 * @since 4.01
312 312
 	 */
313 313
 	private static function set_parent_field_posted_value( $field, $value, $args ) {
314
-		if ( isset( $_POST['item_meta'][ $args['parent_field_id'] ] ) &&
315
-			 is_array( $_POST['item_meta'][ $args['parent_field_id'] ] ) ) {
314
+		if ( isset( $_POST['item_meta'][$args['parent_field_id']] ) &&
315
+			 is_array( $_POST['item_meta'][$args['parent_field_id']] ) ) {
316 316
 
317
-			if ( ! isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] ) ||
318
-				 ! is_array( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] ) ) {
319
-				$_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] = array();
317
+			if ( ! isset( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']] ) ||
318
+				 ! is_array( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']] ) ) {
319
+				$_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']] = array();
320 320
 			}
321 321
 		} else {
322 322
 			// All of the section was probably removed.
323
-			$_POST['item_meta'][ $args['parent_field_id'] ] = array();
324
-			$_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] = array();
323
+			$_POST['item_meta'][$args['parent_field_id']] = array();
324
+			$_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']] = array();
325 325
 		}
326 326
 
327
-		$_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field->id ] = $value;
327
+		$_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']][$field->id] = $value;
328 328
 	}
329 329
 
330 330
 	public static function get_posted_value( $field, &$value, $args ) {
@@ -355,10 +355,10 @@  discard block
 block discarded – undo
355 355
 		if ( empty( $args['parent_field_id'] ) ) {
356 356
 			// Sanitizing is done next.
357 357
 			// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
358
-			$value = isset( $_POST['item_meta'][ $field_id ] ) ? wp_unslash( $_POST['item_meta'][ $field_id ] ) : '';
358
+			$value = isset( $_POST['item_meta'][$field_id] ) ? wp_unslash( $_POST['item_meta'][$field_id] ) : '';
359 359
 		} else {
360 360
 			// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
361
-			$value = isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field_id ] ) ? wp_unslash( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field_id ] ) : '';
361
+			$value = isset( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']][$field_id] ) ? wp_unslash( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']][$field_id] ) : '';
362 362
 		}
363 363
 		return $value;
364 364
 	}
@@ -389,7 +389,7 @@  discard block
 block discarded – undo
389 389
 		self::set_other_repeating_vals( $field, $value, $args );
390 390
 
391 391
 		// Check if there are any posted "Other" values.
392
-		if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta']['other'][ $field->id ] ) ) {
392
+		if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta']['other'][$field->id] ) ) {
393 393
 
394 394
 			// Save original value.
395 395
 			$args['temp_value'] = $value;
@@ -397,7 +397,7 @@  discard block
 block discarded – undo
397 397
 
398 398
 			// Sanitizing is done next.
399 399
 			// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
400
-			$other_vals = wp_unslash( $_POST['item_meta']['other'][ $field->id ] );
400
+			$other_vals = wp_unslash( $_POST['item_meta']['other'][$field->id] );
401 401
 			FrmAppHelper::sanitize_value( 'sanitize_text_field', $other_vals );
402 402
 
403 403
 			// Set the validation value now
@@ -420,13 +420,13 @@  discard block
 block discarded – undo
420 420
 		}
421 421
 
422 422
 		// Check if there are any other posted "other" values for this field.
423
-		if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ]['other'][ $field->id ] ) ) {
423
+		if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']]['other'][$field->id] ) ) {
424 424
 			// Save original value
425 425
 			$args['temp_value'] = $value;
426 426
 			$args['other']      = true;
427 427
 
428 428
 			// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
429
-			$other_vals = wp_unslash( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ]['other'][ $field->id ] );
429
+			$other_vals = wp_unslash( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']]['other'][$field->id] );
430 430
 			FrmAppHelper::sanitize_value( 'sanitize_text_field', $other_vals );
431 431
 
432 432
 			// Set the validation value now.
@@ -453,7 +453,7 @@  discard block
 block discarded – undo
453 453
 		if ( is_array( $value ) && $field->type === 'checkbox' ) {
454 454
 			// Combine "Other" values with checked values. "Other" values will override checked box values.
455 455
 			foreach ( $other_vals as $k => $v ) {
456
-				if ( isset( $value[ $k ] ) && trim( $v ) === '' ) {
456
+				if ( isset( $value[$k] ) && trim( $v ) === '' ) {
457 457
 					// If the other box is checked, but doesn't have a value.
458 458
 					$value = '';
459 459
 					break;
@@ -470,25 +470,25 @@  discard block
 block discarded – undo
470 470
 
471 471
 			// Multi-select dropdown.
472 472
 			if ( is_array( $value ) ) {
473
-				$o_key = array_search( $field->options[ $other_key ], $value );
473
+				$o_key = array_search( $field->options[$other_key], $value );
474 474
 
475 475
 				if ( $o_key !== false ) {
476 476
 					// Modify the original value so other key will be preserved.
477
-					$value[ $other_key ] = $value[ $o_key ];
477
+					$value[$other_key] = $value[$o_key];
478 478
 
479 479
 					// By default, the array keys will be numeric for multi-select dropdowns.
480 480
 					// If going backwards and forwards between pages, the array key will match the other key.
481 481
 					if ( $o_key !== $other_key ) {
482
-						unset( $value[ $o_key ] );
482
+						unset( $value[$o_key] );
483 483
 					}
484 484
 
485 485
 					$args['temp_value']  = $value;
486
-					$value[ $other_key ] = reset( $other_vals );
487
-					if ( FrmAppHelper::is_empty_value( $value[ $other_key ] ) ) {
488
-						unset( $value[ $other_key ] );
486
+					$value[$other_key] = reset( $other_vals );
487
+					if ( FrmAppHelper::is_empty_value( $value[$other_key] ) ) {
488
+						unset( $value[$other_key] );
489 489
 					}
490 490
 				}
491
-			} elseif ( $field->options[ $other_key ] == $value ) {
491
+			} elseif ( $field->options[$other_key] == $value ) {
492 492
 				$value = $other_vals;
493 493
 			}
494 494
 		}
Please login to merge, or discard this patch.
classes/models/FrmEmail.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 		$to = $this->prepare_email_setting( $this->settings['email_to'], $user_id_args );
86 86
 		$to = $this->explode_emails( $to );
87 87
 
88
-		$where  = array(
88
+		$where = array(
89 89
 			'it.field_id !' => 0,
90 90
 			'it.item_id'    => $this->entry->id,
91 91
 		);
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 			'entry'     => $this->entry,
96 96
 			'form'      => $this->form,
97 97
 		);
98
-		$to     = apply_filters( 'frm_to_email', $to, $values, $this->form->id, $args );
98
+		$to = apply_filters( 'frm_to_email', $to, $values, $this->form->id, $args );
99 99
 
100 100
 		$this->to = array_unique( (array) $to );
101 101
 
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
 
299 299
 		// Add the user info if it isn't already included
300 300
 		if ( $this->include_user_info && $prev_mail_body === $mail_body ) {
301
-			$data      = $this->entry->description;
301
+			$data = $this->entry->description;
302 302
 			$mail_body .= "\r\n\r\n" . __( 'User Information', 'formidable' ) . "\r\n";
303 303
 			$this->maybe_add_ip( $mail_body );
304 304
 			$mail_body .= __( 'User-Agent (Browser/OS)', 'formidable' ) . ': ' . FrmEntriesHelper::get_browser( $data['browser'] ) . "\r\n";
@@ -563,12 +563,12 @@  discard block
 block discarded – undo
563 563
 					$name = trim( str_replace( $email, '', $val ) );
564 564
 				} else {
565 565
 					// If user enters a name without an email
566
-					unset( $recipients[ $key ] );
566
+					unset( $recipients[$key] );
567 567
 					continue;
568 568
 				}
569 569
 			}
570 570
 
571
-			$recipients[ $key ] = $this->format_from_email( $name, $email );
571
+			$recipients[$key] = $this->format_from_email( $name, $email );
572 572
 		}
573 573
 
574 574
 		return $recipients;
@@ -709,7 +709,7 @@  discard block
 block discarded – undo
709 709
 				);
710 710
 
711 711
 				// Remove phone number from to addresses
712
-				unset( $this->to[ $key ] );
712
+				unset( $this->to[$key] );
713 713
 			}
714 714
 		}
715 715
 	}
Please login to merge, or discard this patch.
classes/models/FrmFormAction.php 1 patch
Spacing   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -2,15 +2,15 @@  discard block
 block discarded – undo
2 2
 
3 3
 class FrmFormAction {
4 4
 
5
-	public $id_base;         // Root id for all actions of this type.
6
-	public $name;            // Name for this action type.
5
+	public $id_base; // Root id for all actions of this type.
6
+	public $name; // Name for this action type.
7 7
 	public $option_name;
8
-	public $action_options;  // Option array passed to wp_register_sidebar_widget()
8
+	public $action_options; // Option array passed to wp_register_sidebar_widget()
9 9
 	public $control_options; // Option array passed to wp_register_widget_control()
10 10
 
11
-	public $form_id;         // The ID of the form to evaluate
12
-	public $number = false;  // Unique ID number of the current instance.
13
-	public $id = '';         // Unique ID string of the current instance (id_base-number)
11
+	public $form_id; // The ID of the form to evaluate
12
+	public $number = false; // Unique ID number of the current instance.
13
+	public $id = ''; // Unique ID string of the current instance (id_base-number)
14 14
 	public $updated = false; // Set true when we update the data after a POST submit - makes sure we don't do it twice.
15 15
 
16 16
 	// Member functions that you must over-ride.
@@ -133,9 +133,9 @@  discard block
 block discarded – undo
133 133
 		$groups = FrmFormActionsController::form_action_groups();
134 134
 		$group  = 'misc';
135 135
 
136
-		if ( isset( $action_options['group'] ) && isset( $groups[ $action_options['group'] ] ) ) {
136
+		if ( isset( $action_options['group'] ) && isset( $groups[$action_options['group']] ) ) {
137 137
 			$group = $action_options['group'];
138
-		} elseif ( isset( $groups[ $this->id_base ] ) ) {
138
+		} elseif ( isset( $groups[$this->id_base] ) ) {
139 139
 			$group = $this->id_base;
140 140
 		} else {
141 141
 			foreach ( $groups as $name => $check_group ) {
@@ -146,8 +146,8 @@  discard block
 block discarded – undo
146 146
 			}
147 147
 		}
148 148
 
149
-		$groups[ $group ]['id'] = $group;
150
-		return $groups[ $group ];
149
+		$groups[$group]['id'] = $group;
150
+		return $groups[$group];
151 151
 	}
152 152
 
153 153
 	/**
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
 	 * @return integer $post_id
250 250
 	 */
251 251
 	public function maybe_create_action( $action, $forms ) {
252
-		if ( isset( $action['ID'] ) && is_numeric( $action['ID'] ) && isset( $forms[ $action['menu_order'] ] ) && $forms[ $action['menu_order'] ] == 'updated' ) {
252
+		if ( isset( $action['ID'] ) && is_numeric( $action['ID'] ) && isset( $forms[$action['menu_order']] ) && $forms[$action['menu_order']] == 'updated' ) {
253 253
 			// Update action only
254 254
 			$action['post_content'] = FrmAppHelper::maybe_json_decode( $action['post_content'] );
255 255
 			$post_id                = $this->save_settings( $action );
@@ -268,18 +268,18 @@  discard block
 block discarded – undo
268 268
 		$action->menu_order = $form_id;
269 269
 		$switch             = $this->get_global_switch_fields();
270 270
 		foreach ( (array) $action->post_content as $key => $val ) {
271
-			if ( is_numeric( $val ) && isset( $frm_duplicate_ids[ $val ] ) ) {
272
-				$action->post_content[ $key ] = $frm_duplicate_ids[ $val ];
271
+			if ( is_numeric( $val ) && isset( $frm_duplicate_ids[$val] ) ) {
272
+				$action->post_content[$key] = $frm_duplicate_ids[$val];
273 273
 			} elseif ( ! is_array( $val ) ) {
274
-				$action->post_content[ $key ] = FrmFieldsHelper::switch_field_ids( $val );
275
-			} elseif ( isset( $switch[ $key ] ) && is_array( $switch[ $key ] ) ) {
274
+				$action->post_content[$key] = FrmFieldsHelper::switch_field_ids( $val );
275
+			} elseif ( isset( $switch[$key] ) && is_array( $switch[$key] ) ) {
276 276
 				// loop through each value if empty
277
-				if ( empty( $switch[ $key ] ) ) {
278
-					$switch[ $key ] = array_keys( $val );
277
+				if ( empty( $switch[$key] ) ) {
278
+					$switch[$key] = array_keys( $val );
279 279
 				}
280 280
 
281
-				foreach ( $switch[ $key ] as $subkey ) {
282
-					$action->post_content[ $key ] = $this->duplicate_array_walk( $action->post_content[ $key ], $subkey, $val );
281
+				foreach ( $switch[$key] as $subkey ) {
282
+					$action->post_content[$key] = $this->duplicate_array_walk( $action->post_content[$key], $subkey, $val );
283 283
 				}
284 284
 			}
285 285
 
@@ -297,20 +297,20 @@  discard block
 block discarded – undo
297 297
 			foreach ( $subkey as $subkey2 ) {
298 298
 				foreach ( (array) $val as $ck => $cv ) {
299 299
 					if ( is_array( $cv ) ) {
300
-						$action[ $ck ] = $this->duplicate_array_walk( $action[ $ck ], $subkey2, $cv );
301
-					} elseif ( isset( $cv[ $subkey ] ) && is_numeric( $cv[ $subkey ] ) && isset( $frm_duplicate_ids[ $cv[ $subkey ] ] ) ) {
302
-						$action[ $ck ][ $subkey ] = $frm_duplicate_ids[ $cv[ $subkey ] ];
300
+						$action[$ck] = $this->duplicate_array_walk( $action[$ck], $subkey2, $cv );
301
+					} elseif ( isset( $cv[$subkey] ) && is_numeric( $cv[$subkey] ) && isset( $frm_duplicate_ids[$cv[$subkey]] ) ) {
302
+						$action[$ck][$subkey] = $frm_duplicate_ids[$cv[$subkey]];
303 303
 					}
304 304
 				}
305 305
 			}
306 306
 		} else {
307 307
 			foreach ( (array) $val as $ck => $cv ) {
308 308
 				if ( is_array( $cv ) ) {
309
-					$action[ $ck ] = $this->duplicate_array_walk( $action[ $ck ], $subkey, $cv );
310
-				} elseif ( $ck == $subkey && isset( $frm_duplicate_ids[ $cv ] ) ) {
311
-					$action[ $ck ] = $frm_duplicate_ids[ $cv ];
309
+					$action[$ck] = $this->duplicate_array_walk( $action[$ck], $subkey, $cv );
310
+				} elseif ( $ck == $subkey && isset( $frm_duplicate_ids[$cv] ) ) {
311
+					$action[$ck] = $frm_duplicate_ids[$cv];
312 312
 				} elseif ( $ck == $subkey ) {
313
-					$action[ $ck ] = FrmFieldsHelper::switch_field_ids( $action[ $ck ] );
313
+					$action[$ck] = FrmFieldsHelper::switch_field_ids( $action[$ck] );
314 314
 				}
315 315
 			}
316 316
 		}
@@ -333,10 +333,10 @@  discard block
 block discarded – undo
333 333
 			return;
334 334
 		}
335 335
 
336
-		if ( isset( $_POST[ $this->option_name ] ) && is_array( $_POST[ $this->option_name ] ) ) {
336
+		if ( isset( $_POST[$this->option_name] ) && is_array( $_POST[$this->option_name] ) ) {
337 337
 			// Sanitizing removes scripts and <email> type of values.
338 338
 			// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
339
-			$settings = wp_unslash( $_POST[ $this->option_name ] );
339
+			$settings = wp_unslash( $_POST[$this->option_name] );
340 340
 		} else {
341 341
 			return;
342 342
 		}
@@ -346,7 +346,7 @@  discard block
 block discarded – undo
346 346
 		foreach ( $settings as $number => $new_instance ) {
347 347
 			$this->_set( $number );
348 348
 
349
-			$old_instance = isset( $all_instances[ $number ] ) ? $all_instances[ $number ] : array();
349
+			$old_instance = isset( $all_instances[$number] ) ? $all_instances[$number] : array();
350 350
 
351 351
 			if ( ! isset( $new_instance['post_status'] ) ) {
352 352
 				$new_instance['post_status'] = 'draft';
@@ -386,7 +386,7 @@  discard block
 block discarded – undo
386 386
 			$instance['post_content'] = apply_filters( 'frm_before_save_' . $this->id_base . '_action', $new_instance['post_content'], $instance, $new_instance, $old_instance, $this );
387 387
 
388 388
 			if ( false !== $instance ) {
389
-				$all_instances[ $number ] = $instance;
389
+				$all_instances[$number] = $instance;
390 390
 			}
391 391
 
392 392
 			$action_ids[] = $this->save_settings( $instance );
@@ -462,12 +462,12 @@  discard block
 block discarded – undo
462 462
 			// some plugins/themes are formatting the post_excerpt
463 463
 			$action->post_excerpt = sanitize_title( $action->post_excerpt );
464 464
 
465
-			if ( ! isset( $action_controls[ $action->post_excerpt ] ) ) {
465
+			if ( ! isset( $action_controls[$action->post_excerpt] ) ) {
466 466
 				continue;
467 467
 			}
468 468
 
469
-			$action                  = $action_controls[ $action->post_excerpt ]->prepare_action( $action );
470
-			$settings[ $action->ID ] = $action;
469
+			$action                  = $action_controls[$action->post_excerpt]->prepare_action( $action );
470
+			$settings[$action->ID] = $action;
471 471
 
472 472
 			if ( count( $settings ) >= $limit ) {
473 473
 				break;
@@ -497,7 +497,7 @@  discard block
 block discarded – undo
497 497
 			'limit'       => 99,
498 498
 			'post_status' => $default_status,
499 499
 		);
500
-		$args     = wp_parse_args( $args, $defaults );
500
+		$args = wp_parse_args( $args, $defaults );
501 501
 	}
502 502
 
503 503
 	/**
@@ -558,7 +558,7 @@  discard block
 block discarded – undo
558 558
 
559 559
 			$action = $this->prepare_action( $action );
560 560
 
561
-			$settings[ $action->ID ] = $action;
561
+			$settings[$action->ID] = $action;
562 562
 		}
563 563
 
564 564
 		if ( 1 === $limit ) {
@@ -595,10 +595,10 @@  discard block
 block discarded – undo
595 595
 
596 596
 		foreach ( $default_values as $k => $vals ) {
597 597
 			if ( is_array( $vals ) && ! empty( $vals ) ) {
598
-				if ( 'event' == $k && ! $this->action_options['force_event'] && ! empty( $action->post_content[ $k ] ) ) {
598
+				if ( 'event' == $k && ! $this->action_options['force_event'] && ! empty( $action->post_content[$k] ) ) {
599 599
 					continue;
600 600
 				}
601
-				$action->post_content[ $k ] = wp_parse_args( $action->post_content[ $k ], $vals );
601
+				$action->post_content[$k] = wp_parse_args( $action->post_content[$k], $vals );
602 602
 			}
603 603
 		}
604 604
 
@@ -671,14 +671,14 @@  discard block
 block discarded – undo
671 671
 	 * Migrate settings from form->options into new action.
672 672
 	 */
673 673
 	public function migrate_to_2( $form, $update = 'update' ) {
674
-		$action        = $this->prepare_new( $form->id );
674
+		$action = $this->prepare_new( $form->id );
675 675
 		FrmAppHelper::unserialize_or_decode( $form->options );
676 676
 
677 677
 		// fill with existing options
678 678
 		foreach ( $action->post_content as $name => $val ) {
679
-			if ( isset( $form->options[ $name ] ) ) {
680
-				$action->post_content[ $name ] = $form->options[ $name ];
681
-				unset( $form->options[ $name ] );
679
+			if ( isset( $form->options[$name] ) ) {
680
+				$action->post_content[$name] = $form->options[$name];
681
+				unset( $form->options[$name] );
682 682
 			}
683 683
 		}
684 684
 
@@ -739,7 +739,7 @@  discard block
 block discarded – undo
739 739
 				$stop = $stop ? false : true;
740 740
 			}
741 741
 
742
-			$met[ $stop ] = $stop;
742
+			$met[$stop] = $stop;
743 743
 		}
744 744
 
745 745
 		if ( $notification['conditions']['any_all'] == 'all' && ! empty( $met ) && isset( $met[0] ) && isset( $met[1] ) ) {
@@ -781,8 +781,8 @@  discard block
 block discarded – undo
781 781
 	private static function get_value_from_entry( $entry, $field_id ) {
782 782
 		$observed_value = '';
783 783
 
784
-		if ( isset( $entry->metas[ $field_id ] ) ) {
785
-			$observed_value = $entry->metas[ $field_id ];
784
+		if ( isset( $entry->metas[$field_id] ) ) {
785
+			$observed_value = $entry->metas[$field_id];
786 786
 		} elseif ( $entry->post_id && FrmAppHelper::pro_is_installed() ) {
787 787
 			$field          = FrmField::getOne( $field_id );
788 788
 			$observed_value = FrmProEntryMetaHelper::get_post_or_meta_value(
Please login to merge, or discard this patch.
classes/controllers/FrmEntriesController.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -65,19 +65,19 @@  discard block
 block discarded – undo
65 65
 		global $frm_vars;
66 66
 		$form_id = FrmForm::get_current_form_id();
67 67
 
68
-		$columns[ $form_id . '_id' ]       = 'ID';
69
-		$columns[ $form_id . '_item_key' ] = esc_html__( 'Entry Key', 'formidable' );
68
+		$columns[$form_id . '_id']       = 'ID';
69
+		$columns[$form_id . '_item_key'] = esc_html__( 'Entry Key', 'formidable' );
70 70
 
71 71
 		if ( $form_id ) {
72 72
 			self::get_columns_for_form( $form_id, $columns );
73 73
 		} else {
74
-			$columns[ $form_id . '_form_id' ] = __( 'Form', 'formidable' );
75
-			$columns[ $form_id . '_name' ]    = __( 'Entry Name', 'formidable' );
76
-			$columns[ $form_id . '_user_id' ] = __( 'Created By', 'formidable' );
74
+			$columns[$form_id . '_form_id'] = __( 'Form', 'formidable' );
75
+			$columns[$form_id . '_name']    = __( 'Entry Name', 'formidable' );
76
+			$columns[$form_id . '_user_id'] = __( 'Created By', 'formidable' );
77 77
 		}
78 78
 
79
-		$columns[ $form_id . '_created_at' ] = __( 'Entry creation date', 'formidable' );
80
-		$columns[ $form_id . '_updated_at' ] = __( 'Entry update date', 'formidable' );
79
+		$columns[$form_id . '_created_at'] = __( 'Entry creation date', 'formidable' );
80
+		$columns[$form_id . '_updated_at'] = __( 'Entry update date', 'formidable' );
81 81
 		self::maybe_add_ip_col( $form_id, $columns );
82 82
 
83 83
 		$frm_vars['cols'] = $columns;
@@ -125,10 +125,10 @@  discard block
 block discarded – undo
125 125
 
126 126
 		foreach ( $sub_form_cols as $k => $sub_form_col ) {
127 127
 			if ( FrmField::is_no_save_field( $sub_form_col->type ) ) {
128
-				unset( $sub_form_cols[ $k ] );
128
+				unset( $sub_form_cols[$k] );
129 129
 				continue;
130 130
 			}
131
-			$columns[ $form_id . '_' . $sub_form_col->field_key . '-_-' . $field->id ] = FrmAppHelper::truncate( $sub_form_col->name, 35 );
131
+			$columns[$form_id . '_' . $sub_form_col->field_key . '-_-' . $field->id] = FrmAppHelper::truncate( $sub_form_col->name, 35 );
132 132
 			unset( $sub_form_col );
133 133
 		}
134 134
 	}
@@ -145,15 +145,15 @@  discard block
 block discarded – undo
145 145
 		$has_separate_value = ! FrmField::is_option_empty( $field, 'separate_value' );
146 146
 		$is_post_status     = FrmField::is_option_true( $field, 'post_field' ) && $field->field_options['post_field'] == 'post_status';
147 147
 		if ( $has_separate_value && ! $is_post_status ) {
148
-			$columns[ $form_id . '_frmsep_' . $col_id ] = FrmAppHelper::truncate( $field->name, 35 );
148
+			$columns[$form_id . '_frmsep_' . $col_id] = FrmAppHelper::truncate( $field->name, 35 );
149 149
 		}
150 150
 
151
-		$columns[ $form_id . '_' . $col_id ] = FrmAppHelper::truncate( $field->name, 35 );
151
+		$columns[$form_id . '_' . $col_id] = FrmAppHelper::truncate( $field->name, 35 );
152 152
 	}
153 153
 
154 154
 	private static function maybe_add_ip_col( $form_id, &$columns ) {
155 155
 		if ( FrmAppHelper::ips_saved() ) {
156
-			$columns[ $form_id . '_ip' ] = 'IP';
156
+			$columns[$form_id . '_ip'] = 'IP';
157 157
 		}
158 158
 	}
159 159
 
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
 		foreach ( $meta_value as $mk => $mv ) {
192 192
 			// Remove blank values.
193 193
 			if ( empty( $mv ) ) {
194
-				unset( $meta_value[ $mk ] );
194
+				unset( $meta_value[$mk] );
195 195
 			}
196 196
 		}
197 197
 
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
 		foreach ( $fields as $field ) {
269 269
 			if ( $field->type != 'checkbox' && ( ! isset( $field->field_options['post_field'] ) || $field->field_options['post_field'] == '' ) ) {
270 270
 				// Can't sort on checkboxes because they are stored serialized, or post fields
271
-				$columns[ $form_id . '_' . $field->field_key ] = 'meta_' . $field->id;
271
+				$columns[$form_id . '_' . $field->field_key] = 'meta_' . $field->id;
272 272
 			}
273 273
 		}
274 274
 
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
 			$atts['form_id'] . '_item_key' => '',
333 333
 			$atts['form_id'] . '_id'       => '',
334 334
 		);
335
-		$cols         = $remove_first + array_reverse( $frm_vars['cols'], true );
335
+		$cols = $remove_first + array_reverse( $frm_vars['cols'], true );
336 336
 
337 337
 		$i = $atts['i'];
338 338
 
@@ -343,7 +343,7 @@  discard block
 block discarded – undo
343 343
 
344 344
 			if ( empty( $result ) || ! in_array( $col_key, $result, true ) ) {
345 345
 				$result[] = $col_key;
346
-				$i--;
346
+				$i --;
347 347
 			}
348 348
 
349 349
 			unset( $col_key, $col );
@@ -476,9 +476,9 @@  discard block
 block discarded – undo
476 476
 		if ( ! isset( $frm_vars['form_params'] ) ) {
477 477
 			$frm_vars['form_params'] = array();
478 478
 		}
479
-		$frm_vars['form_params'][ $form->id ] = $params;
479
+		$frm_vars['form_params'][$form->id] = $params;
480 480
 
481
-		if ( isset( $frm_vars['created_entries'][ $form_id ] ) ) {
481
+		if ( isset( $frm_vars['created_entries'][$form_id] ) ) {
482 482
 			return;
483 483
 		}
484 484
 
@@ -494,16 +494,16 @@  discard block
 block discarded – undo
494 494
 		 */
495 495
 		$errors = apply_filters( 'frm_entries_before_create', $errors, $form );
496 496
 
497
-		$frm_vars['created_entries'][ $form_id ] = array( 'errors' => $errors );
497
+		$frm_vars['created_entries'][$form_id] = array( 'errors' => $errors );
498 498
 
499 499
 		if ( empty( $errors ) ) {
500 500
 			$_POST['frm_skip_cookie'] = 1;
501 501
 			$do_success               = false;
502 502
 			if ( $params['action'] == 'create' ) {
503
-				if ( apply_filters( 'frm_continue_to_create', true, $form_id ) && ! isset( $frm_vars['created_entries'][ $form_id ]['entry_id'] ) ) {
504
-					$frm_vars['created_entries'][ $form_id ]['entry_id'] = FrmEntry::create( $_POST );
503
+				if ( apply_filters( 'frm_continue_to_create', true, $form_id ) && ! isset( $frm_vars['created_entries'][$form_id]['entry_id'] ) ) {
504
+					$frm_vars['created_entries'][$form_id]['entry_id'] = FrmEntry::create( $_POST );
505 505
 
506
-					$params['id'] = $frm_vars['created_entries'][ $form_id ]['entry_id'];
506
+					$params['id'] = $frm_vars['created_entries'][$form_id]['entry_id'];
507 507
 					$do_success   = true;
508 508
 				}
509 509
 			}
Please login to merge, or discard this patch.
classes/helpers/FrmFormsHelper.php 2 patches
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 			'class'        => '',
29 29
 			'inc_children' => 'exclude',
30 30
 		);
31
-		$args     = wp_parse_args( $args, $defaults );
31
+		$args = wp_parse_args( $args, $defaults );
32 32
 
33 33
 		if ( ! $args['field_id'] ) {
34 34
 			$args['field_id'] = $field_name;
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 	 */
71 71
 	public static function add_html_attr( $class, $param, &$add_html ) {
72 72
 		if ( ! empty( $class ) ) {
73
-			$add_html[ $param ] = sanitize_title( $param ) . '="' . esc_attr( trim( sanitize_text_field( $class ) ) ) . '"';
73
+			$add_html[$param] = sanitize_title( $param ) . '="' . esc_attr( trim( sanitize_text_field( $class ) ) ) . '"';
74 74
 		}
75 75
 	}
76 76
 
@@ -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>';
@@ -1196,7 +1196,7 @@  discard block
 block discarded – undo
1196 1196
 			$status = 'publish';
1197 1197
 		}
1198 1198
 
1199
-		$name = $nice_names[ $status ];
1199
+		$name = $nice_names[$status];
1200 1200
 
1201 1201
 		return $name;
1202 1202
 	}
@@ -1223,11 +1223,11 @@  discard block
 block discarded – undo
1223 1223
 
1224 1224
 		if ( count( $categories ) === 1 ) {
1225 1225
 			$category = reset( $categories );
1226
-			$icon     = isset( $icons[ $category ] ) ? $icons[ $category ] : $icon;
1226
+			$icon     = isset( $icons[$category] ) ? $icons[$category] : $icon;
1227 1227
 		} elseif ( ! empty( $categories ) ) {
1228 1228
 			foreach ( $icons as $cat => $icon ) {
1229 1229
 				if ( ! in_array( $cat, $categories ) ) {
1230
-					unset( $icons[ $cat ] );
1230
+					unset( $icons[$cat] );
1231 1231
 				}
1232 1232
 			}
1233 1233
 			$icon = reset( $icons );
@@ -1353,7 +1353,7 @@  discard block
 block discarded – undo
1353 1353
 
1354 1354
 		foreach ( $item['categories'] as $k => $category ) {
1355 1355
 			if ( in_array( $category, $plans ) ) {
1356
-				unset( $item['categories'][ $k ] );
1356
+				unset( $item['categories'][$k] );
1357 1357
 				return $category;
1358 1358
 			}
1359 1359
 		}
Please login to merge, or discard this patch.
Doc Comments   +8 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
 	 */
@@ -1389,7 +1393,7 @@  discard block
 block discarded – undo
1389 1393
 	 *
1390 1394
 	 * @param array $values The $_POST array, which contains the values submitted in a form.
1391 1395
 	 *
1392
-	 * @return bool|string A warning message about unsafe params or false.
1396
+	 * @return false|string A warning message about unsafe params or false.
1393 1397
 	 */
1394 1398
 	private static function check_redirect_url_for_unsafe_params( $values ) {
1395 1399
 		if ( ! isset( $values['options'] ) ) {
@@ -1434,7 +1438,7 @@  discard block
 block discarded – undo
1434 1438
 	 *
1435 1439
 	 * @param array $unsafe_params_in_redirect Array of params from the redirect URL whose names are reserved words.
1436 1440
 	 *
1437
-	 * @return bool|string A string with an unsafe param message or false.
1441
+	 * @return false|string A string with an unsafe param message or false.
1438 1442
 	 */
1439 1443
 	private static function create_unsafe_param_warning( $unsafe_params_in_redirect ) {
1440 1444
 		$count                = count( $unsafe_params_in_redirect );
@@ -1465,7 +1469,7 @@  discard block
 block discarded – undo
1465 1469
 	 *
1466 1470
 	 * @since 4.04
1467 1471
 	 *
1468
-	 * @return array Array of WordPress reserved words.
1472
+	 * @return string[] Array of WordPress reserved words.
1469 1473
 	 */
1470 1474
 	public static function reserved_words() {
1471 1475
 		return array(
Please login to merge, or discard this patch.