From 2f54d5af7e887fa6aa246e1ae0598c97c35d9930 Mon Sep 17 00:00:00 2001 From: Tutik Alexsandr Date: Fri, 13 Sep 2024 10:57:59 +0300 Subject: [PATCH] fix FormFactors condition (#7822) --- Parser/Device/AbstractDeviceParser.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Parser/Device/AbstractDeviceParser.php b/Parser/Device/AbstractDeviceParser.php index 4b7818bb6c..cf1d19ae98 100644 --- a/Parser/Device/AbstractDeviceParser.php +++ b/Parser/Device/AbstractDeviceParser.php @@ -2264,11 +2264,9 @@ protected function parseClientHints(): ?array $formFactors = $this->clientHints->getFormFactors(); if (\count($formFactors) > 0) { - foreach (self::$clientHintFormFactorsMapping as $formFactor => $deviceType) { - $hasDeviceType = $formFactors[$formFactor] ?? null; - - if (null !== $hasDeviceType) { - $deviceType = self::getDeviceName($deviceType); + foreach (self::$clientHintFormFactorsMapping as $formFactor => $deviceTypeId) { + if (\array_key_exists($formFactor, $formFactors)) { + $deviceType = self::getDeviceName($deviceTypeId); break; }