GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

OperatingSystem   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 62
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 6
lcom 1
cbo 1
dl 0
loc 62
c 0
b 0
f 0
ccs 16
cts 16
cp 1
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A setName() 0 4 1
A getName() 0 4 1
A setVersion() 0 4 1
A getVersion() 0 4 1
A toArray() 0 7 1
1
<?php
2
namespace UserAgentParser\Model;
3
4
/**
5
 * Operating system model
6
 *
7
 * @author Martin Keckeis <[email protected]>
8
 * @license MIT
9
 */
10
class OperatingSystem
11
{
12
    /**
13
     * @var string
14
     */
15
    private $name;
16
17
    /**
18
     * @var Version
19
     */
20
    private $version;
21
22 3
    public function __construct()
23
    {
24 3
        $this->version = new Version();
25 3
    }
26
27
    /**
28
     *
29
     * @param string $name
30
     */
31 2
    public function setName($name)
32
    {
33 2
        $this->name = $name;
34 2
    }
35
36
    /**
37
     *
38
     * @return string
39
     */
40 2
    public function getName()
41
    {
42 2
        return $this->name;
43
    }
44
45
    /**
46
     * @param Version $version
47
     */
48 1
    public function setVersion(Version $version)
49
    {
50 1
        $this->version = $version;
51 1
    }
52
53
    /**
54
     * @return Version
55
     */
56 2
    public function getVersion()
57
    {
58 2
        return $this->version;
59
    }
60
61
    /**
62
     * @return array
63
     */
64 1
    public function toArray()
65
    {
66
        return [
67 1
            'name'    => $this->getName(),
68 1
            'version' => $this->getVersion()->toArray(),
69
        ];
70
    }
71
}
72