Code Duplication    Length = 4-4 lines in 2 locations

includes/class-wpinv-invoice.php 2 locations

@@ 543-546 (lines=4) @@
540
            $invoice_title = wpinv_format_invoice_number( 0 );
541
        }
542
543
        if ( empty( $this->key ) ) {
544
            $this->key = self::generate_key();
545
            $this->pending['key'] = $this->key;
546
        }
547
548
        if ( empty( $this->ip ) ) {
549
            $this->ip = wpinv_get_ip();
@@ 640-643 (lines=4) @@
637
            return $saved; // Don't save empty invoice.
638
        }
639
        
640
        if ( empty( $this->key ) ) {
641
            $this->key = self::generate_key();
642
            $this->pending['key'] = $this->key;
643
        }
644
        
645
        if ( empty( $this->ID ) ) {
646
            $invoice_id = $this->insert_invoice();