Code Duplication    Length = 16-16 lines in 2 locations

includes/abstracts/abstract-wc-settings-api.php 2 locations

@@ 735-750 (lines=16) @@
732
	 * @param  mixed $key
733
	 * @return string
734
	 */
735
	public function validate_price_field( $key ) {
736
		$text  = $this->get_option( $key );
737
		$field = $this->get_field_key( $key );
738
739
		if ( isset( $_POST[ $field ] ) ) {
740
741
			if ( $_POST[ $field ] !== '' ) {
742
				$text = wc_format_decimal( trim( stripslashes( $_POST[ $field ] ) ) );
743
			} else {
744
				$text = '';
745
			}
746
		}
747
748
		return $text;
749
	}
750
751
	/**
752
	 * Validate Decimal Field.
753
	 *
@@ 759-774 (lines=16) @@
756
	 * @param  mixed $key
757
	 * @return string
758
	 */
759
	public function validate_decimal_field( $key ) {
760
761
		$text  = $this->get_option( $key );
762
		$field = $this->get_field_key( $key );
763
764
		if ( isset( $_POST[ $field ] ) ) {
765
766
			if ( $_POST[ $field ] !== '' ) {
767
				$text = wc_format_decimal( trim( stripslashes( $_POST[ $field ] ) ) );
768
			} else {
769
				$text = '';
770
			}
771
		}
772
773
		return $text;
774
	}
775
776
	/**
777
	 * Validate Password Field.