Code Duplication    Length = 9-9 lines in 2 locations

includes/wpinv-invoice-functions.php 2 locations

@@ 343-351 (lines=9) @@
340
    $items              = $invoice->get_items();
341
    $invoice_currency   = $invoice->get_currency();
342
343
    if ( !empty( $items ) && is_array( $items ) ) {
344
        foreach ( $items as $key => $item ) {
345
            $items[$key]['currency'] = $invoice_currency;
346
347
            if ( !isset( $cart_item['subtotal'] ) ) {
348
                $items[$key]['subtotal'] = $items[$key]['amount'] * 1;
349
            }
350
        }
351
    }
352
353
    return apply_filters( 'wpinv_get_items', $items, $invoice_id );
354
}
@@ 784-792 (lines=9) @@
781
782
    $invoice_currency = $invoice->currency;
783
784
    if ( ! empty( $cart_details ) && is_array( $cart_details ) ) {
785
        foreach ( $cart_details as $key => $cart_item ) {
786
            $cart_details[ $key ]['currency'] = $invoice_currency;
787
788
            if ( ! isset( $cart_item['subtotal'] ) ) {
789
                $cart_details[ $key ]['subtotal'] = $cart_item['price'];
790
            }
791
        }
792
    }
793
794
    return apply_filters( 'wpinv_get_cart_details', $cart_details, $invoice_id );
795
}