RemoveProductFromCart   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 getProductCode() 0 4 1
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace SyliusCart\Domain\Command;
6
7
/**
8
 * @author Arkadiusz Krakowiak <[email protected]>
9
 */
10
final class RemoveProductFromCart
11
{
12
    /**
13
     * @var string
14
     */
15
    private $cartId;
16
17
    /**
18
     * @var string
19
     */
20
    private $productCode;
21
22
    /**
23
     * @param string $cartId
24
     * @param string $productCode
25
     */
26
    private function __construct(string $cartId, string $productCode)
27
    {
28
        $this->cartId = $cartId;
29
        $this->productCode = $productCode;
30
    }
31
32
    /**
33
     * @param string $cartId
34
     * @param string $productCode
35
     *
36
     * @return self
37
     */
38
    public static function create(string $cartId, string $productCode): self
39
    {
40
        return new self($cartId, $productCode);
41
    }
42
43
    /**
44
     * @return string
45
     */
46
    public function getCartId(): string
47
    {
48
        return $this->cartId;
49
    }
50
51
    /**
52
     * @return string
53
     */
54
    public function getProductCode(): string
55
    {
56
        return $this->productCode;
57
    }
58
}
59