Completed
Push — master ( dc07f7...ef05ee )
by Eric
8s
created

AnalyzeEvent::response()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %
Metric Value
dl 4
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
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 AnalyzeEvent extends ResponseEvent
14
{
15
    /**
16
     * Creates an instance of AnalyzeEvent.
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) : AnalyzeEvent
32
    {
33
        $this->response = $response;
34
35
        return $this;
36
    }
37
}
38