Code Duplication    Length = 3-3 lines in 6 locations

includes/api/class-wc-rest-products-controller.php 3 locations

@@ 771-773 (lines=3) @@
768
			}
769
770
			// Height.
771
			if ( isset( $data['dimensions']['height'] ) ) {
772
				update_post_meta( $product->id, '_height', '' === $data['dimensions']['height'] ? '' : wc_format_decimal( $data['dimensions']['height'] ) );
773
			}
774
775
			// Width.
776
			if ( isset( $data['dimensions']['width'] ) ) {
@@ 776-778 (lines=3) @@
773
			}
774
775
			// Width.
776
			if ( isset( $data['dimensions']['width'] ) ) {
777
				update_post_meta( $product->id, '_width', '' === $data['dimensions']['width'] ? '' : wc_format_decimal( $data['dimensions']['width'] ) );
778
			}
779
780
			// Length.
781
			if ( isset( $data['dimensions']['length'] ) ) {
@@ 781-783 (lines=3) @@
778
			}
779
780
			// Length.
781
			if ( isset( $data['dimensions']['length'] ) ) {
782
				update_post_meta( $product->id, '_length', '' === $data['dimensions']['length'] ? '' : wc_format_decimal( $data['dimensions']['length'] ) );
783
			}
784
		}
785
786
		// Shipping class.

includes/cli/class-wc-cli-product.php 3 locations

@@ 1898-1900 (lines=3) @@
1895
		// Product dimensions
1896
		if ( isset( $data['dimensions'] ) ) {
1897
			// Height
1898
			if ( isset( $data['dimensions']['height'] ) ) {
1899
				update_post_meta( $id, '_height', ( '' === $data['dimensions']['height'] ) ? '' : wc_format_decimal( $data['dimensions']['height'] ) );
1900
			}
1901
1902
			// Width
1903
			if ( isset( $data['dimensions']['width'] ) ) {
@@ 1903-1905 (lines=3) @@
1900
			}
1901
1902
			// Width
1903
			if ( isset( $data['dimensions']['width'] ) ) {
1904
				update_post_meta( $id, '_width', ( '' === $data['dimensions']['width'] ) ? '' : wc_format_decimal($data['dimensions']['width'] ) );
1905
			}
1906
1907
			// Length
1908
			if ( isset( $data['dimensions']['length'] ) ) {
@@ 1908-1910 (lines=3) @@
1905
			}
1906
1907
			// Length
1908
			if ( isset( $data['dimensions']['length'] ) ) {
1909
				update_post_meta( $id, '_length', ( '' === $data['dimensions']['length'] ) ? '' : wc_format_decimal( $data['dimensions']['length'] ) );
1910
			}
1911
		}
1912
1913
		// Virtual