Code Duplication    Length = 4-4 lines in 2 locations

includes/cli/class-wc-cli-order.php 1 location

@@ 697-700 (lines=4) @@
694
			$product_sku = null;
695
696
			// Check if the product exists.
697
			if ( is_object( $product ) ) {
698
				$product_id  = ( isset( $product->variation_id ) ) ? $product->variation_id : $product->id;
699
				$product_sku = $product->get_sku();
700
			}
701
702
			$meta = new WC_Order_Item_Meta( $item, $product );
703
			$item_meta = array();

includes/api/class-wc-api-orders.php 1 location

@@ 228-231 (lines=4) @@
225
			$product_sku = null;
226
227
			// Check if the product exists.
228
			if ( is_object( $product ) ) {
229
				$product_id  = ( isset( $product->variation_id ) ) ? $product->variation_id : $product->id;
230
				$product_sku = $product->get_sku();
231
			}
232
233
			$meta = new WC_Order_Item_Meta( $item, $product );
234