InitializeCart   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 49
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 0
dl 0
loc 49
c 0
b 0
f 0
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A create() 0 4 1
A getCartId() 0 4 1
A getCurrencyCode() 0 4 1
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