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

UserAgent::setSystem()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 8
rs 9.4285
cc 3
eloc 5
nc 3
nop 1
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