Code Duplication    Length = 3-5 lines in 2 locations

includes/abstracts/abstract-wc-legacy-order.php 1 location

@@ 225-227 (lines=3) @@
222
	public function set_address( $address, $type = 'billing' ) {
223
		foreach ( $address as $key => $value ) {
224
			update_post_meta( $this->get_id(), "_{$type}_" . $key, $value );
225
			if ( is_callable( array( $this, "set_{$type}_{$key}" ) ) ) {
226
				$this->{"set_{$type}_{$key}"}( $value );
227
			}
228
		}
229
	}
230

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

@@ 74-78 (lines=5) @@
71
	 */
72
	public function set_all( $data ) {
73
		foreach ( $data as $key => $value ) {
74
			if ( is_callable( array( $this, "set_$key" ) ) ) {
75
				$this->{"set_$key"}( $value );
76
			} else {
77
				$this->_data[ $key ] = $value;
78
			}
79
		}
80
	}
81