Code Duplication    Length = 4-4 lines in 2 locations

includes/class-wpinv-invoice.php 2 locations

@@ 547-550 (lines=4) @@
544
            $invoice_number = $number;
545
        }
546
547
        if ( empty( $this->key ) ) {
548
            $this->key = self::generate_key();
549
            $this->pending['key'] = $this->key;
550
        }
551
552
        if ( empty( $this->ip ) ) {
553
            $this->ip = wpinv_get_ip();
@@ 635-638 (lines=4) @@
632
            return $saved; // Don't save empty invoice.
633
        }
634
        
635
        if ( empty( $this->key ) ) {
636
            $this->key = self::generate_key();
637
            $this->pending['key'] = $this->key;
638
        }
639
        
640
        if ( empty( $this->ID ) ) {
641
            $invoice_id = $this->insert_invoice();