Code Duplication    Length = 5-13 lines in 2 locations

core/db_classes/EE_Export.class.php 1 location

@@ 481-485 (lines=5) @@
478
					}else{
479
						$question_label = sprintf( __( 'Question $s', 'event_espresso' ), $answer_row[ 'Answer.QST_ID' ] );
480
					}
481
                                        if( isset( $answer_row[ 'Question.QST_type'] ) && $answer_row[ 'Question.QST_type' ] == EEM_Question::QST_type_state ) {
482
                                            $reg_csv_array[ $question_label ] = EEM_State::instance()->get_state_name_by_ID( $answer_row[ 'Answer.ANS_value' ] );
483
                                        } else {
484
                                            $reg_csv_array[ $question_label ] = $this->_prepare_value_from_db_for_display( EEM_Answer::instance(), 'ANS_value', $answer_row[ 'Answer.ANS_value' ] );
485
                                        }
486
				}
487
				$registrations_csv_ready_array[] = apply_filters( 'FHEE__EE_Export__report_registrations__reg_csv_array', $reg_csv_array, $reg_row );
488
			}

core/libraries/batch/JobHandlers/RegistrationsReport.php 1 location

@@ 342-354 (lines=13) @@
339
                    } else {
340
                        $question_label = sprintf(__('Question $s', 'event_espresso'), $answer_row['Answer.QST_ID']);
341
                    }
342
                    if (isset($answer_row['Question.QST_type'])
343
                        && $answer_row['Question.QST_type'] == \EEM_Question::QST_type_state
344
                    ) {
345
                        $reg_csv_array[$question_label] = \EEM_State::instance()
346
                                                                    ->get_state_name_by_ID($answer_row['Answer.ANS_value']);
347
                    } else {
348
                        $reg_csv_array[$question_label] = \EEH_Export::prepare_value_from_db_for_display(\EEM_Answer::instance(),
349
                            'ANS_value', $answer_row['Answer.ANS_value']);
350
                    }
351
                }
352
                $registrations_csv_ready_array[] = apply_filters('FHEE__EE_Export__report_registrations__reg_csv_array',
353
                    $reg_csv_array, $reg_row);
354
            }
355
        }
356
        //if we couldn't export anything, we want to at least show the column headers
357
        if (empty($registrations_csv_ready_array)) {