Code Duplication    Length = 6-6 lines in 2 locations

includes/class-wc-checkout.php 2 locations

@@ 493-498 (lines=6) @@
490
											$this->posted[ $key ] = wc_format_postcode( $this->posted[ $key ], $_POST[ $fieldset_key . '_country' ] );
491
										endif;
492
									break;
493
									case 'phone' :
494
										$this->posted[ $key ] = wc_format_phone_number( $this->posted[ $key ] );
495
496
										if ( ! WC_Validation::is_phone( $this->posted[ $key ] ) )
497
											wc_add_notice( '<strong>' . $field['label'] . '</strong> ' . __( 'is not a valid phone number.', 'woocommerce' ), 'error' );
498
									break;
499
									case 'email' :
500
										$this->posted[ $key ] = strtolower( $this->posted[ $key ] );
501
@@ 499-504 (lines=6) @@
496
										if ( ! WC_Validation::is_phone( $this->posted[ $key ] ) )
497
											wc_add_notice( '<strong>' . $field['label'] . '</strong> ' . __( 'is not a valid phone number.', 'woocommerce' ), 'error' );
498
									break;
499
									case 'email' :
500
										$this->posted[ $key ] = strtolower( $this->posted[ $key ] );
501
502
										if ( ! is_email( $this->posted[ $key ] ) )
503
											wc_add_notice( '<strong>' . $field['label'] . '</strong> ' . __( 'is not a valid email address.', 'woocommerce' ), 'error' );
504
									break;
505
									case 'state' :
506
										// Get valid states
507
										$valid_states = WC()->countries->get_states( isset( $_POST[ $fieldset_key . '_country' ] ) ? $_POST[ $fieldset_key . '_country' ] : ( 'billing' === $fieldset_key ? WC()->customer->get_billing_country() : WC()->customer->get_shipping_country() ) );