Completed
Push — master ( a8cb62...764ba2 )
by François
03:52
created

UserAgent   A

Complexity

Total Complexity 12

Size/Duplication

Total Lines 80
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 12
c 1
b 0
f 0
lcom 2
cbo 2
dl 0
loc 80
rs 10

8 Methods

Rating   Name   Duplication   Size   Complexity  
A getId() 0 4 1
A setId() 0 4 1
A getType() 0 4 1
A setType() 0 4 1
A getAgent() 0 4 1
A setAgent() 0 8 3
A getSystem() 0 4 1
A setSystem() 0 8 3
1
<?php
2
3
/*
4
 * This file is part of the Bouncer package.
5
 *
6
 * (c) François Hodierne <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Bouncer;
13
14
class UserAgent extends Resource
15
{
16
17
    /**
18
     * The unique id
19
     *
20
     * @var string
21
     */
22
    protected $id;
23
24
    /**
25
     * Type: browser or robot
26
     *
27
     * @var string
28
     */
29
    protected $type;
30
31
    /**
32
     * Agent
33
     *
34
     * @var object
35
     */
36
    protected $agent;
37
38
    /**
39
     * System
40
     *
41
     * @var object
42
     */
43
    protected $system;
44
45
    public function getId()
46
    {
47
        return $this->id;
48
    }
49
50
    public function setId($id)
51
    {
52
        $this->id = $id;
53
    }
54
55
    public function getType()
56
    {
57
        return $this->type;
58
    }
59
60
    public function setType($type)
61
    {
62
        $this->type = $type;
63
    }
64
65
    public function getAgent()
66
    {
67
        return $this->agent;
68
    }
69
70
    public function setAgent($agent)
71
    {
72
        if (is_object($agent)) {
73
            $this->agent = $agent;
74
        } elseif (is_array($agent)) {
75
            $this->agent = new UserAgentPart($agent);
76
        }
77
    }
78
79
    public function getSystem()
80
    {
81
        return $this->system;
82
    }
83
84
    public function setSystem($system)
85
    {
86
        if (is_object($system)) {
87
            $this->system = $system;
88
        } elseif (is_array($system)) {
89
            $this->system = new UserAgentPart($system);
90
        }
91
    }
92
93
}
94