Code Duplication    Length = 4-4 lines in 2 locations

includes/class-wpinv-invoice.php 2 locations

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