Code Duplication    Length = 4-9 lines in 4 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/db_classes/EE_Base_Class.class.php 1 location

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

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