transactions->run(function () use ($customerId, $contactId): void { $contact = $this->contacts->findForCustomer($customerId, $contactId) ?? throw new ContactNotFound($customerId, $contactId); if ($this->usage->isContactInUse($contactId)) { throw new ContactInUse; } $this->contacts->delete($contact); }); } }