Device   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 63
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 6
lcom 0
cbo 0
dl 0
loc 63
rs 10
c 0
b 0
f 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A jsonSerialize() 0 4 1
A getDeviceId() 0 4 1
A setDeviceId() 0 6 1
A getIpAddress() 0 4 1
A setIpAddress() 0 6 1
1
<?php
2
namespace Getnet\API;
3
4
/**
5
 * Class Device
6
 *
7
 * @package Getnet\API
8
 */
9
class Device implements \JsonSerializable
10
{
11
    /** @var */
12
    private $device_id;
13
14
    /** @var */
15
    private $ip_address;
16
17
    /**
18
     * Device constructor.
19
     * @param $device_id
20
     */
21
    public function __construct($device_id)
22
    {
23
        $this->device_id = $device_id;
24
    }
25
26
    /**
27
     * @return array|mixed
28
     */
29
    public function jsonSerialize()
30
    {
31
        return get_object_vars($this);
32
    }
33
34
    /**
35
     * @return mixed
36
     */
37
    public function getDeviceId()
38
    {
39
        return $this->device_id;
40
    }
41
42
    /**
43
     * @param $device_id
44
     * @return $this
45
     */
46
    public function setDeviceId($device_id)
47
    {
48
        $this->device_id = (string)$device_id;
49
50
        return $this;
51
    }
52
53
    /**
54
     * @return mixed
55
     */
56
    public function getIpAddress()
57
    {
58
        return $this->ip_address;
59
    }
60
61
    /**
62
     * @param $ip_address
63
     * @return $this
64
     */
65
    public function setIpAddress($ip_address)
66
    {
67
        $this->ip_address = (string)$ip_address;
68
69
        return $this;
70
    }
71
}
72