Completed
Push — master ( 10a92d...cbdd73 )
by Łukasz
25:09 queued 19:28
created

RemoveCouponRequest::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace Sylius\ShopApiPlugin\Request;
4
5
use Sylius\ShopApiPlugin\Command\RemoveCoupon;
6
use Symfony\Component\HttpFoundation\Request;
7
8
final class RemoveCouponRequest
9
{
10
    /**
11
     * @var string
12
     */
13
    private $token;
14
15
    /**
16
     * @param Request $request
17
     */
18
    public function __construct(Request $request)
19
    {
20
        $this->token = $request->attributes->get('token');
21
    }
22
23
    /**
24
     * @return RemoveCoupon
25
     */
26
    public function getCommand()
27
    {
28
        return new RemoveCoupon($this->token);
29
    }
30
}
31