Code Duplication    Length = 5-9 lines in 12 locations

core/EE_Config.core.php 7 locations

@@ 1258-1262 (lines=5) @@
1255
            EE_Error::add_error($msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__);
1256
            return false;
1257
        }
1258
        if (empty($route)) {
1259
            $msg = sprintf(__('No route has been supplied.', 'event_espresso'), $route);
1260
            EE_Error::add_error($msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__);
1261
            return false;
1262
        }
1263
        if (! method_exists('EED_' . $module, $method_name)) {
1264
            $msg = sprintf(
1265
                __('A valid class method for the %s route has not been supplied.', 'event_espresso'),
@@ 1263-1267 (lines=5) @@
1260
            EE_Error::add_error($msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__);
1261
            return false;
1262
        }
1263
        if (! method_exists('EED_' . $module, $method_name)) {
1264
            $msg = sprintf(
1265
                __('A valid class method for the %s route has not been supplied.', 'event_espresso'),
1266
                $route
1267
            );
1268
            EE_Error::add_error($msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__);
1269
            return false;
1270
        }
@@ 1181-1185 (lines=5) @@
1178
            $module_class = 'EED_' . $module;
1179
        }
1180
        // does the module exist ?
1181
        if (! is_readable($module_path . DS . $module_class . $module_ext)) {
1182
            $msg = sprintf(
1183
                __(
1184
                    'The requested %s module file could not be found or is not readable due to file permissions.',
1185
                    'event_espresso'
1186
                ),
1187
                $module
1188
            );
@@ 1195-1199 (lines=5) @@
1192
        // load the module class file
1193
        require_once($module_path . $module_class . $module_ext);
1194
        // verify that class exists
1195
        if (! class_exists($module_class)) {
1196
            $msg = sprintf(__('The requested %s module class does not exist.', 'event_espresso'), $module_class);
1197
            EE_Error::add_error($msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__);
1198
            return false;
1199
        }
1200
        // add to array of registered modules
1201
        EE_Registry::instance()->modules->{$module_class} = $module_path . $module_class . $module_ext;
1202
        do_action(
@@ 1329-1333 (lines=5) @@
1326
            EE_Error::add_error($msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__);
1327
            return false;
1328
        }
1329
        if (empty($forward)) {
1330
            $msg = sprintf(__('No forwarding route has been supplied.', 'event_espresso'), $route);
1331
            EE_Error::add_error($msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__);
1332
            return false;
1333
        }
1334
        if (is_array($forward)) {
1335
            if (! isset($forward[1])) {
1336
                $msg = sprintf(
@@ 1335-1339 (lines=5) @@
1332
            return false;
1333
        }
1334
        if (is_array($forward)) {
1335
            if (! isset($forward[1])) {
1336
                $msg = sprintf(
1337
                    __('A class method for the %s forwarding route has not been supplied.', 'event_espresso'),
1338
                    $route
1339
                );
1340
                EE_Error::add_error($msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__);
1341
                return false;
1342
            }
@@ 1352-1360 (lines=9) @@
1349
                EE_Error::add_error($msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__);
1350
                return false;
1351
            }
1352
        } elseif (! function_exists($forward)) {
1353
            $msg = sprintf(
1354
                __('The function %s for the %s forwarding route is in invalid.', 'event_espresso'),
1355
                $forward,
1356
                $route
1357
            );
1358
            EE_Error::add_error($msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__);
1359
            return false;
1360
        }
1361
        EE_Config::$_module_forward_map[ $key ][ $route ][ absint($status) ] = $forward;
1362
        return true;
1363
    }

core/services/shortcodes/LegacyShortcodesManager.php 1 location

@@ 149-156 (lines=8) @@
146
        // load the shortcode class file
147
        require_once($shortcode_path . $shortcode_class . $shortcode_ext);
148
        // verify that class exists
149
        if (! class_exists($shortcode_class)) {
150
            $msg = sprintf(
151
                esc_html__('The requested %s shortcode class does not exist.', 'event_espresso'),
152
                $shortcode_class
153
            );
154
            EE_Error::add_error($msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__);
155
            return false;
156
        }
157
        $shortcode = strtoupper($shortcode);
158
        // add to array of registered shortcodes
159
        $this->registry->shortcodes->{$shortcode} = $shortcode_path . $shortcode_class . $shortcode_ext;

modules/ticket_selector/DisplayTicketSelector.php 1 location

@@ 136-141 (lines=6) @@
133
                $event->EE_Event = EEM_Event::instance()->instantiate_class_from_post_object($event);
134
                $this->event = $event->EE_Event;
135
            }
136
        } else {
137
            $user_msg = __('No Event object or an invalid Event object was supplied.', 'event_espresso');
138
            $dev_msg = $user_msg . __(
139
                '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.',
140
                'event_espresso'
141
            );
142
            EE_Error::add_error($user_msg . '||' . $dev_msg, __FILE__, __FUNCTION__, __LINE__);
143
            return false;
144
        }

core/EE_Module_Request_Router.core.php 1 location

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

core/helpers/EEH_Address.helper.php 1 location

@@ 33-38 (lines=6) @@
30
        $add_wrapper = true
31
    ) {
32
        // check that incoming object implements the EEI_Address interface
33
        if (! $obj_with_address instanceof EEI_Address) {
34
            $msg = __('The address could not be formatted.', 'event_espresso');
35
            $dev_msg = __(
36
                'The Address Formatter requires passed objects to implement the EEI_Address interface.',
37
                'event_espresso'
38
            );
39
            EE_Error::add_error($msg . '||' . $dev_msg, __FILE__, __FUNCTION__, __LINE__);
40
            return null;
41
        }

core/libraries/payment_methods/EE_Payment_Method_Manager.lib.php 1 location

@@ 178-185 (lines=8) @@
175
        // load the module class file
176
        require_once($payment_method_path . DS . $module_class . $module_ext);
177
        // verify that class exists
178
        if (! class_exists($module_class)) {
179
            $msg = sprintf(
180
                esc_html__('The requested %s module class does not exist.', 'event_espresso'),
181
                $module_class
182
            );
183
            EE_Error::add_error($msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__);
184
            return false;
185
        }
186
        // add to array of registered modules
187
        $this->_payment_method_types[ $module ] = $payment_method_path . DS . $module_class . $module_ext;
188
        ksort($this->_payment_method_types);