Code Duplication    Length = 4-4 lines in 2 locations

includes/class-wpinv-invoice.php 2 locations

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