setUserAgent($userAgent); } public function getUserAgent(): string { return $this->userAgent; } public function setUserAgent(string $userAgent): void { $this->userAgent = $userAgent; $this->hash = (string)crc32($userAgent); } public function getHash(): string { return $this->hash; } public function getUserAgentType(): int { if (in_array($this->getUserAgent(), self::MACHINE_USER_AGENTS, true)) { return self::USER_AGENT_TYPE_MACHINE; } return self::USER_AGENT_TYPE_HUMAN; } }