Completed
Pull Request — master (#571)
by Rafał
12:29
created

Plan   A

Complexity

Total Complexity 14

Size/Duplication

Total Lines 151
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 14
lcom 0
cbo 3
dl 0
loc 151
rs 10
c 0
b 0
f 0

14 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getId() 0 4 1
A getCode() 0 4 1
A setCode() 0 4 1
A getName() 0 4 1
A setName() 0 4 1
A getAmount() 0 4 1
A setAmount() 0 4 1
A getInterval() 0 4 1
A setInterval() 0 4 1
A getIntervalCount() 0 4 1
A setIntervalCount() 0 4 1
A getCurrency() 0 4 1
A setCurrency() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SWP\Component\Plan\Model;
6
7
use SWP\Component\Common\Model\EnableableTrait;
8
use SWP\Component\Common\Model\SoftDeletableTrait;
9
use SWP\Component\Common\Model\TimestampableTrait;
10
11
class Plan implements PlanInterface
12
{
13
    use EnableableTrait, TimestampableTrait, SoftDeletableTrait;
14
15
    /**
16
     * @var mixed|null
17
     */
18
    protected $id;
19
20
    /**
21
     * @var string|null
22
     */
23
    protected $code;
24
25
    /**
26
     * @var string|null
27
     */
28
    protected $name;
29
30
    /**
31
     * @var int
32
     */
33
    protected $amount = 0;
34
35
    /**
36
     * @var string
37
     */
38
    protected $interval = PlanInterface::INTERVAL_MONTH;
39
40
    /**
41
     * @var int
42
     */
43
    protected $intervalCount = 1;
44
45
    /**
46
     * @var string|null
47
     */
48
    protected $currency;
49
50
    /**
51
     * Plan constructor.
52
     */
53
    public function __construct()
54
    {
55
        $this->createdAt = new \DateTime();
56
    }
57
58
    /**
59
     * {@inheritdoc}
60
     */
61
    public function getId()
62
    {
63
        return $this->id;
64
    }
65
66
    /**
67
     * {@inheritdoc}
68
     */
69
    public function getCode(): ?string
70
    {
71
        return $this->code;
72
    }
73
74
    /**
75
     * {@inheritdoc}
76
     */
77
    public function setCode(?string $code): void
78
    {
79
        $this->code = $code;
80
    }
81
82
    /**
83
     * {@inheritdoc}
84
     */
85
    public function getName(): ?string
86
    {
87
        return $this->name;
88
    }
89
90
    /**
91
     * {@inheritdoc}
92
     */
93
    public function setName(?string $name): void
94
    {
95
        $this->name = $name;
96
    }
97
98
    /**
99
     * {@inheritdoc}
100
     */
101
    public function getAmount(): int
102
    {
103
        return $this->amount;
104
    }
105
106
    /**
107
     * {@inheritdoc}
108
     */
109
    public function setAmount(int $amount): void
110
    {
111
        $this->amount = $amount;
112
    }
113
114
    /**
115
     * {@inheritdoc}
116
     */
117
    public function getInterval(): string
118
    {
119
        return $this->interval;
120
    }
121
122
    /**
123
     * {@inheritdoc}
124
     */
125
    public function setInterval(string $interval): void
126
    {
127
        $this->interval = $interval;
128
    }
129
130
    /**
131
     * {@inheritdoc}
132
     */
133
    public function getIntervalCount(): int
134
    {
135
        return $this->intervalCount;
136
    }
137
138
    /**
139
     * {@inheritdoc}
140
     */
141
    public function setIntervalCount(int $intervalCount): void
142
    {
143
        $this->intervalCount = $intervalCount;
144
    }
145
146
    /**
147
     * {@inheritdoc}
148
     */
149
    public function getCurrency(): ?string
150
    {
151
        return $this->currency;
152
    }
153
154
    /**
155
     * {@inheritdoc}
156
     */
157
    public function setCurrency(?string $currency): void
158
    {
159
        $this->currency = $currency;
160
    }
161
}
162