Skip to content

Commit

Permalink
Fix getUserInfo issue
Browse files Browse the repository at this point in the history
  • Loading branch information
goktugcy committed Jun 20, 2024
1 parent d3cf3c3 commit 2018609
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/Detector.php
Original file line number Diff line number Diff line change
Expand Up @@ -325,17 +325,23 @@ public static function getUserLanguage()
}

/**
* Retrieves all user information in an associative array.
* Retrieves the user's browser, operating system, device, and language.
*
* @return array Associative array of user information.
* @return string The user's browser, operating system, device, and language.
*/
public static function getUserInfo()
{
return [
$userInfo = [
'browser' => self::getUserBrowser(),
'os' => self::getUserOS(),
'device' => self::getUserDevice(),
'language' => self::getUserLanguage(),
];

$filteredUserInfo = array_filter($userInfo, function ($value) {
return $value !== 'no_data_found';
});

return implode(' | ', $filteredUserInfo);
}
}

0 comments on commit 2018609

Please sign in to comment.