Completed
Push — master ( 4f74d1...ff3fae )
by Stephanie
03:06
created
classes/models/FrmFormMigrator.php 2 patches
Doc Comments   +14 added lines patch added patch discarded remove patch
@@ -148,6 +148,9 @@  discard block
 block discarded – undo
148 148
 		return $this->add_form( $form );
149 149
 	}
150 150
 
151
+	/**
152
+	 * @param string $source_form_name
153
+	 */
151 154
 	protected function prepare_new_form( $source_id, $source_form_name ) {
152 155
 		return array(
153 156
 			'import_form_id' => $source_id,
@@ -197,6 +200,11 @@  discard block
 block discarded – undo
197 200
 		// customize this function
198 201
 	}
199 202
 
203
+	/**
204
+	 * @param string $type
205
+	 *
206
+	 * @return string
207
+	 */
200 208
 	protected function convert_field_type( $type ) {
201 209
 		return $type;
202 210
 	}
@@ -309,6 +317,9 @@  discard block
 block discarded – undo
309 317
 		return array();
310 318
 	}
311 319
 
320
+	/**
321
+	 * @param string $type
322
+	 */
312 323
 	private function is_unsupported_field( $type ) {
313 324
 		$fields = $this->unsupported_field_types();
314 325
 		return in_array( $type, $fields, true );
@@ -322,6 +333,9 @@  discard block
 block discarded – undo
322 333
 		return array();
323 334
 	}
324 335
 
336
+	/**
337
+	 * @param string $type
338
+	 */
325 339
 	private function should_skip_field( $type ) {
326 340
 		$skip_pro_fields = $this->skip_pro_fields();
327 341
 		return ( ! FrmAppHelper::pro_is_installed() && in_array( $type, $skip_pro_fields, true ) );
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
 			$this->prepare_field( $field, $new_field );
190 190
 			$form['fields'][] = $new_field;
191 191
 
192
-			$field_order++;
192
+			$field_order ++;
193 193
 		}
194 194
 	}
195 195
 
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
 
233 233
 		foreach ( $form['fields'] as $key => $new_field ) {
234 234
 			$new_field['form_id'] = $form_id;
235
-			$form['fields'][ $key ]['id'] = FrmField::create( $new_field );
235
+			$form['fields'][$key]['id'] = FrmField::create( $new_field );
236 236
 		}
237 237
 
238 238
 		// create emails
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
 				if ( $key === 'post_title' ) {
245 245
 					$new_action->post_title = $value;
246 246
 				} else {
247
-					$new_action->post_content[ $key ] = $this->replace_smart_tags( $value, $form['fields'] );
247
+					$new_action->post_content[$key] = $this->replace_smart_tags( $value, $form['fields'] );
248 248
 				}
249 249
 			}
250 250
 
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
 
275 275
 		$imported = $this->get_tracked_import();
276 276
 
277
-		$imported[ $this->slug ][ $new_form_id ] = $source_id;
277
+		$imported[$this->slug][$new_form_id] = $source_id;
278 278
 
279 279
 		update_option( $this->tracking, $imported, false );
280 280
 	}
@@ -294,8 +294,8 @@  discard block
 block discarded – undo
294 294
 	private function is_imported( $source_id ) {
295 295
 		$imported = $this->get_tracked_import();
296 296
 		$new_form_id = 0;
297
-		if ( isset( $imported[ $this->slug ] ) && in_array( $source_id, $imported[ $this->slug ] ) ) {
298
-			$new_form_id = array_search( $source_id, array_reverse( $imported[ $this->slug ], true ) );
297
+		if ( isset( $imported[$this->slug] ) && in_array( $source_id, $imported[$this->slug] ) ) {
298
+			$new_form_id = array_search( $source_id, array_reverse( $imported[$this->slug], true ) );
299 299
 		}
300 300
 		return $new_form_id;
301 301
 	}
Please login to merge, or discard this patch.