Code Duplication    Length = 10-11 lines in 2 locations

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

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

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
	|--------------------------------------------------------------------------