Code Duplication    Length = 5-9 lines in 8 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

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

core/services/shortcodes/LegacyShortcodesManager.php 1 location

@@ 159-166 (lines=8) @@
156
        // load the shortcode class file
157
        require_once($shortcode_path . $shortcode_class . $shortcode_ext);
158
        // verify that class exists
159
        if ( ! class_exists($shortcode_class)) {
160
            $msg = sprintf(
161
                esc_html__('The requested %s shortcode class does not exist.', 'event_espresso'),
162
                $shortcode_class
163
            );
164
            EE_Error::add_error($msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__);
165
            return false;
166
        }
167
        $shortcode = strtoupper($shortcode);
168
        // add to array of registered shortcodes
169
        $this->registry->shortcodes->{$shortcode} = $shortcode_path . $shortcode_class . $shortcode_ext;

modules/ticket_selector/DisplayTicketSelector.php 1 location

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