1 | <?php |
||
9 | class Wurfl extends AbstractProvider |
||
10 | { |
||
11 | /** |
||
12 | * Name of the provider |
||
13 | * |
||
14 | * @var string |
||
15 | */ |
||
16 | protected $name = 'Wurfl'; |
||
17 | |||
18 | /** |
||
19 | * Homepage of the provider |
||
20 | * |
||
21 | * @var string |
||
22 | */ |
||
23 | protected $homepage = 'https://github.com/mimmi20/Wurfl'; |
||
24 | |||
25 | /** |
||
26 | * Composer package name |
||
27 | * |
||
28 | * @var string |
||
29 | */ |
||
30 | protected $packageName = 'mimmi20/wurfl'; |
||
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' => true, |
||
52 | 'type' => true, |
||
53 | 'isMobile' => true, |
||
54 | 'isTouch' => true, |
||
55 | ], |
||
56 | |||
57 | 'bot' => [ |
||
58 | 'isBot' => true, |
||
59 | 'name' => false, |
||
60 | 'type' => false, |
||
61 | ], |
||
62 | ]; |
||
63 | |||
64 | protected $defaultValues = [ |
||
65 | |||
66 | 'general' => [], |
||
67 | |||
68 | 'operatingSystem' => [ |
||
69 | 'name' => [ |
||
70 | '/^Unknown$/i', |
||
71 | ], |
||
72 | ], |
||
73 | |||
74 | 'device' => [ |
||
75 | |||
76 | 'brand' => [ |
||
77 | '/^Generic$/i', |
||
78 | ], |
||
79 | |||
80 | 'model' => [ |
||
81 | '/^Android/i', |
||
82 | '/^SmartTV$/i', |
||
83 | '/^Windows Phone/i', |
||
84 | '/^Windows Mobile/i', |
||
85 | '/^Firefox/i', |
||
86 | '/^unrecognized/i', |
||
87 | '/^Generic/i', |
||
88 | '/^Disguised as Macintosh$/i', |
||
89 | '/^Windows RT/i', |
||
90 | '/^Tablet on Android$/i', |
||
91 | ], |
||
92 | ], |
||
93 | ]; |
||
94 | |||
95 | /** |
||
96 | * |
||
97 | * @var WurflManager |
||
98 | */ |
||
99 | private $parser; |
||
100 | |||
101 | /** |
||
102 | * |
||
103 | * @param WurflManager $parser |
||
104 | */ |
||
105 | 28 | public function __construct(WurflManager $parser) |
|
109 | |||
110 | 2 | public function getVersion() |
|
124 | |||
125 | 2 | public function getUpdateDate() |
|
139 | |||
140 | /** |
||
141 | * |
||
142 | * @return WurflManager |
||
143 | */ |
||
144 | 12 | public function getParser() |
|
148 | |||
149 | /** |
||
150 | * |
||
151 | * @param CustomDevice $device |
||
152 | * @return boolean |
||
153 | */ |
||
154 | 7 | private function hasResult(CustomDevice $device) |
|
162 | |||
163 | /** |
||
164 | * |
||
165 | * @param Model\Browser $browser |
||
166 | * @param CustomDevice $deviceRaw |
||
167 | */ |
||
168 | 5 | private function hydrateBrowser(Model\Browser $browser, CustomDevice $deviceRaw) |
|
173 | |||
174 | /** |
||
175 | * |
||
176 | * @param Model\OperatingSystem $os |
||
177 | * @param CustomDevice $deviceRaw |
||
178 | */ |
||
179 | 5 | private function hydrateOperatingSystem(Model\OperatingSystem $os, CustomDevice $deviceRaw) |
|
187 | |||
188 | /** |
||
189 | * |
||
190 | * @param Model\UserAgent $device |
||
191 | * @param CustomDevice $deviceRaw |
||
192 | */ |
||
193 | 5 | private function hydrateDevice(Model\Device $device, CustomDevice $deviceRaw) |
|
218 | |||
219 | 7 | public function parse($userAgent, array $headers = []) |
|
263 | } |
||
264 |
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.
The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.
This check looks for comments that seem to be mostly valid code and reports them.