Completed
Push — master ( 6d6774...64f3ed )
by Jeroen
11:23 queued 05:13
created

AbstractVoteEvent   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 53
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 1
dl 0
loc 53
ccs 11
cts 11
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getRequest() 0 4 1
A getReference() 0 4 1
A getValue() 0 4 1
1
<?php
2
3
namespace Kunstmaan\VotingBundle\Event;
4
5
use Symfony\Component\EventDispatcher\Event;
6
use Symfony\Component\HttpFoundation\Request;
7
8
abstract class AbstractVoteEvent extends Event implements EventInterface
0 ignored issues
show
Deprecated Code introduced by
The class Symfony\Component\EventDispatcher\Event has been deprecated with message: since Symfony 4.3, use "Symfony\Contracts\EventDispatcher\Event" instead

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
9
{
10
    /**
11
     * @var Request
12
     */
13
    protected $request;
14
15
    /**
16
     * @var string
17
     */
18
    protected $reference;
19
20
    /**
21
     * @var int
22
     */
23
    protected $value;
24
25
    /**
26
     * @param Request $request
27
     * @param string  $reference
28
     * @param int     $value
29
     */
30 8
    public function __construct(Request $request, $reference, $value)
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...
31
    {
32 8
        $this->request = $request;
33 8
        $this->reference = $reference;
34 8
        $this->value = $value;
35 8
    }
36
37
    /**
38
     * @return Request
39
     */
40 8
    public function getRequest()
41
    {
42 8
        return $this->request;
43
    }
44
45
    /**
46
     * @return string
47
     */
48 8
    public function getReference()
49
    {
50 8
        return $this->reference;
51
    }
52
53
    /**
54
     * @return int
55
     */
56 5
    public function getValue()
57
    {
58 5
        return $this->value;
59
    }
60
}
61