1 | <?php |
||
4 | class UserAgentHeaders extends AbstractProvider |
||
5 | { |
||
6 | /** |
||
7 | * All possible HTTP headers that represent the |
||
8 | * User-Agent string. |
||
9 | * |
||
10 | * Instead of looking just for HTTP_USER_AGENT |
||
11 | * we will check multiple variants to extract as |
||
12 | * much data as possible. |
||
13 | * |
||
14 | * @var array |
||
15 | */ |
||
16 | protected $data = array( |
||
17 | // The default User-Agent string. |
||
18 | 'User-Agent', |
||
19 | // Header can occur on devices using Opera Mini. |
||
20 | 'X-OperaMini-Phone-UA', |
||
21 | // Vodafone specific header: http://www.seoprinciple.com/mobile-web-community-still-angry-at-vodafone/24/ |
||
|
|||
22 | 'X-Device-User-Agent', |
||
23 | 'X-Original-User-Agent', |
||
24 | 'X-Skyfire-Phone', |
||
25 | 'X-Bold-Phone-UA', |
||
26 | 'Device-Stock-UA', |
||
27 | 'X-UcBrowser-Device-UA', |
||
28 | ); |
||
29 | } |
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.