Code Duplication    Length = 7-7 lines in 2 locations

includes/class-wpinv-ajax.php 1 location

@@ 185-191 (lines=7) @@
182
        if ( !empty( $invoice->cart_details ) ) {
183
            $valid = true;
184
            
185
            if ( $recurring_item = $invoice->get_recurring() ) {
186
                if ( $recurring_item != $item_id ) {
187
                    $valid = false;
188
                }
189
            } else if ( wpinv_is_recurring_item( $item_id ) ) {
190
                $valid = false;
191
            }
192
            
193
            if ( !$valid ) {
194
                $response               = array();

includes/wpinv-invoice-functions.php 1 location

@@ 366-372 (lines=7) @@
363
                }
364
365
                $valid_item = true;
366
                if ( !empty( $recurring_item ) ) {
367
                    if ( $recurring_item->ID != $item_id ) {
368
                        $valid_item = false;
369
                    }
370
                } else if ( wpinv_is_recurring_item( $item_id ) ) {
371
                    $valid_item = false;
372
                }
373
                
374
                if ( !$valid_item ) {
375
                    if ( $wp_error ) {