diff --git a/src/Classes/UserAgent/ParserPhpDriver.php b/src/Classes/UserAgent/ParserPhpDriver.php index 10757a0..73218e9 100644 --- a/src/Classes/UserAgent/ParserPhpDriver.php +++ b/src/Classes/UserAgent/ParserPhpDriver.php @@ -24,7 +24,8 @@ public function getOperatingSystem(): ?string return null; } - return $this->parser->os->name ?: null; + /** @phpstan-ignore-next-line */ + return $this->parser->os->name ?? null; } public function getOperatingSystemVersion(): ?string diff --git a/tests/Unit/Classes/ResolverTest.php b/tests/Unit/Classes/ResolverTest.php index 343d24f..663df5f 100644 --- a/tests/Unit/Classes/ResolverTest.php +++ b/tests/Unit/Classes/ResolverTest.php @@ -84,6 +84,19 @@ public static function trackingFieldsProvider(): array 'device_type' => 'robot', ], ], + + // UC Browser 7 + [ + 'Mozilla/4.0 (compatible; MSIE 6.0; ) Opera/UCWEB7.0.2.37/28/999', + [ + 'operating_system' => null, + 'operating_system_version' => null, + 'browser' => 'UC Browser', + 'browser_version' => '7.0', + 'referer_url' => null, + 'device_type' => 'mobile', + ], + ], ]; }