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/EED_Ticket_Selector.module.php 1 location

@@ 259-264 (lines=6) @@
256
		} else if ( $event instanceof WP_Post && $event->post_type == 'espresso_events' ) {
257
			$event->EE_Event = EEM_Event::instance()->instantiate_class_from_post_object( $event );
258
			self::$_event = $event->EE_Event;
259
		} else {
260
			$user_msg = __( 'No Event object or an invalid Event object was supplied.', 'event_espresso' );
261
			$dev_msg = $user_msg . __( '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.', 'event_espresso' );
262
			EE_Error::add_error( $user_msg . '||' . $dev_msg, __FILE__, __FUNCTION__, __LINE__ );
263
			return false;
264
		}
265
		return true;
266
	}
267

core/EE_Config.core.php 4 locations

@@ 1347-1351 (lines=5) @@
1344
			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1345
			return false;
1346
		}
1347
		if ( empty( $route ) ) {
1348
			$msg = sprintf( __( 'No route has been supplied.', 'event_espresso' ), $route );
1349
			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1350
			return false;
1351
		}
1352
		if ( ! method_exists( 'EED_' . $module, $method_name ) ) {
1353
			$msg = sprintf(
1354
				__( 'A valid class method for the %s route has not been supplied.', 'event_espresso' ),
@@ 1352-1356 (lines=5) @@
1349
			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1350
			return false;
1351
		}
1352
		if ( ! method_exists( 'EED_' . $module, $method_name ) ) {
1353
			$msg = sprintf(
1354
				__( 'A valid class method for the %s route has not been supplied.', 'event_espresso' ),
1355
				$route
1356
			);
1357
			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1358
			return false;
1359
		}
@@ 1418-1422 (lines=5) @@
1415
			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1416
			return false;
1417
		}
1418
		if ( empty( $forward ) ) {
1419
			$msg = sprintf( __( 'No forwarding route has been supplied.', 'event_espresso' ), $route );
1420
			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1421
			return false;
1422
		}
1423
		if ( is_array( $forward ) ) {
1424
			if ( ! isset( $forward[1] ) ) {
1425
				$msg = sprintf(
@@ 1424-1428 (lines=5) @@
1421
			return false;
1422
		}
1423
		if ( is_array( $forward ) ) {
1424
			if ( ! isset( $forward[1] ) ) {
1425
				$msg = sprintf(
1426
					__( 'A class method for the %s forwarding route has not been supplied.', 'event_espresso' ),
1427
					$route
1428
				);
1429
				EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1430
				return false;
1431
			}