Code Duplication    Length = 4-4 lines in 2 locations

includes/class-wpinv-invoice.php 2 locations

@@ 565-568 (lines=4) @@
562
            $invoice_number = $number;
563
        }
564
565
        if ( empty( $this->key ) ) {
566
            $this->key = self::generate_key();
567
            $this->pending['key'] = $this->key;
568
        }
569
570
        if ( empty( $this->ip ) ) {
571
            $this->ip = wpinv_get_ip();
@@ 653-656 (lines=4) @@
650
            return $saved; // Don't save empty invoice.
651
        }
652
        
653
        if ( empty( $this->key ) ) {
654
            $this->key = self::generate_key();
655
            $this->pending['key'] = $this->key;
656
        }
657
        
658
        if ( empty( $this->ID ) ) {
659
            $invoice_id = $this->insert_invoice();