ClearCart   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 33
c 0
b 0
f 0
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A create() 0 4 1
A getCartId() 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 ClearCart
11
{
12
    /**
13
     * @var string
14
     */
15
    private $cartId;
16
17
    /**
18
     * @param string $cartId
19
     */
20
    private function __construct(string $cartId)
21
    {
22
        $this->cartId = $cartId;
23
    }
24
25
    /**
26
     * @param string $cartId
27
     *
28
     * @return ClearCart
29
     */
30
    public static function create(string $cartId): self
31
    {
32
        return new self($cartId);
33
    }
34
35
    /**
36
     * @return string
37
     */
38
    public function getCartId(): string
39
    {
40
        return $this->cartId;
41
    }
42
}
43