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

SetDefaultAddressRequest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

2 Methods

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