Code Duplication    Length = 6-6 lines in 3 locations

includes/class-wpinv-invoice.php 2 locations

@@ 2023-2028 (lines=6) @@
2020
        }
2021
        
2022
        $has_subscription = false;
2023
        foreach( $this->cart_details as $cart_item ) {
2024
            if ( !empty( $cart_item['id'] ) && wpinv_is_recurring_item( $cart_item['id'] )  ) {
2025
                $has_subscription = true;
2026
                break;
2027
            }
2028
        }
2029
        
2030
        if ( count( $this->cart_details ) > 1 ) {
2031
            $has_subscription = false;
@@ 2056-2061 (lines=6) @@
2053
            return $item;
2054
        }
2055
        
2056
        foreach( $this->cart_details as $cart_item ) {
2057
            if ( !empty( $cart_item['id'] ) && wpinv_is_recurring_item( $cart_item['id'] )  ) {
2058
                $item = $cart_item['id'];
2059
                break;
2060
            }
2061
        }
2062
        
2063
        if ( $object ) {
2064
            $item = $item ? new WPInv_Item( $item ) : NULL;

includes/wpinv-invoice-functions.php 1 location

@@ 881-886 (lines=6) @@
878
    }
879
    
880
    $has_subscription = false;
881
    foreach( $cart_items as $cart_item ) {
882
        if ( !empty( $cart_item['id'] ) && wpinv_is_recurring_item( $cart_item['id'] )  ) {
883
            $has_subscription = true;
884
            break;
885
        }
886
    }
887
    
888
    return apply_filters( 'wpinv_cart_has_recurring_item', $has_subscription, $cart_items );
889
}