Failed Conditions
Pull Request — master (#29)
by Yo
04:56 queued 01:32
created

BeforeRequestEvent::getName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 4
rs 10
c 1
b 0
f 0
ccs 0
cts 4
cp 0
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
namespace Yoanm\Behat3SymfonyExtension\Event;
3
4
use Symfony\Component\HttpFoundation\Request;
5
6
class BeforeRequestEvent extends Event
7
{
8
    /** @var Request */
9
    private $request;
10
    /** @var string */
11
    private $name;
0 ignored issues
show
Comprehensibility introduced by
Consider using a different property name as you override a private property of the parent class.
Loading history...
12
13
    /**
14
     * @param Request $request
15
     */
16
    public function __construct($request)
1 ignored issue
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...
17
    {
18
        $this->request = $request;
19
    }
20
21
    /**
22
     * @return Request
23
     */
24
    public function getRequest()
25
    {
26
        return $this->request;
27
    }
28
29
    /**
30
     * @param string $name
31
     */
32
    public function setName($name)
33
    {
34
        $this->name = $name;
35
    }
36
37
    /**
38
     * @return string
39
     */
40
    public function getName()
41
    {
42
        return $this->name;
43
    }
44
}
45