Completed
Push — master ( 14deb8...09c050 )
by Eric
8s
created

RunEvent::setResponse()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 6
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace Jarvis\Skill\EventBroadcaster;
6
7
use Symfony\Component\HttpFoundation\Request;
8
use Symfony\Component\HttpFoundation\Response;
9
10
/**
11
 * @author Eric Chau <[email protected]>
12
 */
13
class RunEvent extends ResponseEvent
14
{
15
    /**
16
     * Creates an instance of RunEvent.
17
     *
18
     * @param Request $request
19
     */
20
    public function __construct(Request $request)
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->request = $request;
23
    }
24
25
    /**
26
     * @codeCoverageIgnore
27
     *
28
     * @param  Response $response
29
     * @return self
30
     */
31
    public function setResponse(Response $response): RunEvent
32
    {
33
        $this->response = $response;
34
35
        return $this;
36
    }
37
}
38