Code Duplication    Length = 10-11 lines in 2 locations

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

@@ 160-170 (lines=11) @@
157
	 * This is an array of tax ID keys with total amount values.
158
	 * @param array $raw_tax_data
159
	 */
160
	public function set_taxes( $raw_tax_data ) {
161
		$raw_tax_data = maybe_unserialize( $raw_tax_data );
162
		$tax_data     = array(
163
			'total'    => array()
164
		);
165
		if ( ! empty( $raw_tax_data['total'] ) ) {
166
			$tax_data['total']    = array_map( 'wc_format_decimal', $raw_tax_data['total'] );
167
		}
168
		$this->_data['taxes'] = $tax_data;
169
		$this->set_total_tax( array_sum( $tax_data['total'] ) );
170
	}
171
172
	/*
173
	|--------------------------------------------------------------------------

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

@@ 170-179 (lines=10) @@
167
	 * This is an array of tax ID keys with total amount values.
168
	 * @param array $raw_tax_data
169
	 */
170
	public function set_taxes( $raw_tax_data ) {
171
		$raw_tax_data = maybe_unserialize( $raw_tax_data );
172
		$tax_data     = array(
173
			'total' => array(),
174
		);
175
		if ( ! empty( $raw_tax_data['total'] ) ) {
176
			$tax_data['total'] = array_map( 'wc_format_decimal', $raw_tax_data['total'] );
177
		}
178
		$this->_data['taxes'] = $tax_data;
179
	}
180
181
	/*
182
	|--------------------------------------------------------------------------