Completed
Push — master ( 6ad5a2...634c9e )
by Łukasz
12s
created

RemoveItemFromCartRequest::getCommand()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

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