UserEvent   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

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
/*
4
 * This file is part of the awurth/silex-user package.
5
 *
6
 * (c) Alexis Wurth <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace AWurth\Silex\User\Event;
13
14
use AWurth\Silex\User\Model\UserInterface;
15
use Symfony\Component\EventDispatcher\Event;
16
use Symfony\Component\HttpFoundation\Request;
17
18
class UserEvent extends Event
19
{
20
    /**
21
     * @var Request|null
22
     */
23
    private $request;
24
25
    /**
26
     * @var UserInterface
27
     */
28
    private $user;
29
30
    /**
31
     * Constructor.
32
     *
33
     * @param UserInterface $user
34
     * @param Request|null  $request
35
     */
36
    public function __construct(UserInterface $user, Request $request = null)
37
    {
38
        $this->user = $user;
39
        $this->request = $request;
40
    }
41
42
    /**
43
     * @return UserInterface
44
     */
45
    public function getUser()
46
    {
47
        return $this->user;
48
    }
49
50
    /**
51
     * @return Request|null
52
     */
53
    public function getRequest()
54
    {
55
        return $this->request;
56
    }
57
}
58