name = $name; $this->billingAddress = OptionalText::from($billingAddress); $this->eInvoiceAddress = $eInvoiceAddress; $this->eInvoiceOperator = $eInvoiceOperator; $this->reference = OptionalText::from($reference); } public function id(): ?int { return $this->id; } public function customerId(): int { return $this->customerId; } public function name(): BillingUnitName { return $this->name; } public function billingAddress(): ?string { return $this->billingAddress; } public function eInvoiceAddress(): ?EInvoiceAddress { return $this->eInvoiceAddress; } public function eInvoiceOperator(): ?string { return $this->eInvoiceOperator; } public function reference(): ?string { return $this->reference; } /** * Operator codes such as 003721291126 or NDEAFIHH: no spaces, upper case. */ private static function normaliseOperator(?string $operator): ?string { $operator = OptionalText::from($operator); return $operator === null ? null : strtoupper(preg_replace('/\s+/', '', $operator) ?? $operator); } private static function ensureOperatorForEInvoice(?EInvoiceAddress $address, ?string $operator): void { if ($address !== null && $operator === null) { throw new EInvoiceOperatorRequired; } } }