code = strtolower(trim($code)); $this->message = trim($message); $this->type = strtolower(trim($type)); $this->field = $field !== null ? strtolower(trim($field)) : null; $this->severity = strtolower(trim($severity)); } public function getCode(): string { return $this->code; } public function getMessage(): string { return $this->message; } public function getType(): string { return $this->type; } public function getField(): ?string { return $this->field; } public function getSeverity(): string { return $this->severity; } }