Occurrence::getDate()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
namespace MrPrompt\ShipmentCommon\Base;
3
4
use DateTime;
5
6
/**
7
 * Occurrence
8
 *
9
 * @author Thiago Paes <[email protected]>
10
 */
11
class Occurrence
12
{
13
    /**
14
     * Insert ocurrence
15
     *
16
     * @const string
17
     */
18
    const INSERT = 'I';
19
20
    /**
21
     * Cancel occurrence
22
     *
23
     * @const string
24
     */
25
    const CANCEL = 'C';
26
27
    /**
28
     * Update occurrence
29
     *
30
     * @const string
31
     */
32
    const UPDATE = 'A';
33
34
    /**
35
     * Occurrence type
36
     *
37
     * @var string
38
     */
39
    private $type = self::INSERT;
40
41
    /**
42
     * Occurrence Return Code
43
     *
44
     * @var int
45
     */
46
    private $return = 0;
47
48
    /**
49
     * Occurrence Description
50
     *
51
     * @var string
52
     */
53
    private $description = '';
54
55
    /**
56
     * @var DateTime
57
     */
58
    private $date;
59
60 14
    public function __construct(
61
        string $type = self::INSERT,
62
        string $description = '',
63
        int $return = 0
64
    ) {
65 14
        $this->type = $type;
66 14
        $this->return = $return;
67 14
        $this->description = $description;
68 14
    }
69
70
    /**
71
     * @return string
72
     */
73 1
    public function getType(): string
74
    {
75 1
        return $this->type;
76
    }
77
78
    /**
79
     * @param string $type
80
     */
81 1
    public function setType(string $type)
82
    {
83 1
        $this->type = $type;
84 1
    }
85
86
    /**
87
     * @return int
88
     */
89 1
    public function getReturn(): int
90
    {
91 1
        return $this->return;
92
    }
93
94
    /**
95
     * @param int $return
96
     */
97 3
    public function setReturn(int $return = 0)
98
    {
99 3
        $this->return = $return;
100 3
    }
101
102
    /**
103
     * @return string
104
     */
105 1
    public function getDescription(): string
106
    {
107 1
        return $this->description;
108
    }
109
110
    /**
111
     * @param string $description
112
     */
113 3
    public function setDescription(string $description = '')
114
    {
115 3
        $this->description = $description;
116 3
    }
117
118
    /**
119
     * @return DateTime
120
     */
121 1
    public function getDate(): DateTime
122
    {
123 1
        return $this->date;
124
    }
125
126
    /**
127
     * @param DateTime $date
128
     */
129 1
    public function setDate(DateTime $date)
130
    {
131 1
        $this->date = $date;
132 1
    }
133
}
134