1 | <?php |
||
16 | class UserAgentStringCom extends AbstractHttpProvider |
||
17 | { |
||
18 | /** |
||
19 | * Name of the provider |
||
20 | * |
||
21 | * @var string |
||
22 | */ |
||
23 | protected $name = 'UserAgentStringCom'; |
||
24 | |||
25 | /** |
||
26 | * Homepage of the provider |
||
27 | * |
||
28 | * @var string |
||
29 | */ |
||
30 | protected $homepage = 'http://www.useragentstring.com/'; |
||
31 | |||
32 | protected $detectionCapabilities = [ |
||
33 | |||
34 | 'browser' => [ |
||
35 | 'name' => true, |
||
36 | 'version' => true, |
||
37 | ], |
||
38 | |||
39 | 'renderingEngine' => [ |
||
40 | 'name' => false, |
||
41 | 'version' => false, |
||
42 | ], |
||
43 | |||
44 | 'operatingSystem' => [ |
||
45 | 'name' => true, |
||
46 | 'version' => true, |
||
47 | ], |
||
48 | |||
49 | 'device' => [ |
||
50 | 'model' => false, |
||
51 | 'brand' => false, |
||
52 | 'type' => false, |
||
53 | 'isMobile' => false, |
||
54 | 'isTouch' => false, |
||
55 | ], |
||
56 | |||
57 | 'bot' => [ |
||
58 | 'isBot' => true, |
||
59 | 'name' => true, |
||
60 | 'type' => true, |
||
61 | ], |
||
62 | ]; |
||
63 | |||
64 | protected $defaultValues = [ |
||
65 | 'general' => [ |
||
66 | '/^unknown$/i', |
||
67 | '/^--$/i', |
||
68 | ], |
||
69 | ]; |
||
70 | |||
71 | private $botTypes = [ |
||
72 | 'Crawler', |
||
73 | 'Cloud Platform', |
||
74 | 'Feed Reader', |
||
75 | 'LinkChecker', |
||
76 | 'Validator', |
||
77 | ]; |
||
78 | |||
79 | private static $uri = 'http://www.useragentstring.com/'; |
||
80 | |||
81 | 1 | public function getVersion() |
|
85 | |||
86 | /** |
||
87 | * |
||
88 | * @param string $userAgent |
||
89 | * @param array $headers |
||
90 | * @return stdClass |
||
91 | * @throws Exception\RequestException |
||
92 | */ |
||
93 | 9 | protected function getResult($userAgent, array $headers) |
|
127 | |||
128 | /** |
||
129 | * |
||
130 | * @param stdClass $resultRaw |
||
131 | * |
||
132 | * @return bool |
||
133 | */ |
||
134 | 6 | private function hasResult(stdClass $resultRaw) |
|
142 | |||
143 | /** |
||
144 | * |
||
145 | * @param stdClass $resultRaw |
||
146 | * @return boolean |
||
147 | */ |
||
148 | 4 | private function isBot(stdClass $resultRaw) |
|
156 | |||
157 | /** |
||
158 | * |
||
159 | * @param Model\Bot $bot |
||
160 | * @param stdClass $resultRaw |
||
161 | */ |
||
162 | 1 | private function hydrateBot(Model\Bot $bot, stdClass $resultRaw) |
|
174 | |||
175 | /** |
||
176 | * |
||
177 | * @param Model\Browser $browser |
||
178 | * @param stdClass $resultRaw |
||
179 | */ |
||
180 | 3 | private function hydrateBrowser(Model\Browser $browser, stdClass $resultRaw) |
|
190 | |||
191 | /** |
||
192 | * |
||
193 | * @param Model\OperatingSystem $os |
||
194 | * @param stdClass $resultRaw |
||
195 | */ |
||
196 | 3 | private function hydrateOperatingSystem(Model\OperatingSystem $os, stdClass $resultRaw) |
|
206 | |||
207 | 9 | public function parse($userAgent, array $headers = []) |
|
241 | } |
||
242 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.