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

RemoveAddressRequest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 1
dl 0
loc 23
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getCommand() 0 4 1
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
}