Code Duplication    Length = 3-7 lines in 2 locations

admin_pages/transactions/Transactions_Admin_Page.core.php 1 location

@@ 1167-1173 (lines=7) @@
1164
				if ( ! $payment_form->is_valid() ) {
1165
					$submission_error_messages = array();
1166
					foreach ( $payment_form->get_validation_errors_accumulated() as $validation_error ) {
1167
						if ( $validation_error instanceof EE_Validation_Error ) {
1168
							$submission_error_messages[] = sprintf(
1169
								_x( '%s : %s', 'Form Section Name : Form Validation Error', 'event_espresso' ),
1170
								$validation_error->get_form_section()->html_label_text(),
1171
								$validation_error->getMessage()
1172
							);
1173
						}
1174
					}
1175
					EE_Error::add_error( join( '<br />', $submission_error_messages ), __FILE__, __FUNCTION__, __LINE__ );
1176
					return array();

modules/single_page_checkout/EED_Single_Page_Checkout.module.php 1 location

@@ 1015-1017 (lines=3) @@
1012
							$submission_error_messages = array();
1013
							// bad, bad, bad registrant
1014
							foreach( $this->checkout->current_step->reg_form->get_validation_errors_accumulated() as $validation_error ){
1015
								if ( $validation_error instanceof EE_Validation_Error ) {
1016
									$submission_error_messages[] = sprintf(
1017
										__( '%s : %s', 'event_espresso' ),
1018
										$validation_error->get_form_section()->html_label_text(),
1019
										$validation_error->getMessage()
1020
									);