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

@@ 1232-1236 (lines=5) @@
1229
			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1230
			return false;
1231
		}
1232
		if ( empty( $route ) ) {
1233
			$msg = sprintf( __( 'No route has been supplied.', 'event_espresso' ), $route );
1234
			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1235
			return false;
1236
		}
1237
		if ( ! method_exists( 'EED_' . $module, $method_name ) ) {
1238
			$msg = sprintf(
1239
				__( 'A valid class method for the %s route has not been supplied.', 'event_espresso' ),
@@ 1237-1241 (lines=5) @@
1234
			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1235
			return false;
1236
		}
1237
		if ( ! method_exists( 'EED_' . $module, $method_name ) ) {
1238
			$msg = sprintf(
1239
				__( 'A valid class method for the %s route has not been supplied.', 'event_espresso' ),
1240
				$route
1241
			);
1242
			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1243
			return false;
1244
		}
@@ 1303-1307 (lines=5) @@
1300
			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1301
			return false;
1302
		}
1303
		if ( empty( $forward ) ) {
1304
			$msg = sprintf( __( 'No forwarding route has been supplied.', 'event_espresso' ), $route );
1305
			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1306
			return false;
1307
		}
1308
		if ( is_array( $forward ) ) {
1309
			if ( ! isset( $forward[1] ) ) {
1310
				$msg = sprintf(
@@ 1309-1313 (lines=5) @@
1306
			return false;
1307
		}
1308
		if ( is_array( $forward ) ) {
1309
			if ( ! isset( $forward[1] ) ) {
1310
				$msg = sprintf(
1311
					__( 'A class method for the %s forwarding route has not been supplied.', 'event_espresso' ),
1312
					$route
1313
				);
1314
				EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1315
				return false;
1316
			}

modules/ticket_selector/DisplayTicketSelector.php 1 location

@@ 77-82 (lines=6) @@
74
                $event->EE_Event = \EEM_Event::instance()->instantiate_class_from_post_object( $event );
75
                $this->event = $event->EE_Event;
76
            }
77
        } else {
78
            $user_msg = __( 'No Event object or an invalid Event object was supplied.', 'event_espresso' );
79
            $dev_msg = $user_msg . __(
80
                    '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.',
81
                    'event_espresso'
82
                );
83
            \EE_Error::add_error( $user_msg . '||' . $dev_msg, __FILE__, __FUNCTION__, __LINE__ );
84
            return false;
85
        }