| @@ 44-53 (lines=10) @@ | ||
| 41 | return []; |
|
| 42 | } |
|
| 43 | ||
| 44 | private function detectByDeviceType($family): array |
|
| 45 | { |
|
| 46 | foreach ($this->config[$family] as $deviceType => $patternList) { |
|
| 47 | $os = $this->detectByPattern($patternList); |
|
| 48 | if ($os) { |
|
| 49 | return array_merge($os, ['type' => $deviceType]); |
|
| 50 | } |
|
| 51 | } |
|
| 52 | return []; |
|
| 53 | } |
|
| 54 | ||
| 55 | } |
|
| @@ 67-79 (lines=13) @@ | ||
| 64 | } |
|
| 65 | } |
|
| 66 | ||
| 67 | protected function detectByType(): array |
|
| 68 | { |
|
| 69 | foreach ($this->config as $type => $patternList) { |
|
| 70 | if ($type === 'default') { |
|
| 71 | continue; |
|
| 72 | } |
|
| 73 | $browser = $this->detectByPattern($patternList); |
|
| 74 | if ($browser) { |
|
| 75 | return array_merge($browser, ['type' => $type]); |
|
| 76 | } |
|
| 77 | } |
|
| 78 | return []; |
|
| 79 | } |
|
| 80 | } |
|