Code Duplication    Length = 4-4 lines in 2 locations

includes/class-wpinv-invoice.php 2 locations

@@ 551-554 (lines=4) @@
548
            $invoice_number = $number;
549
        }
550
551
        if ( empty( $this->key ) ) {
552
            $this->key = self::generate_key();
553
            $this->pending['key'] = $this->key;
554
        }
555
556
        if ( empty( $this->ip ) ) {
557
            $this->ip = wpinv_get_ip();
@@ 639-642 (lines=4) @@
636
            return $saved; // Don't save empty invoice.
637
        }
638
        
639
        if ( empty( $this->key ) ) {
640
            $this->key = self::generate_key();
641
            $this->pending['key'] = $this->key;
642
        }
643
        
644
        if ( empty( $this->ID ) ) {
645
            $invoice_id = $this->insert_invoice();