Skip to content

Commit c8c9add

Browse files
committed
fix coding style
1 parent 0ecced4 commit c8c9add

File tree

4 files changed

+17
-4
lines changed

4 files changed

+17
-4
lines changed

DeviceDetector.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -843,7 +843,7 @@ protected function parseDevice(): void
843843
* See https://developer.chrome.com/multidevice/user-agent#chrome_for_android_user_agent
844844
*/
845845
if (null === $this->device && 'Android' === $osFamily
846-
&& 'Chrome' == Browser::getBrowserFamily($this->getClient('short_name'))
846+
&& 'Chrome' === Browser::getBrowserFamily($this->getClientAttribute('name'))
847847
) {
848848
if ($this->matchUserAgent('Chrome/[\.0-9]* Mobile')) {
849849
$this->device = AbstractDeviceParser::DEVICE_TYPE_SMARTPHONE;

Parser/Client/Browser.php

+5-1
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,11 @@ public function parse(): ?array
410410
}
411411

412412
// This Exception should never be thrown. If so a defined browser name is missing in $availableBrowsers
413-
throw new \Exception(sprintf('Detected browser name "%s" was not found in $availableBrowsers. Tried to parse user agent: %s', $name, $this->userAgent)); // @codeCoverageIgnore
413+
throw new \Exception(sprintf(
414+
'Detected browser name "%s" was not found in $availableBrowsers. Tried to parse user agent: %s',
415+
$name,
416+
$this->userAgent
417+
)); // @codeCoverageIgnore
414418
}
415419

416420
/**

Parser/Client/Browser/Engine.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ public function parse(): ?array
8686
}
8787

8888
// This Exception should never be thrown. If so a defined browser name is missing in $availableEngines
89-
throw new \Exception(sprintf('Detected browser engine was not found in $availableEngines. Tried to parse user agent: %s', $this->userAgent)); // @codeCoverageIgnore
89+
throw new \Exception(sprintf(
90+
'Detected browser engine was not found in $availableEngines. Tried to parse user agent: %s',
91+
$this->userAgent
92+
)); // @codeCoverageIgnore
9093
}
9194
}

Parser/Device/AbstractDeviceParser.php

+7-1
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,13 @@ public function parse(): ?array
751751

752752
if (false === $brandId) {
753753
// This Exception should never be thrown. If so a defined brand name is missing in $deviceBrands
754-
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
754+
throw new \Exception(
755+
sprintf(
756+
"The brand name '%s' needs to be in deviceBrands array. Tried parsing user agent: %s",
757+
$brand,
758+
$this->userAgent
759+
)
760+
); // @codeCoverageIgnore
755761
}
756762

757763
$this->brand = (string) $brandId;

0 commit comments

Comments
 (0)