Completed
Pull Request — master (#39)
by Eric
02:17
created

AnalyzeEvent::setResponse()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
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, Response};
8
9
/**
10
 * @author Eric Chau <[email protected]>
11
 */
12
class AnalyzeEvent extends ResponseEvent
13
{
14
    /**
15
     * Creates an instance of AnalyzeEvent.
16
     *
17
     * @param Request $request
18
     */
19
    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...
20
    {
21
        $this->request = $request;
22
    }
23
24
    /**
25
     * @codeCoverageIgnore
26
     *
27
     * @param  Response $response
28
     * @return self
29
     */
30
    public function setResponse(Response $response) : AnalyzeEvent
31
    {
32
        $this->response = $response;
33
34
        return $this;
35
    }
36
}
37