Code Duplication    Length = 11-13 lines in 2 locations

modules/single_page_checkout/inc/EE_Checkout.class.php 2 locations

@@ 1133-1145 (lines=13) @@
1130
	protected function _refresh_registration( $reg_cache_ID, $registration ) {
1131
1132
		// verify object
1133
		if ( $registration instanceof EE_Registration ) {
1134
			// update the entity mapper attendee
1135
			$this->_refresh_registration_attendee( $registration );
1136
			// update the entity mapper answers for reg form questions
1137
			$this->_refresh_registration_answers( $registration );
1138
			// make sure the cached registration is added to the model entity mapper
1139
			$registration->get_model()->refresh_entity_map_with( $reg_cache_ID, $registration );
1140
		} else {
1141
			EE_Error::add_error(
1142
				__( 'An invalid Registration object was discovered when attempting to update the model entity mapper.', 'event_espresso' ),
1143
				__FILE__, __FUNCTION__, __LINE__
1144
			);
1145
		}
1146
	}
1147
1148
@@ 1185-1195 (lines=11) @@
1182
		// now update the answers
1183
		foreach ( $registration->answers() as $cache_key => $answer ) {
1184
			// verify object
1185
			if ( $answer instanceof EE_Answer ) {
1186
				if ( $answer->ID() ) {
1187
					// make sure the cached answer is added to the model entity mapper
1188
					$answer->get_model()->refresh_entity_map_with( $answer->ID(), $answer );
1189
				}
1190
			} else {
1191
				EE_Error::add_error(
1192
					__( 'An invalid Answer object was discovered when attempting to update the model entity mapper.', 'event_espresso' ),
1193
					__FILE__, __FUNCTION__, __LINE__
1194
				);
1195
			}
1196
		}
1197
	}
1198