Skip to content

Commit 5f9728a

Browse files
committed
fix coding style
1 parent 7455658 commit 5f9728a

File tree

5 files changed

+23
-8
lines changed

5 files changed

+23
-8
lines changed

Parser/AbstractParser.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ protected function getRegexesDirectory(): string
240240
* @param string $regex
241241
*
242242
* @return ?array
243+
*
243244
* @throws \Exception
244245
*/
245246
protected function matchUserAgent(string $regex)
@@ -253,7 +254,7 @@ protected function matchUserAgent(string $regex)
253254
if (preg_match($regex, $this->userAgent, $matches)) {
254255
return $matches;
255256
}
256-
} catch (\Exception $exception){
257+
} catch (\Exception $exception) {
257258
throw new \Exception(
258259
sprintf("%s\nRegex: %s", $exception->getMessage(), $regex),
259260
$exception->getCode(),

Parser/Client/Browser.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -325,13 +325,13 @@ class Browser extends AbstractClientParser
325325
'UBrowser', 'Lovense Browser', 'AVG Secure Browser', 'TV Bro', 'Atom', '115 Browser',
326326
'Steam In-Game Overlay', 'Elements Browser', 'AOL Desktop', 'VMware AirWatch', 'Origin In-Game Overlay',
327327
'ToGate', 'Glass Browser', 'Sizzy', 'OhHai Browser', 'Yahoo! Japan Browser', 'Lulumi', 'Tungsten',
328-
'Xvast', 'Colibri', 'Quark', 'Yaani Browser'
328+
'Xvast', 'Colibri', 'Quark', 'Yaani Browser',
329329
],
330330
'Firefox' => [
331331
'Firefox', 'Fennec', 'Firefox Mobile', 'Swiftfox', 'Firebird', 'Phoenix', 'MicroB', 'Epic', 'Waterfox',
332332
'Cunaguaro', 'TenFourFox', 'Qwant Mobile', 'Firefox Rocket', 'IceCat', 'Mobicip', 'Firefox Mobile iOS',
333333
'Basilisk', 'Minimo', 'BlackHawk', 't-online.de Browser', 'Ordissimo', 'Mypal', 'Firefox Reality',
334-
'Arctic Fox', 'Centaury', 'Light', 'Safe Exam Browser', 'Zvu'
334+
'Arctic Fox', 'Centaury', 'Light', 'Safe Exam Browser', 'Zvu',
335335
],
336336
'Internet Explorer' => ['Internet Explorer', 'IE Mobile', 'Microsoft Edge'],
337337
'Konqueror' => ['Konqueror'],
@@ -444,7 +444,11 @@ public function parse(): ?array
444444
}
445445

446446
// This Exception should never be thrown. If so a defined browser name is missing in $availableBrowsers
447-
throw new \Exception(sprintf('Detected browser name "%s" was not found in $availableBrowsers. Tried to parse user agent: %s', $name, $this->userAgent)); // @codeCoverageIgnore
447+
throw new \Exception(sprintf(
448+
'Detected browser name "%s" was not found in $availableBrowsers. Tried to parse user agent: %s',
449+
$name,
450+
$this->userAgent
451+
)); // @codeCoverageIgnore
448452
}
449453

450454
/**

Parser/Client/Browser/Engine.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class Engine extends AbstractClientParser
4949
'Edge',
5050
'NetSurf',
5151
'Servo',
52-
'Goanna'
52+
'Goanna',
5353
];
5454

5555
/**
@@ -67,6 +67,7 @@ public static function getAvailableEngines(): array
6767
public function parse(): ?array
6868
{
6969
$matches = false;
70+
7071
foreach ($this->getRegexes() as $regex) {
7172
$matches = $this->matchUserAgent($regex['regex']);
7273

@@ -88,6 +89,9 @@ public function parse(): ?array
8889
}
8990

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

Parser/Device/AbstractDeviceParser.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -866,7 +866,13 @@ public function parse(): ?array
866866

867867
if (false === $brandId) {
868868
// This Exception should never be thrown. If so a defined brand name is missing in $deviceBrands
869-
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
869+
throw new \Exception(
870+
sprintf(
871+
"The brand name '%s' needs to be in deviceBrands array. Tried parsing user agent: %s",
872+
$brand,
873+
$this->userAgent
874+
)
875+
); // @codeCoverageIgnore
870876
}
871877

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

Parser/OperatingSystem.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ class OperatingSystem extends AbstractParser
145145
'GNU/Linux' => [
146146
'GNU/Linux', 'Arch Linux', 'Debian', 'Knoppix', 'Mint', 'Ubuntu', 'Kubuntu', 'Xubuntu', 'Lubuntu', 'Fedora',
147147
'Red Hat', 'VectorLinux', 'Mandriva', 'Gentoo', 'Sabayon', 'Slackware', 'SUSE', 'CentOS', 'BackTrack',
148-
'Sailfish OS', 'Ordissimo', 'TmaxOS'
148+
'Sailfish OS', 'Ordissimo', 'TmaxOS',
149149
],
150150
'Mac' => ['Mac'],
151151
'Mobile Gaming Console' => ['PlayStation Portable', 'Nintendo Mobile', 'Xbox'],

0 commit comments

Comments
 (0)