Code Duplication    Length = 40-41 lines in 2 locations

src/Command/PickupCart.php 1 location

@@ 9-49 (lines=41) @@
6
7
use Webmozart\Assert\Assert;
8
9
final class PickupCart
10
{
11
    /**
12
     * @var string
13
     */
14
    private $orderToken;
15
16
    /**
17
     * @var string
18
     */
19
    private $channelCode;
20
21
    /**
22
     * @param string $orderToken
23
     * @param string $channelCode
24
     */
25
    public function __construct($orderToken, $channelCode)
26
    {
27
        Assert::string($orderToken, 'Expected order token to be string, got %s');
28
        Assert::string($channelCode, 'Expected channel code to be string, got %s');
29
30
        $this->orderToken = $orderToken;
31
        $this->channelCode = $channelCode;
32
    }
33
34
    /**
35
     * @return string
36
     */
37
    public function orderToken()
38
    {
39
        return $this->orderToken;
40
    }
41
42
    /**
43
     * @return string
44
     */
45
    public function channelCode()
46
    {
47
        return $this->channelCode;
48
    }
49
}
50

src/Command/RemoveItemFromCart.php 1 location

@@ 9-48 (lines=40) @@
6
7
use Webmozart\Assert\Assert;
8
9
final class RemoveItemFromCart
10
{
11
    /**
12
     * @var string
13
     */
14
    private $orderToken;
15
16
    /**
17
     * @var mixed
18
     */
19
    private $itemIdentifier;
20
21
    /**
22
     * @param string $orderToken
23
     * @param mixed $itemIdentifier
24
     */
25
    public function __construct(string $orderToken, $itemIdentifier)
26
    {
27
        Assert::string($orderToken, 'Expected order token to be string, got %s');
28
29
        $this->orderToken = $orderToken;
30
        $this->itemIdentifier = $itemIdentifier;
31
    }
32
33
    /**
34
     * @return string
35
     */
36
    public function orderToken(): string
37
    {
38
        return $this->orderToken;
39
    }
40
41
    /**
42
     * @return mixed
43
     */
44
    public function itemIdentifier()
45
    {
46
        return $this->itemIdentifier;
47
    }
48
}
49