Skip to content

Commit

Permalink
fix FormFactors condition (matomo-org#7822)
Browse files Browse the repository at this point in the history
  • Loading branch information
sanchezzzhak authored Sep 13, 2024
1 parent 4754955 commit 2f54d5a
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions Parser/Device/AbstractDeviceParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 2f54d5a

Please sign in to comment.