Code Duplication    Length = 9-9 lines in 2 locations

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

@@ 854-862 (lines=9) @@
851
	 * @param int $order_id valid order ID
852
	 * @param array $order_meta order meta in array( 'meta_key' => 'meta_value' ) format
853
	 */
854
	protected function set_order_meta( $order_id, $order_meta ) {
855
856
		foreach ( $order_meta as $meta_key => $meta_value ) {
857
858
			if ( is_string( $meta_key) && ! is_protected_meta( $meta_key ) && is_scalar( $meta_value ) ) {
859
				update_post_meta( $order_id, $meta_key, $meta_value );
860
			}
861
		}
862
	}
863
864
	/**
865
	 * Wrapper method to create/update order items

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

@@ 825-833 (lines=9) @@
822
	 * @param int $order_id valid order ID
823
	 * @param array $order_meta order meta in array( 'meta_key' => 'meta_value' ) format
824
	 */
825
	protected function set_order_meta( $order_id, $order_meta ) {
826
827
		foreach ( $order_meta as $meta_key => $meta_value ) {
828
829
			if ( is_string( $meta_key) && ! is_protected_meta( $meta_key ) && is_scalar( $meta_value ) ) {
830
				update_post_meta( $order_id, $meta_key, $meta_value );
831
			}
832
		}
833
	}
834
835
	/**
836
	 * Helper method to check if the resource ID associated with the provided item is null