CartDetail::getTotalPrice()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 1
cts 1
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Simara\Cart\Domain\Cart;
4
5
use Simara\Cart\Domain\Price;
6
7
final class CartDetail
8
{
9
    /**
10
     * @param ItemDetail[] $items
11
     */
12
    public function __construct(
13
        private array $items,
14
        private Price $totalPrice
15
    ) {
16
    }
17
18
    /**
19 17
     * @return ItemDetail[]
20
     */
21 17
    public function getItems(): array
22 17
    {
23 17
        return $this->items;
24
    }
25
26
    public function getTotalPrice(): Price
27
    {
28 1
        return $this->totalPrice;
29
    }
30
}
31