Skip to content

Commit

Permalink
fix cs
Browse files Browse the repository at this point in the history
  • Loading branch information
sgiehl committed Oct 27, 2020
1 parent fd1bdae commit 364d388
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions misc/fileTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@
* `php file-test.php /tmp/source-useragent.txt "not" "useragent" > /tmp/useragent-not-detected.txt`
*/
use DeviceDetector\DeviceDetector;
use DeviceDetector\Parser\Client\Browser;
use DeviceDetector\Parser\Device\AbstractDeviceParser;
use DeviceDetector\Parser\OperatingSystem;

require __DIR__ . '/../vendor/autoload.php';

Expand Down Expand Up @@ -107,14 +105,10 @@ function printReport(array $result, string $format): void
$deviceDetector->setUserAgent($userAgent);
$deviceDetector->parse();

if ($deviceDetector->isBot()) {
$result = [
'user_agent' => $deviceDetector->getUserAgent(),
'bot' => $deviceDetector->getBot(),
];
} else {
$result = DeviceDetector::getInfoFromUserAgent($userAgent);
}
$result = $deviceDetector->isBot() ? [
'user_agent' => $deviceDetector->getUserAgent(),
'bot' => $deviceDetector->getBot(),
] : DeviceDetector::getInfoFromUserAgent($userAgent);

if (!isset($result['device']['model'])) {
continue;
Expand Down

0 comments on commit 364d388

Please sign in to comment.