Code Duplication    Length = 6-6 lines in 3 locations

includes/wpinv-invoice-functions.php 1 location

@@ 660-665 (lines=6) @@
657
    }
658
    
659
    $has_subscription = false;
660
    foreach( $cart_items as $cart_item ) {
661
        if ( !empty( $cart_item['id'] ) && wpinv_is_recurring_item( $cart_item['id'] )  ) {
662
            $has_subscription = true;
663
            break;
664
        }
665
    }
666
    
667
    return apply_filters( 'wpinv_cart_has_recurring_item', $has_subscription, $cart_items );
668
}

includes/class-wpinv-invoice.php 2 locations

@@ 2035-2040 (lines=6) @@
2032
        }
2033
        
2034
        $has_subscription = false;
2035
        foreach( $this->cart_details as $cart_item ) {
2036
            if ( !empty( $cart_item['id'] ) && wpinv_is_recurring_item( $cart_item['id'] )  ) {
2037
                $has_subscription = true;
2038
                break;
2039
            }
2040
        }
2041
        
2042
        if ( count( $this->cart_details ) > 1 ) {
2043
            $has_subscription = false;
@@ 2068-2073 (lines=6) @@
2065
            return $item;
2066
        }
2067
        
2068
        foreach( $this->cart_details as $cart_item ) {
2069
            if ( !empty( $cart_item['id'] ) && wpinv_is_recurring_item( $cart_item['id'] )  ) {
2070
                $item = $cart_item['id'];
2071
                break;
2072
            }
2073
        }
2074
        
2075
        if ( $object ) {
2076
            $item = $item ? new WPInv_Item( $item ) : NULL;