username = trim($username); $this->serverId = trim($serverId); } public function getUsername(): string { return $this->username; } public function getServerId(): string { return $this->serverId; } public function validate(): bool { return !$this->isEmpty($this->username) && !$this->isEmpty($this->serverId); } private function isEmpty($value): bool { return $value === null || $value === ''; } }