Code Duplication    Length = 10-11 lines in 2 locations

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

@@ 142-151 (lines=10) @@
139
	 * This is an array of tax ID keys with total amount values.
140
	 * @param array $raw_tax_data
141
	 */
142
	public function set_taxes( $raw_tax_data ) {
143
		$raw_tax_data = maybe_unserialize( $raw_tax_data );
144
		$tax_data     = array(
145
			'total' => array(),
146
		);
147
		if ( ! empty( $raw_tax_data['total'] ) ) {
148
			$tax_data['total'] = array_map( 'wc_format_decimal', $raw_tax_data['total'] );
149
		}
150
		$this->_data['taxes'] = $tax_data;
151
	}
152
153
	/*
154
	|--------------------------------------------------------------------------

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

@@ 147-157 (lines=11) @@
144
	 * This is an array of tax ID keys with total amount values.
145
	 * @param array $raw_tax_data
146
	 */
147
	public function set_taxes( $raw_tax_data ) {
148
		$raw_tax_data = maybe_unserialize( $raw_tax_data );
149
		$tax_data     = array(
150
			'total'    => array()
151
		);
152
		if ( ! empty( $raw_tax_data['total'] ) ) {
153
			$tax_data['total']    = array_map( 'wc_format_decimal', $raw_tax_data['total'] );
154
		}
155
		$this->_data['taxes'] = $tax_data;
156
		$this->set_total_tax( array_sum( $tax_data['total'] ) );
157
	}
158
159
	/*
160
	|--------------------------------------------------------------------------