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

@@ 374-380 (lines=7) @@
371
                }
372
373
                $valid_item = true;
374
                if ( !empty( $recurring_item ) ) {
375
                    if ( $recurring_item->ID != $item_id ) {
376
                        $valid_item = false;
377
                    }
378
                } else if ( wpinv_is_recurring_item( $item_id ) ) {
379
                    $valid_item = false;
380
                }
381
                
382
                if ( !$valid_item ) {
383
                    if ( $wp_error ) {