Completed
Pull Request — master (#2737)
by
unknown
08:55
created

ChangePasswordSuccessEvent::setResponse()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 4
Ratio 100 %

Importance

Changes 0
Metric Value
dl 4
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace Kunstmaan\AdminBundle\Event;
4
5
use Kunstmaan\AdminBundle\Entity\UserInterface;
6
use Symfony\Component\HttpFoundation\Request;
7
use Symfony\Component\HttpFoundation\Response;
8
9 View Code Duplication
final class ChangePasswordSuccessEvent extends BcEvent
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
10
{
11
    /** @var Request */
12
    private $request;
13
14
    /** @var UserInterface */
15
    private $user;
16
17
    /** @var Response */
18
    private $response;
19
20
    public function __construct(UserInterface $user, Request $request, Response $response)
0 ignored issues
show
Bug introduced by
You have injected the Request via parameter $request. This is generally not recommended as there might be multiple instances during a request cycle (f.e. when using sub-requests). Instead, it is recommended to inject the RequestStack and retrieve the current request each time you need it via getCurrentRequest().
Loading history...
21
    {
22
        $this->user = $user;
23
        $this->request = $request;
24
        $this->response = $response;
25
    }
26
27
    public function getUser(): UserInterface
28
    {
29
        return $this->user;
30
    }
31
32
    public function getRequest(): Request
33
    {
34
        return $this->request;
35
    }
36
37
    public function getResponse(): Response
38
    {
39
        return $this->response;
40
    }
41
42
    public function setResponse(Response $response)
43
    {
44
        $this->response = $response;
45
    }
46
}
47