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.

Physical   A
last analyzed

Complexity

Total Complexity 11

Size/Duplication

Total Lines 121
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 11
lcom 1
cbo 0
dl 0
loc 121
rs 10
c 0
b 0
f 0

8 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 19 3
A deviceType() 0 4 1
A proximity() 0 4 1
A major() 0 4 1
A minor() 0 4 1
A packets() 0 8 2
A url() 0 4 1
A txPower() 0 4 1
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace Speicher210\KontaktIO\Model\Device\Update;
6
7
use JMS\Serializer\Annotation as JMS;
8
9
final class Physical
10
{
11
    /**
12
     * Device type.
13
     *
14
     * @var string
15
     *
16
     * @JMS\Type("string")
17
     * @JMS\SerializedName("deviceType")
18
     */
19
    private $deviceType;
20
21
    /**
22
     * The UUID of the device.
23
     *
24
     * @var string
25
     *
26
     * @JMS\Type("string")
27
     * @JMS\SerializedName("proximity")
28
     */
29
    private $proximity;
30
31
    /**
32
     * @var integer
33
     *
34
     * @JMS\Type("integer")
35
     * @JMS\SerializedName("major")
36
     */
37
    private $major;
38
39
    /**
40
     * @var integer
41
     *
42
     * @JMS\Type("integer")
43
     * @JMS\SerializedName("minor")
44
     */
45
    private $minor;
46
47
    /**
48
     * @var string
49
     *
50
     * @JMS\Type("string")
51
     * @JMS\SerializedName("packets")
52
     */
53
    private $packets;
54
55
    /**
56
     * @var string
57
     *
58
     * @JMS\Type("string")
59
     * @JMS\SerializedName("url")
60
     */
61
    private $url;
62
63
    /**
64
     * @var integer
65
     *
66
     * @JMS\Type("integer")
67
     * @JMS\SerializedName("txPower")
68
     */
69
    private $txPower;
70
71
    public function __construct(
72
        string $deviceType,
73
        ?string $proximity,
74
        ?int $major,
75
        ?int $minor,
76
        ?array $packets,
77
        ?string $url,
78
        ?int $txPower
79
    ) {
80
        $this->deviceType = $deviceType;
81
        $this->proximity = $proximity;
82
        $this->major = $major;
83
        $this->minor = $minor;
84
        if ($packets !== null && \count($packets) > 0) {
85
            $this->packets = \implode(',', $packets);
86
        }
87
        $this->url = $url;
88
        $this->txPower = $txPower;
89
    }
90
91
    public function deviceType(): string
92
    {
93
        return $this->deviceType;
94
    }
95
96
    public function proximity(): ?string
97
    {
98
        return $this->proximity;
99
    }
100
101
    public function major(): ?int
102
    {
103
        return $this->major;
104
    }
105
106
    public function minor(): ?int
107
    {
108
        return $this->minor;
109
    }
110
111
    public function packets(): ?array
112
    {
113
        if ($this->packets !== null) {
114
            return \explode(',', $this->packets);
115
        }
116
117
        return null;
118
    }
119
120
    public function url(): ?string
121
    {
122
        return $this->url;
123
    }
124
125
    public function txPower(): ?int
126
    {
127
        return $this->txPower;
128
    }
129
}
130