From c8c9adde4d6ab8a7ce6eb2dc39f49349cc75dc3f Mon Sep 17 00:00:00 2001 From: sgiehl Date: Fri, 27 Sep 2019 11:53:07 +0200 Subject: [PATCH] fix coding style --- DeviceDetector.php | 2 +- Parser/Client/Browser.php | 6 +++++- Parser/Client/Browser/Engine.php | 5 ++++- Parser/Device/AbstractDeviceParser.php | 8 +++++++- 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/DeviceDetector.php b/DeviceDetector.php index 18bcba4619..9788491bf1 100644 --- a/DeviceDetector.php +++ b/DeviceDetector.php @@ -843,7 +843,7 @@ protected function parseDevice(): void * See https://developer.chrome.com/multidevice/user-agent#chrome_for_android_user_agent */ if (null === $this->device && 'Android' === $osFamily - && 'Chrome' == Browser::getBrowserFamily($this->getClient('short_name')) + && 'Chrome' === Browser::getBrowserFamily($this->getClientAttribute('name')) ) { if ($this->matchUserAgent('Chrome/[\.0-9]* Mobile')) { $this->device = AbstractDeviceParser::DEVICE_TYPE_SMARTPHONE; diff --git a/Parser/Client/Browser.php b/Parser/Client/Browser.php index b3c67a0408..57193d103f 100644 --- a/Parser/Client/Browser.php +++ b/Parser/Client/Browser.php @@ -410,7 +410,11 @@ public function parse(): ?array } // This Exception should never be thrown. If so a defined browser name is missing in $availableBrowsers - throw new \Exception(sprintf('Detected browser name "%s" was not found in $availableBrowsers. Tried to parse user agent: %s', $name, $this->userAgent)); // @codeCoverageIgnore + throw new \Exception(sprintf( + 'Detected browser name "%s" was not found in $availableBrowsers. Tried to parse user agent: %s', + $name, + $this->userAgent + )); // @codeCoverageIgnore } /** diff --git a/Parser/Client/Browser/Engine.php b/Parser/Client/Browser/Engine.php index c70db82a66..44f05cef40 100644 --- a/Parser/Client/Browser/Engine.php +++ b/Parser/Client/Browser/Engine.php @@ -86,6 +86,9 @@ public function parse(): ?array } // This Exception should never be thrown. If so a defined browser name is missing in $availableEngines - throw new \Exception(sprintf('Detected browser engine was not found in $availableEngines. Tried to parse user agent: %s', $this->userAgent)); // @codeCoverageIgnore + throw new \Exception(sprintf( + 'Detected browser engine was not found in $availableEngines. Tried to parse user agent: %s', + $this->userAgent + )); // @codeCoverageIgnore } } diff --git a/Parser/Device/AbstractDeviceParser.php b/Parser/Device/AbstractDeviceParser.php index 016a3fad3b..0457f78a3a 100644 --- a/Parser/Device/AbstractDeviceParser.php +++ b/Parser/Device/AbstractDeviceParser.php @@ -751,7 +751,13 @@ public function parse(): ?array if (false === $brandId) { // This Exception should never be thrown. If so a defined brand name is missing in $deviceBrands - throw new \Exception(sprintf("The brand with name '%s' should be listed in the deviceBrands array. Tried to parse user agent: %s", $brand, $this->userAgent)); // @codeCoverageIgnore + throw new \Exception( + sprintf( + "The brand name '%s' needs to be in deviceBrands array. Tried parsing user agent: %s", + $brand, + $this->userAgent + ) + ); // @codeCoverageIgnore } $this->brand = (string) $brandId;