Destination   A
last analyzed

Complexity

Total Complexity 11

Size/Duplication

Total Lines 109
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

11 Methods

Rating   Name   Duplication   Size   Complexity  
A getAddress() 0 4 1
A setAddress() 0 4 1
A getLocation() 0 4 1
A setLocation() 0 4 1
A getNotes() 0 4 1
A setNotes() 0 4 1
A getMetadata() 0 4 1
A getTimeCreated() 0 4 1
A getTimeLastModified() 0 4 1
A update() 0 4 1
A delete() 0 4 1
1
<?php
2
3
namespace Anorgan\Onfleet;
4
5
/**
6
 * Class Destination
7
 * @package Anorgan\Onfleet
8
 */
9
class Destination extends Entity
10
{
11
    protected $address  = [];
12
    protected $location = [];
13
    protected $notes;
14
    protected $metadata = [];
15
    protected $timeCreated;
16
    protected $timeLastModified;
17
18
    protected $endpoint = 'destinations';
19
20
    protected static $properties = [
21
        'id',
22
        'address',
23
        'location',
24
        'notes',
25
        'metadata',
26
        'timeCreated',
27
        'timeLastModified',
28
    ];
29
30
    /**
31
     * @return array
32
     */
33
    public function getAddress(): array
34
    {
35
        return $this->address;
36
    }
37
38
    /**
39
     * @param array $address
40
     */
41
    public function setAddress(array $address)
42
    {
43
        $this->address = $address;
44
    }
45
46
    /**
47
     * @return array
48
     */
49
    public function getLocation(): array
50
    {
51
        return $this->location;
52
    }
53
54
    /**
55
     * @param array $location
56
     */
57
    public function setLocation(array $location)
58
    {
59
        $this->location = $location;
60
    }
61
62
    /**
63
     * @return string
64
     */
65
    public function getNotes(): string
66
    {
67
        return $this->notes;
68
    }
69
70
    /**
71
     * @param string $notes
72
     */
73
    public function setNotes($notes)
74
    {
75
        $this->notes = $notes;
76
    }
77
78
    /**
79
     * @return array
80
     */
81
    public function getMetadata(): array
82
    {
83
        return $this->metadata;
84
    }
85
86
    /**
87
     * @return \DateTime
88
     */
89
    public function getTimeCreated()
90
    {
91
        return $this->toDateTime($this->timeCreated);
92
    }
93
94
    /**
95
     * @return \DateTime
96
     */
97
    public function getTimeLastModified()
98
    {
99
        return $this->toDateTime($this->timeLastModified);
100
    }
101
102
    /**
103
     * @throws \BadMethodCallException
104
     */
105
    public function update()
106
    {
107
        throw new \BadMethodCallException('Destination can not be updated');
108
    }
109
110
    /**
111
     * @throws \BadMethodCallException
112
     */
113
    public function delete()
114
    {
115
        throw new \BadMethodCallException('Destination can not be deleted');
116
    }
117
}
118