source = $source; } /** * detect the useragent * * @throws void */ public function getUserAgent(): string { $userAgent = ''; foreach ($this->userAgentHeaders as $header) { if (array_key_exists($header, $this->source) && $this->source[$header]) { $userAgent = $this->cleanParam($this->source[$header]); break; } } return $userAgent; } /** * clean Parameters taken from GET or POST Variables * * @param string $param the value to be cleaned * * @throws void */ private function cleanParam(string $param): string { return strip_tags(trim(urldecode($param))); } }