Completed
Pull Request — master (#290)
by
unknown
41:51
created

CompleteOrder   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 57
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

4 Methods

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