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

UpdateAddressAction   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 11 1
A __invoke() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Sylius\ShopApiPlugin\Controller\AddressBook;
6
7
use FOS\RestBundle\View\View;
8
use FOS\RestBundle\View\ViewHandlerInterface;
9
use JMS\Serializer\SerializerInterface;
10
use Symfony\Component\HttpFoundation\Request;
11
use Symfony\Component\HttpFoundation\Response;
12
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
13
use Symfony\Component\Validator\Validator\ValidatorInterface;
14
15
class UpdateAddressAction
16
{
17
    /**
18
     * @var ViewHandlerInterface
19
     */
20
    private $viewHandler;
21
22
    /**
23
     * @var TokenStorageInterface
24
     */
25
    private $tokenStorage;
26
27
    /**
28
     * @var ValidatorInterface
29
     */
30
    private $validator;
31
32
    /**
33
     * @var SerializerInterface
34
     */
35
    private $serializer;
36
37
    /**
38
     * @param ViewHandlerInterface $viewHandler
39
     * @param TokenStorageInterface $tokenStorage
40
     * @param ValidatorInterface $validator
41
     * @param SerializerInterface $serializer
42
     */
43
    public function __construct(
44
        ViewHandlerInterface $viewHandler,
45
        TokenStorageInterface $tokenStorage,
46
        ValidatorInterface $validator,
47
        SerializerInterface $serializer
48
    ) {
49
        $this->viewHandler = $viewHandler;
50
        $this->tokenStorage = $tokenStorage;
51
        $this->validator = $validator;
52
        $this->serializer = $serializer;
53
    }
54
55
    public function __invoke(Request $request): Response
56
    {
57
        return $this->viewHandler->handle(View::create([], Response::HTTP_OK));
58
    }
59
}
60