@@ -161,6 +161,9 @@ discard block |
||
| 161 | 161 | return $response; |
| 162 | 162 | } |
| 163 | 163 | |
| 164 | + /** |
|
| 165 | + * @param string $source_form_name |
|
| 166 | + */ |
|
| 164 | 167 | protected function prepare_new_form( $source_id, $source_form_name ) { |
| 165 | 168 | return array( |
| 166 | 169 | 'import_form_id' => $source_id, |
@@ -217,6 +220,7 @@ discard block |
||
| 217 | 220 | particularly the overrides in child classes, as |
| 218 | 221 | there will be no need to rebuild the converter |
| 219 | 222 | array at usage locations. |
| 223 | + * @return string |
|
| 220 | 224 | */ |
| 221 | 225 | protected function convert_field_type( $field, $use = '' ) { |
| 222 | 226 | return $use ? $use : ( is_array( $field ) ? $field['type'] : $field->type ); |
@@ -339,6 +343,9 @@ discard block |
||
| 339 | 343 | return array(); |
| 340 | 344 | } |
| 341 | 345 | |
| 346 | + /** |
|
| 347 | + * @param string $type |
|
| 348 | + */ |
|
| 342 | 349 | private function is_unsupported_field( $type ) { |
| 343 | 350 | $fields = $this->unsupported_field_types(); |
| 344 | 351 | |
@@ -354,6 +361,9 @@ discard block |
||
| 354 | 361 | return array(); |
| 355 | 362 | } |
| 356 | 363 | |
| 364 | + /** |
|
| 365 | + * @param string $type |
|
| 366 | + */ |
|
| 357 | 367 | protected function should_skip_field( $type ) { |
| 358 | 368 | $skip_pro_fields = $this->skip_pro_fields(); |
| 359 | 369 | |
@@ -273,7 +273,7 @@ discard block |
||
| 273 | 273 | $form['fields'][] = $new_field; |
| 274 | 274 | $this->current_section = null; |
| 275 | 275 | |
| 276 | - ++$field_order; |
|
| 276 | + ++ $field_order; |
|
| 277 | 277 | } |
| 278 | 278 | |
| 279 | 279 | protected function before_add_field( $field, &$new_field, &$form, &$field_order ) { |
@@ -299,7 +299,7 @@ discard block |
||
| 299 | 299 | |
| 300 | 300 | foreach ( $form['fields'] as $key => $new_field ) { |
| 301 | 301 | $new_field['form_id'] = $form_id; |
| 302 | - $form['fields'][ $key ]['id'] = FrmField::create( $new_field ); |
|
| 302 | + $form['fields'][$key]['id'] = FrmField::create( $new_field ); |
|
| 303 | 303 | } |
| 304 | 304 | |
| 305 | 305 | // create emails |
@@ -311,7 +311,7 @@ discard block |
||
| 311 | 311 | if ( $key === 'post_title' ) { |
| 312 | 312 | $new_action->post_title = $value; |
| 313 | 313 | } else { |
| 314 | - $new_action->post_content[ $key ] = $this->replace_smart_tags( $value, $form['fields'] ); |
|
| 314 | + $new_action->post_content[$key] = $this->replace_smart_tags( $value, $form['fields'] ); |
|
| 315 | 315 | } |
| 316 | 316 | } |
| 317 | 317 | |
@@ -363,7 +363,7 @@ discard block |
||
| 363 | 363 | |
| 364 | 364 | $imported = $this->get_tracked_import(); |
| 365 | 365 | |
| 366 | - $imported[ $this->slug ][ $new_form_id ] = $source_id; |
|
| 366 | + $imported[$this->slug][$new_form_id] = $source_id; |
|
| 367 | 367 | |
| 368 | 368 | update_option( $this->tracking, $imported, false ); |
| 369 | 369 | } |
@@ -383,8 +383,8 @@ discard block |
||
| 383 | 383 | private function is_imported( $source_id ) { |
| 384 | 384 | $imported = $this->get_tracked_import(); |
| 385 | 385 | $new_form_id = 0; |
| 386 | - if ( isset( $imported[ $this->slug ] ) && in_array( $source_id, $imported[ $this->slug ] ) ) { |
|
| 387 | - $new_form_id = array_search( $source_id, array_reverse( $imported[ $this->slug ], true ) ); |
|
| 386 | + if ( isset( $imported[$this->slug] ) && in_array( $source_id, $imported[$this->slug] ) ) { |
|
| 387 | + $new_form_id = array_search( $source_id, array_reverse( $imported[$this->slug], true ) ); |
|
| 388 | 388 | } |
| 389 | 389 | |
| 390 | 390 | return $new_form_id; |
@@ -478,8 +478,7 @@ discard block |
||
| 478 | 478 | * @return string |
| 479 | 479 | */ |
| 480 | 480 | protected function get_field_label( $field ) { |
| 481 | - $label = is_array( $field ) ? ( isset( $field['label'] ) ? $field['label'] : '' ) : |
|
| 482 | - ( isset( $field->label ) ? $field->label : '' ); |
|
| 481 | + $label = is_array( $field ) ? ( isset( $field['label'] ) ? $field['label'] : '' ) : ( isset( $field->label ) ? $field->label : '' ); |
|
| 483 | 482 | if ( ! empty( $label ) ) { |
| 484 | 483 | return sanitize_text_field( $label ); |
| 485 | 484 | } |