Test Failed
Pull Request — master (#7)
by Svaťa
05:11
created

ItemDetail   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 28
rs 10
c 0
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getAmount() 0 3 1
A getPrice() 0 3 1
A getProductId() 0 3 1
A __construct() 0 5 1
1
<?php
2
3
namespace Simara\Cart\Domain\Cart;
4
5
use Simara\Cart\Domain\Price;
6
7
class ItemDetail
8
{
9
    private string $productId;
10
11
    private Price $price;
12
13
    private int $amount;
14
15
    public function __construct(string $productId, Price $price, int $amount)
16
    {
17
        $this->productId = $productId;
18
        $this->amount = $amount;
19
        $this->price = $price;
20
    }
21
22
    public function getProductId(): string
23
    {
24
        return $this->productId;
25
    }
26
27
    public function getAmount(): int
28
    {
29
        return $this->amount;
30
    }
31
32
    public function getPrice(): Price
33
	{
34
        return $this->price;
35
    }
36
}
37