UserAgentHeaders
last analyzed

Complexity

Total Complexity 0

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 2
Bugs 1 Features 2
Metric Value
wmc 0
c 2
b 1
f 2
lcom 0
cbo 1
dl 0
loc 26
1
<?php
2
namespace MobileDetect\Providers;
3
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/
0 ignored issues
show
Unused Code Comprehensibility introduced by
38% of this comment could be valid code. Did you maybe forget this after debugging?

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.

Loading history...
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
}