Completed
Pull Request — master (#97)
by Paweł
03:09
created

CompleteOrder::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 10
rs 9.4285
cc 1
eloc 7
nc 1
nop 3
1
<?php
2
3
4
namespace Sylius\ShopApiPlugin\Command;
5
6
use Webmozart\Assert\Assert;
7
8
final class CompleteOrder
9
{
10
    /**
11
     * @var string
12
     */
13
    private $orderToken;
14
15
    /**
16
     * @var string
17
     */
18
    private $email;
19
20
    /**
21
     * @var null|string
22
     */
23
    private $notes;
24
25
    /**
26
     * @param string $orderToken
27
     * @param string $email
28
     * @param string|null $notes
29
     */
30
    public function __construct($orderToken, $email, $notes = null)
31
    {
32
        Assert::string($orderToken);
33
        Assert::string($email);
34
        Assert::nullOrString($notes);
35
36
        $this->orderToken = $orderToken;
37
        $this->email = $email;
38
        $this->notes = $notes;
39
    }
40
41
    /**
42
     * @return string
43
     */
44
    public function orderToken()
45
    {
46
        return $this->orderToken;
47
    }
48
49
    /**
50
     * @return string
51
     */
52
    public function email()
53
    {
54
        return $this->email;
55
    }
56
57
    /**
58
     * @return string|null
59
     */
60
    public function notes()
61
    {
62
        return $this->notes;
63
    }
64
}
65