Code Duplication    Length = 4-12 lines in 6 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_Session.core.php 1 location

@@ 443-446 (lines=4) @@
440
	public function set_session_data( $data ) {
441
442
		// nothing ??? bad data ??? go home!
443
		if ( empty( $data ) || ! is_array( $data )) {
444
			EE_Error::add_error( __( 'No session data or invalid session data was provided.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
445
			return FALSE;
446
		}
447
448
		foreach ( $data as $key =>$value ) {
449
			if ( isset( $this->_default_session_vars[ $key ] )) {

admin_pages/registrations/Registrations_Admin_Page.core.php 1 location

@@ 998-1009 (lines=12) @@
995
        $REG_ID = ( ! empty($this->_req_data['_REG_ID'])) ? absint($this->_req_data['_REG_ID']) : false;
996
        if ($this->_registration = $REG->get_one_by_ID($REG_ID)) {
997
            return true;
998
        } else {
999
            $error_msg = sprintf(
1000
                esc_html__(
1001
                    'An error occurred and the details for Registration ID #%s could not be retrieved.',
1002
                    'event_espresso'
1003
                ),
1004
                $REG_ID
1005
            );
1006
            EE_Error::add_error($error_msg, __FILE__, __FUNCTION__, __LINE__);
1007
            $this->_registration = null;
1008
            return false;
1009
        }
1010
    }
1011
1012

core/EE_Module_Request_Router.core.php 1 location

@@ 139-143 (lines=5) @@
136
		$module_method = EE_Config::get_route( $current_route, $key );
137
		//EEH_Debug_Tools::printr( $module_method, '$module_method  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' );
138
		// verify result was returned
139
		if ( empty( $module_method )) {
140
			$msg = sprintf( __( 'The requested route %s could not be mapped to any registered modules.', 'event_espresso' ), $current_route );
141
			EE_Error::add_error( $msg, __FILE__, __FUNCTION__, __LINE__ );
142
			return FALSE;
143
		}
144
		// verify that result is an array
145
		if ( ! is_array( $module_method )) {
146
			$msg = sprintf( __( 'The %s  route has not been properly registered.', 'event_espresso' ), $current_route );