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 ?

core/EE_Config.core.php 4 locations

@@ 1369-1373 (lines=5) @@
1366
            EE_Error::add_error($msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__);
1367
            return false;
1368
        }
1369
        if (empty($route)) {
1370
            $msg = sprintf(__('No route has been supplied.', 'event_espresso'), $route);
1371
            EE_Error::add_error($msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__);
1372
            return false;
1373
        }
1374
        if (! method_exists('EED_' . $module, $method_name)) {
1375
            $msg = sprintf(
1376
                __('A valid class method for the %s route has not been supplied.', 'event_espresso'),
@@ 1374-1378 (lines=5) @@
1371
            EE_Error::add_error($msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__);
1372
            return false;
1373
        }
1374
        if (! method_exists('EED_' . $module, $method_name)) {
1375
            $msg = sprintf(
1376
                __('A valid class method for the %s route has not been supplied.', 'event_espresso'),
1377
                $route
1378
            );
1379
            EE_Error::add_error($msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__);
1380
            return false;
1381
        }
@@ 1440-1444 (lines=5) @@
1437
            EE_Error::add_error($msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__);
1438
            return false;
1439
        }
1440
        if (empty($forward)) {
1441
            $msg = sprintf(__('No forwarding route has been supplied.', 'event_espresso'), $route);
1442
            EE_Error::add_error($msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__);
1443
            return false;
1444
        }
1445
        if (is_array($forward)) {
1446
            if (! isset($forward[1])) {
1447
                $msg = sprintf(
@@ 1446-1450 (lines=5) @@
1443
            return false;
1444
        }
1445
        if (is_array($forward)) {
1446
            if (! isset($forward[1])) {
1447
                $msg = sprintf(
1448
                    __('A class method for the %s forwarding route has not been supplied.', 'event_espresso'),
1449
                    $route
1450
                );
1451
                EE_Error::add_error($msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__);
1452
                return false;
1453
            }

modules/ticket_selector/DisplayTicketSelector.php 1 location

@@ 104-109 (lines=6) @@
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
        }