1 | <?php |
||
17 | class NeutrinoApiCom extends AbstractHttpProvider |
||
18 | { |
||
19 | /** |
||
20 | * Name of the provider |
||
21 | * |
||
22 | * @var string |
||
23 | */ |
||
24 | protected $name = 'NeutrinoApiCom'; |
||
25 | |||
26 | /** |
||
27 | * Homepage of the provider |
||
28 | * |
||
29 | * @var string |
||
30 | */ |
||
31 | protected $homepage = 'https://www.neutrinoapi.com/'; |
||
32 | |||
33 | protected $detectionCapabilities = [ |
||
34 | |||
35 | 'browser' => [ |
||
36 | 'name' => true, |
||
37 | 'version' => true, |
||
38 | ], |
||
39 | |||
40 | 'renderingEngine' => [ |
||
41 | 'name' => false, |
||
42 | 'version' => false, |
||
43 | ], |
||
44 | |||
45 | 'operatingSystem' => [ |
||
46 | 'name' => true, |
||
47 | 'version' => true, |
||
48 | ], |
||
49 | |||
50 | 'device' => [ |
||
51 | 'model' => true, |
||
52 | 'brand' => true, |
||
53 | 'type' => true, |
||
54 | 'isMobile' => true, |
||
55 | 'isTouch' => false, |
||
56 | ], |
||
57 | |||
58 | 'bot' => [ |
||
59 | 'isBot' => true, |
||
60 | 'name' => true, |
||
61 | 'type' => false, |
||
62 | ], |
||
63 | ]; |
||
64 | |||
65 | protected $defaultValues = [ |
||
66 | |||
67 | 'general' => [ |
||
68 | '/^unknown$/i', |
||
69 | ], |
||
70 | |||
71 | 'device' => [ |
||
72 | |||
73 | 'brand' => [ |
||
74 | '/^Generic$/i', |
||
75 | '/^generic web browser$/i', |
||
76 | ], |
||
77 | |||
78 | 'model' => [ |
||
79 | '/^Android/i', |
||
80 | '/^Windows Phone/i', |
||
81 | '/^Windows Mobile/i', |
||
82 | '/^Firefox/i', |
||
83 | '/^Generic/i', |
||
84 | '/^Tablet on Android$/i', |
||
85 | '/^Tablet$/i', |
||
86 | ], |
||
87 | ], |
||
88 | ]; |
||
89 | |||
90 | private static $uri = 'https://neutrinoapi.com/user-agent-info'; |
||
91 | |||
92 | private $apiUserId; |
||
93 | |||
94 | private $apiKey; |
||
95 | |||
96 | 22 | public function __construct(Client $client, $apiUserId, $apiKey) |
|
103 | |||
104 | 7 | public function getVersion() |
|
108 | |||
109 | /** |
||
110 | * |
||
111 | * @param string $userAgent |
||
112 | * @param array $headers |
||
113 | * @return stdClass |
||
114 | * @throws Exception\RequestException |
||
115 | */ |
||
116 | 15 | protected function getResult($userAgent, array $headers) |
|
192 | |||
193 | /** |
||
194 | * |
||
195 | * @param stdClass $resultRaw |
||
196 | * |
||
197 | * @return bool |
||
198 | */ |
||
199 | 7 | private function hasResult(stdClass $resultRaw) |
|
207 | |||
208 | /** |
||
209 | * |
||
210 | * @param stdClass $resultRaw |
||
211 | * @return boolean |
||
212 | */ |
||
213 | 6 | private function isBot(stdClass $resultRaw) |
|
221 | |||
222 | /** |
||
223 | * |
||
224 | * @param Model\Bot $bot |
||
225 | * @param stdClass $resultRaw |
||
226 | */ |
||
227 | 2 | private function hydrateBot(Model\Bot $bot, stdClass $resultRaw) |
|
235 | |||
236 | /** |
||
237 | * |
||
238 | * @param Model\Browser $browser |
||
239 | * @param stdClass $resultRaw |
||
240 | */ |
||
241 | 4 | private function hydrateBrowser(Model\Browser $browser, stdClass $resultRaw) |
|
251 | |||
252 | /** |
||
253 | * |
||
254 | * @param Model\OperatingSystem $os |
||
255 | * @param stdClass $resultRaw |
||
256 | */ |
||
257 | 4 | private function hydrateOperatingSystem(Model\OperatingSystem $os, stdClass $resultRaw) |
|
267 | |||
268 | /** |
||
269 | * |
||
270 | * @param Model\Device $device |
||
271 | * @param stdClass $resultRaw |
||
272 | */ |
||
273 | 4 | private function hydrateDevice(Model\Device $device, stdClass $resultRaw) |
|
291 | |||
292 | 15 | public function parse($userAgent, array $headers = []) |
|
327 | } |
||
328 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.