Code Duplication    Length = 5-9 lines in 7 locations

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

@@ 1289-1293 (lines=5) @@
1286
            EE_Error::add_error($msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__);
1287
            return false;
1288
        }
1289
        if (empty($route)) {
1290
            $msg = sprintf(__('No route has been supplied.', 'event_espresso'), $route);
1291
            EE_Error::add_error($msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__);
1292
            return false;
1293
        }
1294
        if (! method_exists('EED_' . $module, $method_name)) {
1295
            $msg = sprintf(
1296
                __('A valid class method for the %s route has not been supplied.', 'event_espresso'),
@@ 1294-1301 (lines=8) @@
1291
            EE_Error::add_error($msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__);
1292
            return false;
1293
        }
1294
        if (! method_exists('EED_' . $module, $method_name)) {
1295
            $msg = sprintf(
1296
                __('A valid class method for the %s route has not been supplied.', 'event_espresso'),
1297
                $route
1298
            );
1299
            EE_Error::add_error($msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__);
1300
            return false;
1301
        }
1302
        EE_Config::$_module_route_map[$key][$route] = array('EED_' . $module, $method_name);
1303
        return true;
1304
    }
@@ 1363-1367 (lines=5) @@
1360
            EE_Error::add_error($msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__);
1361
            return false;
1362
        }
1363
        if (empty($forward)) {
1364
            $msg = sprintf(__('No forwarding route has been supplied.', 'event_espresso'), $route);
1365
            EE_Error::add_error($msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__);
1366
            return false;
1367
        }
1368
        if (is_array($forward)) {
1369
            if (! isset($forward[1])) {
1370
                $msg = sprintf(
@@ 1369-1376 (lines=8) @@
1366
            return false;
1367
        }
1368
        if (is_array($forward)) {
1369
            if (! isset($forward[1])) {
1370
                $msg = sprintf(
1371
                    __('A class method for the %s forwarding route has not been supplied.', 'event_espresso'),
1372
                    $route
1373
                );
1374
                EE_Error::add_error($msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__);
1375
                return false;
1376
            }
1377
            if (! method_exists($forward[0], $forward[1])) {
1378
                $msg = sprintf(
1379
                    __('The class method %s for the %s forwarding route is in invalid.', 'event_espresso'),

core/EE_Module_Request_Router.core.php 1 location

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

modules/ticket_selector/DisplayTicketSelector.php 1 location

@@ 119-127 (lines=9) @@
116
                $event->EE_Event = EEM_Event::instance()->instantiate_class_from_post_object( $event );
117
                $this->event = $event->EE_Event;
118
            }
119
        } else {
120
            $user_msg = __( 'No Event object or an invalid Event object was supplied.', 'event_espresso' );
121
            $dev_msg = $user_msg . __(
122
                    '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.',
123
                    'event_espresso'
124
                );
125
            EE_Error::add_error( $user_msg . '||' . $dev_msg, __FILE__, __FUNCTION__, __LINE__ );
126
            return false;
127
        }
128
        return true;
129
    }
130