Skip to content

Commit 7db7baa

Browse files
committed
fix issues
1 parent 5975fa3 commit 7db7baa

File tree

3 files changed

+14
-21
lines changed

3 files changed

+14
-21
lines changed

src/Detector.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
use BrowserDetector\Loader\DeviceLoaderFactoryInterface;
2020
use BrowserDetector\Parser\Header\Exception\VersionContainsDerivateException;
2121
use BrowserDetector\Version\Exception\NotNumericException;
22+
use BrowserDetector\Version\FireOs;
2223
use BrowserDetector\Version\ForcedNullVersion;
2324
use BrowserDetector\Version\LineageOs;
2425
use BrowserDetector\Version\NullVersion;
@@ -618,7 +619,7 @@ private function getVersionForFireOs(array $filteredHeaders): VersionInterface
618619
VersionInterface::IGNORE_MINOR_IF_EMPTY,
619620
);
620621

621-
$fireOsVersion = new \BrowserDetector\Version\FireOs(new VersionBuilder());
622+
$fireOsVersion = new FireOs(new VersionBuilder());
622623

623624
return $fireOsVersion->getVersion($androidVersion ?? '');
624625
} catch (VersionContainsDerivateException | UnexpectedValueException | NotNumericException) {

src/Version/FireOs.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,18 @@
2525
final readonly class FireOs
2626
{
2727
private const array VERSION_MAP = [
28-
'11' => '8',
29-
'10' => '8',
30-
'9' => '7',
31-
'7' => '6',
32-
'5' => '5',
28+
'11' => '8',
29+
'10' => '8',
30+
'9' => '7',
31+
'7' => '6',
32+
'5' => '5',
3333
'4.4.3' => '4.5.1',
3434
'4.4.2' => '4',
3535
'4.2.2' => '3',
3636
'4.0.3' => '3',
3737
'4.0.2' => '3',
38-
'4' => '2',
39-
'2' => '1',
38+
'4' => '2',
39+
'2' => '1',
4040
];
4141

4242
/** @throws void */
@@ -64,7 +64,7 @@ public function getVersion(string $androidVersion): VersionInterface
6464
),
6565
ARRAY_FILTER_USE_KEY,
6666
);
67-
$fireOsVersion = current($lineageOsVersions);
67+
$fireOsVersion = current($lineageOsVersions);
6868

6969
if ($fireOsVersion === false) {
7070
$fireOsVersion = '';

tests/DetectorTest/DetectorTest.php

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1089,13 +1089,9 @@ public static function providerUa(): array
10891089
],
10901090
],
10911091
[
1092+
['user-agent' => 'imoAndroid/2020.03.2011; 10; REL; SM-G973F; samsung; play; phone; arm64-v8a'],
10921093
[
1093-
'user-agent' => 'imoAndroid/2020.03.2011; 10; REL; SM-G973F; samsung; play; phone; arm64-v8a',
1094-
],
1095-
[
1096-
'headers' => [
1097-
'user-agent' => 'imoAndroid/2020.03.2011; 10; REL; SM-G973F; samsung; play; phone; arm64-v8a',
1098-
],
1094+
'headers' => ['user-agent' => 'imoAndroid/2020.03.2011; 10; REL; SM-G973F; samsung; play; phone; arm64-v8a'],
10991095
'device' => [
11001096
'architecture' => null,
11011097
'deviceName' => 'SM-G973F',
@@ -1139,13 +1135,9 @@ public static function providerUa(): array
11391135
],
11401136
],
11411137
[
1138+
['user-agent' => 'com.amazon.sics/3.0.200230.0 (KFSUWI; Android 22; Amazon)'],
11421139
[
1143-
'user-agent' => 'com.amazon.sics/3.0.200230.0 (KFSUWI; Android 22; Amazon)',
1144-
],
1145-
[
1146-
'headers' => [
1147-
'user-agent' => 'com.amazon.sics/3.0.200230.0 (KFSUWI; Android 22; Amazon)',
1148-
],
1140+
'headers' => ['user-agent' => 'com.amazon.sics/3.0.200230.0 (KFSUWI; Android 22; Amazon)'],
11491141
'device' => [
11501142
'architecture' => null,
11511143
'deviceName' => 'KFSUWI',

0 commit comments

Comments
 (0)