Code Duplication    Length = 5-11 lines in 13 locations

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 2 locations

@@ 178-185 (lines=8) @@
175
        // load the module class file
176
        require_once($payment_method_path . '/' . $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 . '/' . $module_class . $module_ext;
188
        ksort($this->_payment_method_types);
@@ 164-174 (lines=11) @@
161
        // add class prefix
162
        $module_class = 'EE_PMT_' . $module;
163
        // does the module exist ?
164
        if (! is_readable($payment_method_path . '/' . $module_class . $module_ext)) {
165
            $msg = sprintf(
166
                esc_html__(
167
                    'The requested %s payment method file could not be found or is not readable due to file permissions.',
168
                    'event_espresso'
169
                ),
170
                $module
171
            );
172
            EE_Error::add_error($msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__);
173
            return false;
174
        }
175
        // load the module class file
176
        require_once($payment_method_path . '/' . $module_class . $module_ext);
177
        // verify that class exists

core/EE_Config.core.php 7 locations

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