Code Duplication    Length = 4-13 lines in 7 locations

core/db_classes/EE_Question_Form_Input.class.php 1 location

@@ 86-89 (lines=4) @@
83
	 * @return \EE_Question_Form_Input
84
	 */
85
	public function __construct( EE_Question $QST = NULL, EE_Answer $ANS = NULL, $q_meta = array() ) {
86
		if ( empty( $QST ) || empty( $ANS ) ) {
87
			EE_Error::add_error( __( 'An error occurred. A valid EE_Question or EE_Answer object was not received.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
88
			return NULL;
89
		}
90
		$this->_QST = $QST;
91
		$this->_ANS = $ANS;
92
		$this->set_question_form_input_meta( $q_meta );

admin_pages/venues/Venues_Admin_Page.core.php 1 location

@@ 1368-1372 (lines=5) @@
1365
		$category_desc= isset( $this->_req_data['category_desc'] ) ? $this->_req_data['category_desc'] : '';
1366
		$category_parent = isset( $this->_req_data['category_parent'] ) ? $this->_req_data['category_parent'] : 0;
1367
1368
		if ( empty( $category_name ) ) {
1369
			$msg = __( 'You must add a name for the category.', 'event_espresso' );
1370
			EE_Error::add_error( $msg, __FILE__, __FUNCTION__, __LINE__ );
1371
			return false;
1372
		}
1373
1374
1375
		$term_args=array(

core/libraries/messages/EE_Message_Resource_Manager.lib.php 1 location

@@ 639-648 (lines=10) @@
636
            $this->ensure_messenger_is_active($messenger_name, $update_option);
637
        }
638
639
        if (! empty($not_installed)) {
640
            EE_Error::add_error(
641
                sprintf(
642
                    __('The following messengers are either not installed or are invalid:%1$s %2$s', 'event_espresso'),
643
                    '<br />',
644
                    implode(', ', $not_installed)
645
                ),
646
                __FILE__, __FUNCTION__, __LINE__
647
            );
648
        }
649
    }
650
651

core/EE_Module_Request_Router.core.php 1 location

@@ 134-138 (lines=5) @@
131
        // get module method that route has been mapped to
132
        $module_method = EE_Config::get_route($current_route, $key);
133
        // verify result was returned
134
        if (empty($module_method)) {
135
            $msg = sprintf(
136
                __('The requested route %s could not be mapped to any registered modules.', 'event_espresso'),
137
                $current_route
138
            );
139
            EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
140
            return false;
141
        }

admin_pages/registrations/Registrations_Admin_Page.core.php 1 location

@@ 1099-1110 (lines=12) @@
1096
        $REG_ID = ( ! empty($this->_req_data['_REG_ID'])) ? absint($this->_req_data['_REG_ID']) : false;
1097
        if ($this->_registration = $REG->get_one_by_ID($REG_ID)) {
1098
            return true;
1099
        } else {
1100
            $error_msg = sprintf(
1101
                esc_html__(
1102
                    'An error occurred and the details for Registration ID #%s could not be retrieved.',
1103
                    'event_espresso'
1104
                ),
1105
                $REG_ID
1106
            );
1107
            EE_Error::add_error($error_msg, __FILE__, __FUNCTION__, __LINE__);
1108
            $this->_registration = null;
1109
            return false;
1110
        }
1111
    }
1112
1113

admin_pages/messages/Messages_Admin_Page.core.php 1 location

@@ 2751-2763 (lines=13) @@
2748
                            'MTP_content'        => $set_column_values['MTP_content']
2749
                        );
2750
                        if ($updated = $MTP->update($message_template_fields, array($where_cols_n_values))) {
2751
                            if ($updated === false) {
2752
                                EE_Error::add_error(
2753
                                    sprintf(
2754
                                        esc_html__('%s field was NOT updated for some reason', 'event_espresso'),
2755
                                        $template_field
2756
                                    ),
2757
                                    __FILE__,
2758
                                    __FUNCTION__,
2759
                                    __LINE__
2760
                                );
2761
                            } else {
2762
                                $success = 1;
2763
                            }
2764
                        } else {
2765
                            //only do this logic if we don't have a MTP_ID for this field
2766
                            if (empty($this->_req_data['MTP_template_fields'][$template_field]['MTP_ID'])) {

core/EE_Session.core.php 1 location

@@ 493-496 (lines=4) @@
490
    {
491
492
        // nothing ??? bad data ??? go home!
493
        if (empty($data) || ! is_array($data)) {
494
            EE_Error::add_error(__('No session data or invalid session data was provided.', 'event_espresso'), __FILE__,
495
                __FUNCTION__, __LINE__);
496
            return false;
497
        }
498
        foreach ($data as $key => $value) {
499
            if (isset($this->_default_session_vars[ $key ])) {