SubscriptionItem   A
last analyzed

Complexity

Total Complexity 9

Size/Duplication

Total Lines 96
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 9
lcom 0
cbo 0
dl 0
loc 96
rs 10
c 0
b 0
f 0

9 Methods

Rating   Name   Duplication   Size   Complexity  
A getId() 0 4 1
A getSubscription() 0 4 1
A setSubscription() 0 4 1
A setQuantity() 0 4 1
A getQuantity() 0 4 1
A getUnitPrice() 0 4 1
A setUnitPrice() 0 4 1
A getTotal() 0 4 1
A setTotal() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace PH\Component\Subscription\Model;
6
7
class SubscriptionItem implements SubscriptionItemInterface
8
{
9
    /**
10
     * @var mixed
11
     */
12
    protected $id;
13
14
    /**
15
     * @var SubscriptionInterface
16
     */
17
    protected $subscription;
18
19
    /**
20
     * @var int
21
     */
22
    protected $quantity = 0;
23
24
    /**
25
     * @var int
26
     */
27
    protected $unitPrice = 0;
28
29
    /**
30
     * @var int
31
     */
32
    protected $total = 0;
33
34
    /**
35
     * {@inheritdoc}
36
     */
37
    public function getId()
38
    {
39
        return $this->id;
40
    }
41
42
    /**
43
     * {@inheritdoc}
44
     */
45
    public function getSubscription(): ?SubscriptionInterface
46
    {
47
        return $this->subscription;
48
    }
49
50
    /**
51
     * {@inheritdoc}
52
     */
53
    public function setSubscription(?SubscriptionInterface $subscription): void
54
    {
55
        $this->subscription = $subscription;
56
    }
57
58
    /**
59
     * {@inheritdoc}
60
     */
61
    public function setQuantity(int $quantity): void
62
    {
63
        $this->quantity = $quantity;
64
    }
65
66
    /**
67
     * {@inheritdoc}
68
     */
69
    public function getQuantity(): int
70
    {
71
        return $this->quantity;
72
    }
73
74
    /**
75
     * {@inheritdoc}
76
     */
77
    public function getUnitPrice(): int
78
    {
79
        return $this->unitPrice;
80
    }
81
82
    /**
83
     * {@inheritdoc}
84
     */
85
    public function setUnitPrice(int $unitPrice): void
86
    {
87
        $this->unitPrice = $unitPrice;
88
    }
89
90
    /**
91
     * {@inheritdoc}
92
     */
93
    public function getTotal(): int
94
    {
95
        return $this->total;
96
    }
97
98
    public function setTotal(int $total): void
99
    {
100
        $this->total = $total;
101
    }
102
}
103