Completed
Pull Request — master (#290)
by
unknown
36:49 queued 34:03
created

RemoveCouponRequest::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

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