Completed
Pull Request — master (#361)
by
unknown
03:09
created

SessionEvent   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 18
ccs 0
cts 9
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getUser() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of the 2amigos/yii2-usuario project.
5
 *
6
 * (c) 2amigOS! <http://2amigos.us/>
7
 *
8
 * For the full copyright and license information, please view
9
 * the LICENSE file that was distributed with this source code.
10
 */
11
12
namespace Da\User\Event;
13
14
use Da\User\Model\User;
15
use yii\base\Event;
16
17
/**
18
 * @property-read User $user
19
 */
20
class SessionEvent extends Event
21
{
22
    const EVENT_BEFORE_TERMINATE_USER_SESSIONS = 'beforeTerminateUserSessions';
23
    const EVENT_AFTER_TERMINATE_USER_SESSIONS = 'afterTerminateUserSessions';
24
25
    protected $user;
26
27
    public function __construct(User $user, array $config = [])
28
    {
29
        $this->user = $user;
30
        parent::__construct($config);
31
    }
32
33
    public function getUser()
34
    {
35
        return $this->user;
36
    }
37
}
38