Completed
Pull Request — master (#141)
by Stephanie
02:30
created
classes/models/FrmFormMigrator.php 3 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
 		}
25 25
 
26 26
 		if ( ! function_exists( 'is_plugin_active' ) ) {
27
-		    require_once( ABSPATH . '/wp-admin/includes/plugin.php' );
27
+			require_once( ABSPATH . '/wp-admin/includes/plugin.php' );
28 28
 		}
29 29
 
30 30
 		$this->source_active = is_plugin_active( $this->path );
Please login to merge, or discard this patch.
Doc Comments   +10 added lines patch added patch discarded remove patch
@@ -172,6 +172,9 @@  discard block
 block discarded – undo
172 172
 		return $response;
173 173
 	}
174 174
 
175
+	/**
176
+	 * @param string $source_form_name
177
+	 */
175 178
 	protected function prepare_new_form( $source_id, $source_form_name ) {
176 179
 		return array(
177 180
 			'import_form_id' => $source_id,
@@ -299,6 +302,7 @@  discard block
 block discarded – undo
299 302
 	/**
300 303
 	 * Replace the original combo field with a group.
301 304
 	 * This switches the name field to individual fields.
305
+	 * @param integer $remove
302 306
 	 */
303 307
 	protected function insert_fields_in_array( $subs, $start, $remove, &$fields ) {
304 308
 		array_splice( $fields, $start, $remove, $subs );
@@ -467,6 +471,9 @@  discard block
 block discarded – undo
467 471
 		return array();
468 472
 	}
469 473
 
474
+	/**
475
+	 * @param string $type
476
+	 */
470 477
 	private function is_unsupported_field( $type ) {
471 478
 		$fields = $this->unsupported_field_types();
472 479
 
@@ -482,6 +489,9 @@  discard block
 block discarded – undo
482 489
 		return array();
483 490
 	}
484 491
 
492
+	/**
493
+	 * @param string $type
494
+	 */
485 495
 	protected function should_skip_field( $type ) {
486 496
 		$skip_pro_fields = $this->skip_pro_fields();
487 497
 
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -333,7 +333,7 @@  discard block
 block discarded – undo
333 333
 
334 334
 		$form['fields'][]         = $new_field;
335 335
 
336
-		$field_order++;
336
+		$field_order ++;
337 337
 
338 338
 		$this->current_section = array();
339 339
 	}
@@ -361,7 +361,7 @@  discard block
 block discarded – undo
361 361
 
362 362
 		foreach ( $form['fields'] as $key => $new_field ) {
363 363
 			$new_field['form_id']         = $form_id;
364
-			$form['fields'][ $key ]['id'] = FrmField::create( $new_field );
364
+			$form['fields'][$key]['id'] = FrmField::create( $new_field );
365 365
 		}
366 366
 
367 367
 		// create emails
@@ -373,7 +373,7 @@  discard block
 block discarded – undo
373 373
 				if ( $key === 'post_title' ) {
374 374
 					$new_action->post_title = $value;
375 375
 				} else {
376
-					$new_action->post_content[ $key ] = $this->replace_smart_tags( $value, $form['fields'] );
376
+					$new_action->post_content[$key] = $this->replace_smart_tags( $value, $form['fields'] );
377 377
 				}
378 378
 			}
379 379
 
@@ -425,7 +425,7 @@  discard block
 block discarded – undo
425 425
 
426 426
 		$imported = $this->get_tracked_import();
427 427
 
428
-		$imported[ $this->slug ][ $new_form_id ] = $source_id;
428
+		$imported[$this->slug][$new_form_id] = $source_id;
429 429
 
430 430
 		update_option( $this->tracking, $imported, false );
431 431
 	}
@@ -445,11 +445,11 @@  discard block
 block discarded – undo
445 445
 	private function is_imported( $source_id ) {
446 446
 		$imported    = $this->get_tracked_import();
447 447
 		$new_form_id = 0;
448
-		if ( ! isset( $imported[ $this->slug ] ) || ! in_array( $source_id, $imported[ $this->slug ] ) ) {
448
+		if ( ! isset( $imported[$this->slug] ) || ! in_array( $source_id, $imported[$this->slug] ) ) {
449 449
 			return $new_form_id;
450 450
 		}
451 451
 
452
-		$new_form_id = array_search( $source_id, array_reverse( $imported[ $this->slug ], true ) );
452
+		$new_form_id = array_search( $source_id, array_reverse( $imported[$this->slug], true ) );
453 453
 		if ( ! empty( $new_form_id ) && empty( FrmForm::get_key_by_id( $new_form_id ) ) ) {
454 454
 			// Allow reimport if the form was deleted.
455 455
 			$new_form_id = 0;
Please login to merge, or discard this patch.