Code Duplication    Length = 6-6 lines in 2 locations

includes/class-wc-checkout.php 2 locations

@@ 500-505 (lines=6) @@
497
											$this->posted[ $key ] = wc_format_postcode( $this->posted[ $key ], $_POST[ $fieldset_key . '_country' ] );
498
										endif;
499
									break;
500
									case 'phone' :
501
										$this->posted[ $key ] = wc_format_phone_number( $this->posted[ $key ] );
502
503
										if ( ! WC_Validation::is_phone( $this->posted[ $key ] ) )
504
											wc_add_notice( '<strong>' . $field['label'] . '</strong> ' . __( 'is not a valid phone number.', 'woocommerce' ), 'error' );
505
									break;
506
									case 'email' :
507
										$this->posted[ $key ] = strtolower( $this->posted[ $key ] );
508
@@ 506-511 (lines=6) @@
503
										if ( ! WC_Validation::is_phone( $this->posted[ $key ] ) )
504
											wc_add_notice( '<strong>' . $field['label'] . '</strong> ' . __( 'is not a valid phone number.', 'woocommerce' ), 'error' );
505
									break;
506
									case 'email' :
507
										$this->posted[ $key ] = strtolower( $this->posted[ $key ] );
508
509
										if ( ! is_email( $this->posted[ $key ] ) )
510
											wc_add_notice( '<strong>' . $field['label'] . '</strong> ' . __( 'is not a valid email address.', 'woocommerce' ), 'error' );
511
									break;
512
									case 'state' :
513
										// Get valid states
514
										$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() ) );