ItemDetail   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Test Coverage

Coverage 62.5%

Importance

Changes 0
Metric Value
eloc 4
c 0
b 0
f 0
dl 0
loc 22
rs 10
ccs 5
cts 8
cp 0.625
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
final class ItemDetail
8
{
9
    public function __construct(
10
        private string $productId,
11
        private Price $price,
12
        private int $amount
13
    ) {
14
    }
15 17
16
    public function getProductId(): string
17 17
    {
18 17
        return $this->productId;
19 17
    }
20 17
21
    public function getAmount(): int
22
    {
23
        return $this->amount;
24
    }
25
26
    public function getPrice(): Price
27
    {
28
        return $this->price;
29
    }
30
}
31