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

SetDefaultAddressRequest::__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
declare(strict_types=1);
4
5
namespace Sylius\ShopApiPlugin\Request;
6
7
use Sylius\ShopApiPlugin\Command\SetDefaultAddress;
8
use Symfony\Component\HttpFoundation\Request;
9
10
final class SetDefaultAddressRequest
11
{
12
    /**
13
     * @var mixed
14
     */
15
    private $id;
16
17
    public function __construct(Request $request)
18
    {
19
        $this->id = $request->attributes->get('id');
20
    }
21
22
    /**
23
     * @return SetDefaultAddress
24
     */
25
    public function getCommand()
26
    {
27
        return new SetDefaultAddress($this->id);
28
    }
29
}
30