1 | <?php |
||
9 | class JenssegersAgent extends AbstractProvider |
||
10 | { |
||
11 | /** |
||
12 | * Name of the provider |
||
13 | * |
||
14 | * @var string |
||
15 | */ |
||
16 | protected $name = 'JenssegersAgent'; |
||
17 | |||
18 | /** |
||
19 | * Homepage of the provider |
||
20 | * |
||
21 | * @var string |
||
22 | */ |
||
23 | protected $homepage = 'https://github.com/jenssegers/agent'; |
||
24 | |||
25 | /** |
||
26 | * Composer package name |
||
27 | * |
||
28 | * @var string |
||
29 | */ |
||
30 | protected $packageName = 'jenssegers/agent'; |
||
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' => true, |
||
51 | 'brand' => false, |
||
52 | 'type' => false, |
||
53 | 'isMobile' => true, |
||
54 | 'isTouch' => false, |
||
55 | ], |
||
56 | |||
57 | 'bot' => [ |
||
58 | 'isBot' => true, |
||
59 | 'name' => true, |
||
60 | 'type' => false, |
||
61 | ], |
||
62 | ]; |
||
63 | |||
64 | /** |
||
65 | * Used for unitTests mocking |
||
66 | * |
||
67 | * @var Agent |
||
68 | */ |
||
69 | private $parser; |
||
70 | |||
71 | /** |
||
72 | * |
||
73 | * @throws PackageNotLoadedException |
||
74 | */ |
||
75 | 12 | public function __construct() |
|
81 | |||
82 | /** |
||
83 | * |
||
84 | * @return Agent |
||
85 | */ |
||
86 | 6 | public function getParser() |
|
94 | |||
95 | /** |
||
96 | * |
||
97 | * @param array $resultRaw |
||
98 | * |
||
99 | * @return bool |
||
100 | */ |
||
101 | 5 | private function hasResult(array $resultRaw) |
|
113 | |||
114 | /** |
||
115 | * |
||
116 | * @param Model\Bot $bot |
||
117 | * @param array $browserRaw |
||
|
|||
118 | */ |
||
119 | 1 | private function hydrateBot(Model\Bot $bot, array $resultRaw) |
|
127 | |||
128 | /** |
||
129 | * |
||
130 | * @param Model\Browser $browser |
||
131 | * @param array $resultRaw |
||
132 | */ |
||
133 | 3 | private function hydrateBrowser(Model\Browser $browser, array $resultRaw) |
|
143 | |||
144 | /** |
||
145 | * |
||
146 | * @param Model\OperatingSystem $os |
||
147 | * @param array $resultRaw |
||
148 | */ |
||
149 | 3 | private function hydrateOperatingSystem(Model\OperatingSystem $os, array $resultRaw) |
|
159 | |||
160 | /** |
||
161 | * |
||
162 | * @param Model\Device $device |
||
163 | * @param array $resultRaw |
||
164 | */ |
||
165 | 3 | private function hydrateDevice(Model\Device $device, array $resultRaw) |
|
175 | |||
176 | 5 | public function parse($userAgent, array $headers = []) |
|
234 | } |
||
235 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.