Completed
Push — master ( 223941...33757f )
by Stephanie
02:50
created
classes/models/FrmFormMigrator.php 2 patches
Doc Comments   +12 added lines patch added patch discarded remove patch
@@ -143,6 +143,9 @@  discard block
 block discarded – undo
143 143
 		return $this->add_form( $form );
144 144
 	}
145 145
 
146
+	/**
147
+	 * @param string $source_form_name
148
+	 */
146 149
 	protected function prepare_new_form( $source_id, $source_form_name ) {
147 150
 		return array(
148 151
 			'import_form_id' => $source_id,
@@ -191,6 +194,9 @@  discard block
 block discarded – undo
191 194
 		// customize this function
192 195
 	}
193 196
 
197
+	/**
198
+	 * @param string $type
199
+	 */
194 200
 	protected function convert_field_type( $type ) {
195 201
 		return $type;
196 202
 	}
@@ -303,6 +309,9 @@  discard block
 block discarded – undo
303 309
 		return array();
304 310
 	}
305 311
 
312
+	/**
313
+	 * @param string $type
314
+	 */
306 315
 	private function is_unsupported_field( $type ) {
307 316
 		$fields = $this->unsupported_field_types(); 
308 317
 		return in_array( $type, $fields, true );
@@ -316,6 +325,9 @@  discard block
 block discarded – undo
316 325
 		return array();
317 326
 	}
318 327
 
328
+	/**
329
+	 * @param string $type
330
+	 */
319 331
 	private function should_skip_field( $type ) {
320 332
 		$skip_pro_fields = $this->skip_pro_fields(); 
321 333
 		return ( ! FrmAppHelper::pro_is_installed() && in_array( $type, $skip_pro_fields, true ) );
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
 			$new_field = FrmFieldsHelper::setup_new_vars( $field['type'], $form_id );
227 227
 			$new_field = array_merge( $new_field, $field );
228 228
 			$new_field['field_options'] = array_merge( $new_field['field_options'], $field );
229
-			$form['fields'][ $key ]['id'] = FrmField::create( $new_field, $form_id );
229
+			$form['fields'][$key]['id'] = FrmField::create( $new_field, $form_id );
230 230
 		}
231 231
 
232 232
 		// create emails
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
 				if ( $key === 'post_title' ) {
239 239
 					$new_action->post_title = $value;
240 240
 				} else {
241
-					$new_action->post_content[ $key ] = $this->replace_smart_tags( $value, $form['fields'] );
241
+					$new_action->post_content[$key] = $this->replace_smart_tags( $value, $form['fields'] );
242 242
 				}
243 243
 			}
244 244
 
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
 
269 269
 		$imported = $this->get_tracked_import();
270 270
 
271
-		$imported[ $this->slug ][ $new_form_id ] = $source_id;
271
+		$imported[$this->slug][$new_form_id] = $source_id;
272 272
 
273 273
 		update_option( $this->tracking, $imported, false );
274 274
 	}
@@ -288,8 +288,8 @@  discard block
 block discarded – undo
288 288
 	private function is_imported( $source_id ) {
289 289
 		$imported = $this->get_tracked_import();
290 290
 		$new_form_id = 0;
291
-		if ( isset( $imported[ $this->slug ] ) && in_array( $source_id, $imported[ $this->slug ] ) ) {
292
-			$new_form_id = array_search( $source_id, array_reverse( $imported[ $this->slug ], true ) );
291
+		if ( isset( $imported[$this->slug] ) && in_array( $source_id, $imported[$this->slug] ) ) {
292
+			$new_form_id = array_search( $source_id, array_reverse( $imported[$this->slug], true ) );
293 293
 		}
294 294
 		return $new_form_id;
295 295
 	}
Please login to merge, or discard this patch.