From 6ac40b598bc04cce82709004dbc9ed1905dedb12 Mon Sep 17 00:00:00 2001 From: tn3rb Date: Wed, 25 Jan 2023 11:40:41 -0800 Subject: [PATCH 1/2] add getUserAgent() --- src/CrawlerDetect.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/CrawlerDetect.php b/src/CrawlerDetect.php index f03591eb..830e8b73 100644 --- a/src/CrawlerDetect.php +++ b/src/CrawlerDetect.php @@ -93,7 +93,7 @@ public function __construct(array $headers = null, $userAgent = null) * Compile the regex patterns into one regex string. * * @param array - * + * * @return string */ public function compileRegex($patterns) @@ -188,4 +188,13 @@ public function getMatches() { return isset($this->matches[0]) ? $this->matches[0] : null; } + + + /** + * @return string|null + */ + public function getUserAgent(): ?string + { + return $this->userAgent; + } } From e72bf4323afe4f55f51f121d016b3b93ead49621 Mon Sep 17 00:00:00 2001 From: Mark Beech Date: Thu, 2 Feb 2023 20:47:38 +0000 Subject: [PATCH 2/2] Update CrawlerDetect.php --- src/CrawlerDetect.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CrawlerDetect.php b/src/CrawlerDetect.php index 830e8b73..2cd29976 100644 --- a/src/CrawlerDetect.php +++ b/src/CrawlerDetect.php @@ -193,7 +193,7 @@ public function getMatches() /** * @return string|null */ - public function getUserAgent(): ?string + public function getUserAgent() { return $this->userAgent; }