InitializeCart::getCartId()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace SyliusCart\Domain\Command;
6
7
use Ramsey\Uuid\UuidInterface;
8
9
/**
10
 * @author Arkadiusz Krakowiak <[email protected]>
11
 */
12
final class InitializeCart
13
{
14
    /**
15
     * @var UuidInterface
16
     */
17
    private $cartId;
18
19
    /**
20
     * @var string
21
     */
22
    private $currencyCode;
23
24
    /**
25
     * @param UuidInterface $cartId
26
     * @param string $currencyCode
27
     */
28
    private function __construct(UuidInterface $cartId, string $currencyCode)
29
    {
30
        $this->cartId = $cartId;
31
        $this->currencyCode = $currencyCode;
32
    }
33
34
    /**
35
     * @param UuidInterface $cartId
36
     * @param string $currencyCode
37
     *
38
     * @return InitializeCart
39
     */
40
    public static function create(UuidInterface $cartId, string $currencyCode): self
41
    {
42
        return new self($cartId, $currencyCode);
43
    }
44
45
    /**
46
     * @return UuidInterface
47
     */
48
    public function getCartId(): UuidInterface
49
    {
50
        return $this->cartId;
51
    }
52
53
    /**
54
     * @return string
55
     */
56
    public function getCurrencyCode(): string
57
    {
58
        return $this->currencyCode;
59
    }
60
}
61