Code Duplication    Length = 6-6 lines in 3 locations

includes/wpinv-invoice-functions.php 1 location

@@ 436-441 (lines=6) @@
433
    }
434
    
435
    $has_subscription = false;
436
    foreach( $cart_items as $cart_item ) {
437
        if ( !empty( $cart_item['id'] ) && wpinv_is_recurring_item( $cart_item['id'] )  ) {
438
            $has_subscription = true;
439
            break;
440
        }
441
    }
442
    
443
    return apply_filters( 'wpinv_cart_has_recurring_item', $has_subscription, $cart_items );
444
}

includes/class-wpinv-invoice.php 2 locations

@@ 2028-2033 (lines=6) @@
2025
        }
2026
        
2027
        $has_subscription = false;
2028
        foreach( $this->cart_details as $cart_item ) {
2029
            if ( !empty( $cart_item['id'] ) && wpinv_is_recurring_item( $cart_item['id'] )  ) {
2030
                $has_subscription = true;
2031
                break;
2032
            }
2033
        }
2034
        
2035
        if ( count( $this->cart_details ) > 1 ) {
2036
            $has_subscription = false;
@@ 2061-2066 (lines=6) @@
2058
            return $item;
2059
        }
2060
        
2061
        foreach( $this->cart_details as $cart_item ) {
2062
            if ( !empty( $cart_item['id'] ) && wpinv_is_recurring_item( $cart_item['id'] )  ) {
2063
                $item = $cart_item['id'];
2064
                break;
2065
            }
2066
        }
2067
        
2068
        if ( $object ) {
2069
            $item = $item ? new WPInv_Item( $item ) : NULL;