Gps.php 657 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. namespace WhichBrowser\Analyser\Header\Useragent\Device;
  3. use WhichBrowser\Constants;
  4. trait Gps
  5. {
  6. private function detectGps($ua)
  7. {
  8. if (!preg_match('/Nuvi/ui', $ua)) {
  9. return;
  10. }
  11. $this->detectGarmin($ua);
  12. }
  13. /* Garmin Nuvi */
  14. private function detectGarmin($ua)
  15. {
  16. if (preg_match('/Nuvi/u', $ua) && preg_match('/Qtopia/u', $ua)) {
  17. $this->data->device->setIdentification([
  18. 'manufacturer' => 'Garmin',
  19. 'model' => 'Nuvi',
  20. 'type' => Constants\DeviceType::GPS
  21. ]);
  22. }
  23. }
  24. }