Code Duplication    Length = 5-6 lines in 2 locations

src/Intraface/modules/debtor/Debtor.php 1 location

@@ 411-415 (lines=5) @@
408
409
        // kunde
410
        $contact = new Contact($this->kernel, $input["contact_id"]);
411
        if (is_object($contact->address)) {
412
            $contact_address_id = $contact->address->get("address_id");
413
        } else {
414
            $this->error->set("Ugyldig kunde");
415
        }
416
417
        if ($contact->get("type") == "corporation") {
418
            $validator->isNumeric($input["contact_person_id"], "Der er ikke angivet en kontaktperson");

src/Intraface/modules/invoice/Reminder.php 1 location

@@ 172-177 (lines=6) @@
169
        }
170
        if ($validator->isNumeric($input["contact_id"], "Du skal angive en kunde", "greater_than_zero")) {
171
            $contact = new Contact($this->kernel, (int)$input["contact_id"]);
172
            if (is_object($contact->address)) {
173
                $contact_id = $contact->get("id");
174
                $contact_address_id = $contact->address->get("address_id");
175
            } else {
176
                $this->error->set("Ugyldig kunde");
177
            }
178
179
            if ($contact->get("type") == "corporation") {
180
                $validator->isNumeric($input["contact_person_id"], "Der er ikke angivet en kontaktperson");