name); $eInvoiceAddress = $data->eInvoiceAddress === null ? null : new EInvoiceAddress($data->eInvoiceAddress); $this->transactions->run(function () use ($customerId, $billingUnitId, $name, $eInvoiceAddress, $data): void { $billingUnit = $this->billingUnits->findForCustomer($customerId, $billingUnitId) ?? throw new BillingUnitNotFound($customerId, $billingUnitId); $billingUnit->changeDetails($name, $data->billingAddress, $eInvoiceAddress, $data->eInvoiceOperator, $data->reference); $this->billingUnits->save($billingUnit); }); } }