Code Duplication    Length = 7-7 lines in 2 locations

includes/class-wpinv-ajax.php 1 location

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