Code Duplication    Length = 4-16 lines in 5 locations

core/libraries/messages/EE_Messages_Processor.lib.php 1 location

@@ 552-555 (lines=4) @@
549
550
		foreach( $regIDs as $regID ) {
551
			$reg = EEM_Registration::instance()->get_one_by_ID( $regID );
552
			if ( ! $reg instanceof EE_Registration ) {
553
				EE_Error::add_error( sprintf( __('Unable to retrieve a registration object for the given reg id (%s)', 'event_espresso'), $regID ) );
554
				return false;
555
			}
556
			$regs_to_send[$reg->transaction_ID()][$reg->status_ID()][] = $reg;
557
		}
558

core/EE_Module_Request_Router.core.php 1 location

@@ 204-210 (lines=7) @@
201
        // instantiate module class
202
        $module = new $module_name();
203
        // ensure that class is actually a module
204
        if (! $module instanceof EED_Module) {
205
            EE_Error::add_error(
206
                sprintf(__('The requested %s module is not of the class EED_Module.', 'event_espresso'), $module_name),
207
                __FILE__, __FUNCTION__, __LINE__
208
            );
209
            return null;
210
        }
211
        return $module;
212
    }
213

modules/single_page_checkout/EED_Single_Page_Checkout.module.php 1 location

@@ 1185-1193 (lines=9) @@
1182
        // if returning to SPCO, then verify that primary registrant is set
1183
        if ( ! empty($this->checkout->reg_url_link)) {
1184
            $valid_registrant = $this->checkout->transaction->primary_registration();
1185
            if ( ! $valid_registrant instanceof EE_Registration) {
1186
                EE_Error::add_error(
1187
                    __('We\'re sorry but there appears to be an error with the "reg_url_link" or the primary registrant for this transaction. Please refresh the page and try again or contact support.', 'event_espresso'),
1188
                    __FILE__,
1189
                    __FUNCTION__,
1190
                    __LINE__
1191
                );
1192
                return false;
1193
            }
1194
            $valid_registrant = null;
1195
            foreach (
1196
                $this->checkout->transaction->registrations($this->checkout->reg_cache_where_params) as $registration

core/admin/EE_Admin_Page.core.php 1 location

@@ 1314-1329 (lines=16) @@
1311
                                                             . $tour
1312
                                                             . '.class.php' : $file_path;
1313
                    //if file is STILL not readable then let's do a EE_Error so its more graceful than a fatal error.
1314
                    if (! is_readable($file_path)) {
1315
                        EE_Error::add_error(
1316
                            sprintf(
1317
                                __(
1318
                                    'The file path given for the help tour (%s) is not a valid path.  Please check that the string you set for the help tour on this route (%s) is the correct spelling',
1319
                                    'event_espresso'
1320
                                ),
1321
                                $file_path,
1322
                                $tour
1323
                            ),
1324
                            __FILE__,
1325
                            __FUNCTION__,
1326
                            __LINE__
1327
                        );
1328
                        return;
1329
                    }
1330
                    require_once $file_path;
1331
                    if (! class_exists($tour)) {
1332
                        $error_msg[] = sprintf(

core/db_classes/EE_Base_Class.class.php 1 location

@@ 1103-1106 (lines=4) @@
1100
    public function get_DateTime_object($field_name)
1101
    {
1102
        $field_settings = $this->get_model()->field_settings_for($field_name);
1103
        if ( ! $field_settings instanceof EE_Datetime_Field) {
1104
            EE_Error::add_error(
1105
                sprintf(
1106
                    __(
1107
                        'The field %s is not an EE_Datetime_Field field.  There is no DateTime object stored on this field type.',
1108
                        'event_espresso'
1109
                    ),