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

AnalyzeEvent   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A setResponse() 0 6 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