Code Duplication    Length = 6-6 lines in 3 locations

caffeinated/admin/extend/registrations/Extend_Registrations_Admin_Page.core.php 3 locations

@@ 262-267 (lines=6) @@
259
260
		$this->_verify_nonce( $nonce, $nonce_ref );
261
		//let's get the mtp for the incoming MTP_ ID
262
		if ( !isset( $this->_req_data['GRP_ID'] ) ) {
263
			EE_Error::add_error( __('There must be something broken with the js or html structure because the required data for getting a message template group is not present (need an GRP_ID).', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
264
			$this->_template_args['success'] = FALSE;
265
			$this->_template_args['error'] = TRUE;
266
			$this->_return_json();
267
		}
268
		$MTPG = EEM_Message_Template_Group::instance()->get_one_by_ID( $this->_req_data['GRP_ID'] );
269
		if ( ! $MTPG instanceof EE_Message_Template_Group ) {
270
			EE_Error::add_error( sprintf( __('The GRP_ID given (%d) does not appear to have a corresponding row in the database.', 'event_espresso'), $this->_req_data['GRP_ID'] ), __FILE__, __FUNCTION__, __LINE__  );
@@ 269-274 (lines=6) @@
266
			$this->_return_json();
267
		}
268
		$MTPG = EEM_Message_Template_Group::instance()->get_one_by_ID( $this->_req_data['GRP_ID'] );
269
		if ( ! $MTPG instanceof EE_Message_Template_Group ) {
270
			EE_Error::add_error( sprintf( __('The GRP_ID given (%d) does not appear to have a corresponding row in the database.', 'event_espresso'), $this->_req_data['GRP_ID'] ), __FILE__, __FUNCTION__, __LINE__  );
271
			$this->_template_args['success'] = FALSE;
272
			$this->_template_args['error'] = TRUE;
273
			$this->_return_json();
274
		}
275
276
		$MTPs = $MTPG->context_templates();
277
		$MTPs = $MTPs['attendee'];
@@ 604-609 (lines=6) @@
601
	 */
602
	public function toggle_checkin_status() {
603
		//first make sure we have the necessary data
604
		if ( !isset( $this->_req_data['_regid'] ) ) {
605
			EE_Error::add_error( __('There must be something broken with the html structure because the required data for toggling the Check-in status is not being sent via ajax', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
606
			$this->_template_args['success'] = FALSE;
607
			$this->_template_args['error'] = TRUE;
608
			$this->_return_json();
609
		};
610
611
		//do a nonce check cause we're not coming in from an normal route here.
612
		$nonce = isset( $this->_req_data['checkinnonce'] ) ? sanitize_text_field( $this->_req_data['checkinnonce'] ) : '';