Code Duplication    Length = 5-9 lines in 7 locations

core/EE_Module_Request_Router.core.php 1 location

@@ 151-155 (lines=5) @@
148
		// grab module name
149
		$module_name = $module_method[0];
150
		// verify that a class method was registered properly
151
		if ( ! isset( $module_method[1] )) {
152
			$msg = sprintf( __( 'A class method for the %s  route has not been properly registered.', 'event_espresso' ), $current_route );
153
			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
154
			return FALSE;
155
		}
156
		// grab method
157
		$method = $module_method[1];
158
		// verify that class exists

core/helpers/EEH_Address.helper.php 1 location

@@ 38-46 (lines=9) @@
35
		$add_wrapper = true
36
	) {
37
		// check that incoming object implements the EEI_Address interface
38
		if ( ! $obj_with_address instanceof EEI_Address ) {
39
			$msg = __( 'The address could not be formatted.', 'event_espresso' );
40
			$dev_msg = __(
41
				'The Address Formatter requires passed objects to implement the EEI_Address interface.',
42
				'event_espresso'
43
			);
44
			EE_Error::add_error( $msg . '||' . $dev_msg, __FILE__, __FUNCTION__, __LINE__ );
45
			return null;
46
		}
47
		// obtain an address formatter
48
		$formatter = EEH_Address::_get_formatter( $type );
49
		// apply schema.org formatting ?

modules/ticket_selector/DisplayTicketSelector.php 1 location

@@ 104-112 (lines=9) @@
101
                $event->EE_Event = \EEM_Event::instance()->instantiate_class_from_post_object( $event );
102
                $this->event = $event->EE_Event;
103
            }
104
        } else {
105
            $user_msg = __( 'No Event object or an invalid Event object was supplied.', 'event_espresso' );
106
            $dev_msg = $user_msg . __(
107
                    'In order to generate a ticket selector, please ensure you are passing either an EE_Event object or a WP_Post object of the post type "espresso_event" to the EE_Ticket_Selector class constructor.',
108
                    'event_espresso'
109
                );
110
            \EE_Error::add_error( $user_msg . '||' . $dev_msg, __FILE__, __FUNCTION__, __LINE__ );
111
            return false;
112
        }
113
        return true;
114
    }
115

core/EE_Config.core.php 4 locations

@@ 1414-1418 (lines=5) @@
1411
            EE_Error::add_error($msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__);
1412
            return false;
1413
        }
1414
        if (empty($route)) {
1415
            $msg = sprintf(__('No route has been supplied.', 'event_espresso'), $route);
1416
            EE_Error::add_error($msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__);
1417
            return false;
1418
        }
1419
        if (! method_exists('EED_' . $module, $method_name)) {
1420
            $msg = sprintf(
1421
                __('A valid class method for the %s route has not been supplied.', 'event_espresso'),
@@ 1419-1426 (lines=8) @@
1416
            EE_Error::add_error($msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__);
1417
            return false;
1418
        }
1419
        if (! method_exists('EED_' . $module, $method_name)) {
1420
            $msg = sprintf(
1421
                __('A valid class method for the %s route has not been supplied.', 'event_espresso'),
1422
                $route
1423
            );
1424
            EE_Error::add_error($msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__);
1425
            return false;
1426
        }
1427
        EE_Config::$_module_route_map[$key][$route] = array('EED_' . $module, $method_name);
1428
        return true;
1429
    }
@@ 1488-1492 (lines=5) @@
1485
            EE_Error::add_error($msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__);
1486
            return false;
1487
        }
1488
        if (empty($forward)) {
1489
            $msg = sprintf(__('No forwarding route has been supplied.', 'event_espresso'), $route);
1490
            EE_Error::add_error($msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__);
1491
            return false;
1492
        }
1493
        if (is_array($forward)) {
1494
            if (! isset($forward[1])) {
1495
                $msg = sprintf(
@@ 1494-1501 (lines=8) @@
1491
            return false;
1492
        }
1493
        if (is_array($forward)) {
1494
            if (! isset($forward[1])) {
1495
                $msg = sprintf(
1496
                    __('A class method for the %s forwarding route has not been supplied.', 'event_espresso'),
1497
                    $route
1498
                );
1499
                EE_Error::add_error($msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__);
1500
                return false;
1501
            }
1502
            if (! method_exists($forward[0], $forward[1])) {
1503
                $msg = sprintf(
1504
                    __('The class method %s for the %s forwarding route is in invalid.', 'event_espresso'),