Code Duplication    Length = 3-7 lines in 2 locations

admin_pages/transactions/Transactions_Admin_Page.core.php 1 location

@@ 1157-1163 (lines=7) @@
1154
				if ( ! $payment_form->is_valid() ) {
1155
					$submission_error_messages = array();
1156
					foreach ( $payment_form->get_validation_errors_accumulated() as $validation_error ) {
1157
						if ( $validation_error instanceof EE_Validation_Error ) {
1158
							$submission_error_messages[] = sprintf(
1159
								_x( '%s : %s', 'Form Section Name : Form Validation Error', 'event_espresso' ),
1160
								$validation_error->get_form_section()->html_label_text(),
1161
								$validation_error->getMessage()
1162
							);
1163
						}
1164
					}
1165
					EE_Error::add_error( join( '<br />', $submission_error_messages ), __FILE__, __FUNCTION__, __LINE__ );
1166
					return array();

modules/single_page_checkout/EED_Single_Page_Checkout.module.php 1 location

@@ 980-982 (lines=3) @@
977
							$submission_error_messages = array();
978
							// bad, bad, bad registrant
979
							foreach( $this->checkout->current_step->reg_form->get_validation_errors_accumulated() as $validation_error ){
980
								if ( $validation_error instanceof EE_Validation_Error ) {
981
									$submission_error_messages[] = sprintf( __( '%s : %s', 'event_espresso' ), $validation_error->get_form_section()->html_label_text(), $validation_error->getMessage() );
982
								}
983
							}
984
							EE_Error::add_error( join( '<br />', $submission_error_messages ), __FILE__, __FUNCTION__, __LINE__ );
985
						}