Completed
Branch master (9d8d38)
by Łukasz
03:25
created

AddCoupon   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 39
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A orderToken() 0 4 1
A couponCode() 0 4 1
1
<?php
2
3
namespace Sylius\ShopApiPlugin\Command;
4
5
use Webmozart\Assert\Assert;
6
7
final class AddCoupon
8
{
9
    /**
10
     * @var string
11
     */
12
    private $orderToken;
13
14
    /**
15
     * @var string
16
     */
17
    private $couponCode;
18
19
    /**
20
     * @param string $orderToken
21
     * @param string $couponCode
22
     */
23
    public function __construct($orderToken, $couponCode)
24
    {
25
        Assert::allString([$orderToken, $couponCode]);
26
        $this->orderToken = $orderToken;
27
        $this->couponCode = $couponCode;
28
    }
29
30
    /**
31
     * @return string
32
     */
33
    public function orderToken()
34
    {
35
        return $this->orderToken;
36
    }
37
38
    /**
39
     * @return string
40
     */
41
    public function couponCode()
42
    {
43
        return $this->couponCode;
44
    }
45
}
46