Failed Conditions
Pull Request — master (#229)
by
unknown
02:57
created

RemoveAddressRequest::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\Component\User\Model\UserInterface;
6
use Sylius\ShopApiPlugin\Command\RemoveAddress;
7
use Symfony\Component\HttpFoundation\Request;
8
9
class RemoveAddressRequest
10
{
11
    /**
12
     * @var mixed
13
     */
14
    private $id;
15
16
    /**
17
     * @var UserInterface
18
     */
19
    private $user;
20
21
    public function __construct(Request $request, UserInterface $user)
22
    {
23
        $this->id = $request->attributes->get('id');
24
        $this->user = $user;
25
    }
26
27
    public function getCommand()
28
    {
29
        return new RemoveAddress($this->id, $this->user);
30
    }
31
}