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 ?

modules/ticket_selector/EED_Ticket_Selector.module.php 1 location

@@ 251-256 (lines=6) @@
248
		} else if ( $event instanceof WP_Post && $event->post_type == 'espresso_events' ) {
249
			$event->EE_Event = EEM_Event::instance()->instantiate_class_from_post_object( $event );
250
			self::$_event = $event->EE_Event;
251
		} else {
252
			$user_msg = __( 'No Event object or an invalid Event object was supplied.', 'event_espresso' );
253
			$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' );
254
			EE_Error::add_error( $user_msg . '||' . $dev_msg, __FILE__, __FUNCTION__, __LINE__ );
255
			return false;
256
		}
257
		return true;
258
	}
259

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

core/EE_Config.core.php 4 locations

@@ 1340-1344 (lines=5) @@
1337
			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1338
			return false;
1339
		}
1340
		if ( empty( $route ) ) {
1341
			$msg = sprintf( __( 'No route has been supplied.', 'event_espresso' ), $route );
1342
			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1343
			return false;
1344
		}
1345
		if ( ! method_exists( 'EED_' . $module, $method_name ) ) {
1346
			$msg = sprintf(
1347
				__( 'A valid class method for the %s route has not been supplied.', 'event_espresso' ),
@@ 1345-1349 (lines=5) @@
1342
			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1343
			return false;
1344
		}
1345
		if ( ! method_exists( 'EED_' . $module, $method_name ) ) {
1346
			$msg = sprintf(
1347
				__( 'A valid class method for the %s route has not been supplied.', 'event_espresso' ),
1348
				$route
1349
			);
1350
			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1351
			return false;
1352
		}
@@ 1411-1415 (lines=5) @@
1408
			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1409
			return false;
1410
		}
1411
		if ( empty( $forward ) ) {
1412
			$msg = sprintf( __( 'No forwarding route has been supplied.', 'event_espresso' ), $route );
1413
			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1414
			return false;
1415
		}
1416
		if ( is_array( $forward ) ) {
1417
			if ( ! isset( $forward[1] ) ) {
1418
				$msg = sprintf(
@@ 1417-1421 (lines=5) @@
1414
			return false;
1415
		}
1416
		if ( is_array( $forward ) ) {
1417
			if ( ! isset( $forward[1] ) ) {
1418
				$msg = sprintf(
1419
					__( 'A class method for the %s forwarding route has not been supplied.', 'event_espresso' ),
1420
					$route
1421
				);
1422
				EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1423
				return false;
1424
			}