Code Duplication    Length = 4-12 lines in 3 locations

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

@@ 1019-1022 (lines=4) @@
1016
					// add relation to registration, set attendee ID, and cache attendee
1017
					$this->_associate_attendee_with_registration( $registration, $attendee );
1018
					// \EEH_Debug_Tools::printr( $registration, '$registration', __FILE__, __LINE__ );
1019
					if ( ! $registration->attendee() instanceof EE_Attendee ) {
1020
						EE_Error::add_error( sprintf( __( 'Registration %s has an invalid or missing Attendee object.', 'event_espresso' ), $reg_url_link ), __FILE__, __FUNCTION__, __LINE__ );
1021
						return false;
1022
					}
1023
					/** @type EE_Registration_Processor $registration_processor */
1024
					$registration_processor = EE_Registry::instance()->load_class( 'Registration_Processor' );
1025
					// at this point, we should have enough details about the registrant to consider the registration NOT incomplete

core/business/EE_Transaction_Payments.class.php 1 location

@@ 64-70 (lines=7) @@
61
	 */
62
	public function recalculate_transaction_total( EE_Transaction $transaction, $update_txn = true ) {
63
		$total_line_item = $transaction->total_line_item();
64
		if ( ! $total_line_item instanceof EE_Line_Item ) {
65
			EE_Error::add_error(
66
				sprintf( __( 'The Total Line Item for Transaction %1$d\'s was not found or is invalid.', 'event_espresso' ), $transaction->ID() ),
67
				__FILE__, __FUNCTION__, __LINE__
68
			);
69
			return false;
70
		}
71
		$new_total = $total_line_item->recalculate_total_including_taxes();
72
		$transaction->set_total( $new_total );
73
		if ( $update_txn ) {

modules/single_page_checkout/inc/EE_Checkout.class.php 1 location

@@ 920-931 (lines=12) @@
917
					);
918
				}
919
			}
920
		} else {
921
			if ( $show_errors ) {
922
				EE_Error::add_error(
923
					sprintf(
924
						'%1$s||%1$s $attendee = %2$s',
925
						__( 'Either no Attendee information was found, or an invalid Attendee object was discovered when attempting to save your registration information.', 'event_espresso' ),
926
						var_export( $registration->attendee(), true )
927
					),
928
					__FILE__, __FUNCTION__, __LINE__
929
				);
930
			}
931
		}
932
	}
933
934