Code Duplication    Length = 10-16 lines in 4 locations

admin_pages/messages/Messages_Admin_Page.core.php 1 location

@@ 1883-1898 (lines=16) @@
1880
        $message_template_group = EEM_Message_Template_Group::instance()->get_one_by_ID(
1881
            $this->_req_data['message_template_group_id']
1882
        );
1883
        if (! $message_template_group instanceof EE_Message_Template_Group) {
1884
            EE_Error::add_error(
1885
                sprintf(
1886
                    esc_html__(
1887
                        'Unable to change the active state because the given id "%1$d" does not match a valid "%2$s"',
1888
                        'event_espresso'
1889
                    ),
1890
                    $this->_req_data['message_template_group_id'],
1891
                    'EE_Message_Template_Group'
1892
                ),
1893
                __FILE__,
1894
                __FUNCTION__,
1895
                __LINE__
1896
            );
1897
            $success = false;
1898
        }
1899
        if ($success) {
1900
            $success = $status === 'off'
1901
                ? $message_template_group->deactivate_context($this->_req_data['context'])

core/business/EE_Registration_Processor.class.php 1 location

@@ 721-732 (lines=12) @@
718
        );
719
        // grab the related ticket object for this line_item
720
        $ticket = $line_item->ticket();
721
        if (! $ticket instanceof EE_Ticket) {
722
            EE_Error::add_error(
723
                sprintf(
724
                    esc_html__('Line item %s did not contain a valid ticket', 'event_espresso'),
725
                    $line_item->ID()
726
                ),
727
                __FILE__,
728
                __FUNCTION__,
729
                __LINE__
730
            );
731
            return null;
732
        }
733
        $registration_service = new CreateRegistrationService();
734
        // then generate a new registration from that
735
        return $registration_service->create(

modules/single_page_checkout/reg_steps/attendee_information/EE_SPCO_Reg_Step_Attendee_Information.class.php 1 location

@@ 1054-1068 (lines=15) @@
1051
                    // add relation to registration, set attendee ID, and cache attendee
1052
                    $this->_associate_attendee_with_registration($registration, $attendee);
1053
                    // \EEH_Debug_Tools::printr( $registration, '$registration', __FILE__, __LINE__ );
1054
                    if (! $registration->attendee() instanceof EE_Attendee) {
1055
                        EE_Error::add_error(
1056
                            sprintf(
1057
                                esc_html__(
1058
                                    'Registration %s has an invalid or missing Attendee object.',
1059
                                    'event_espresso'
1060
                                ),
1061
                                $reg_url_link
1062
                            ),
1063
                            __FILE__,
1064
                            __FUNCTION__,
1065
                            __LINE__
1066
                        );
1067
                        return false;
1068
                    }
1069
                    /** @type EE_Registration_Processor $registration_processor */
1070
                    $registration_processor = EE_Registry::instance()->load_class('Registration_Processor');
1071
                    // at this point, we should have enough details about the registrant to consider the registration

admin_pages/transactions/Transactions_Admin_Page.core.php 1 location

@@ 470-479 (lines=10) @@
467
            : null;
468
        $this->_transaction->verify_abandoned_transaction_status();
469
470
        if (! $this->_transaction instanceof EE_Transaction) {
471
            $error_msg = sprintf(
472
                esc_html__(
473
                    'An error occurred and the details for the transaction with the ID # %d could not be retrieved.',
474
                    'event_espresso'
475
                ),
476
                $TXN_ID
477
            );
478
            EE_Error::add_error($error_msg, __FILE__, __FUNCTION__, __LINE__);
479
        }
480
    }
481
482