UserEvent   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
c 0
b 0
f 0
lcom 0
cbo 1
dl 0
loc 21
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getUser() 0 4 1
A getRequest() 0 4 1
1
<?php
2
3
namespace Alpixel\Bundle\UserBundle\Event;
4
5
use Alpixel\Bundle\UserBundle\Entity\User;
6
use Symfony\Component\EventDispatcher\Event;
7
use Symfony\Component\HttpFoundation\Request;
8
9
class UserEvent extends Event
10
{
11
    protected $user;
12
    protected $request;
13
14
    public function __construct(User $user, 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...
15
    {
16
        $this->user = $user;
17
        $this->request = $request;
18
    }
19
20
    public function getUser()
21
    {
22
        return $this->user;
23
    }
24
25
    public function getRequest()
26
    {
27
        return $this->request;
28
    }
29
}
30