Code Duplication    Length = 10-11 lines in 2 locations

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

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

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

@@ 125-135 (lines=11) @@
122
     * This is an array of tax ID keys with total amount values.
123
     * @param array $raw_tax_data
124
     */
125
    public function set_taxes( $raw_tax_data ) {
126
        $raw_tax_data = maybe_unserialize( $raw_tax_data );
127
        $tax_data     = array(
128
            'total'    => array()
129
        );
130
        if ( ! empty( $raw_tax_data['total'] ) ) {
131
            $tax_data['total']    = array_map( 'wc_format_decimal', $raw_tax_data['total'] );
132
        }
133
        $this->data['taxes'] = $tax_data;
134
        $this->set_total_tax( array_sum( $tax_data['total'] ) );
135
    }
136
137
    /*
138
	|--------------------------------------------------------------------------