UserEvent   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 66.67%

Importance

Changes 0
Metric Value
wmc 2
c 0
b 0
f 0
lcom 0
cbo 1
dl 0
loc 36
ccs 4
cts 6
cp 0.6667
rs 10

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 UserEvent extends Event
21
{
22
    const EVENT_BEFORE_CREATE = 'beforeCreate';
23
    const EVENT_AFTER_CREATE = 'afterCreate';
24
    const EVENT_BEFORE_DELETE = 'beforeDelete';
25
    const EVENT_AFTER_DELETE = 'afterDelete';
26
    const EVENT_BEFORE_REGISTER = 'beforeRegister';
27
    const EVENT_AFTER_REGISTER = 'afterRegister';
28
    const EVENT_BEFORE_ACCOUNT_UPDATE = 'beforeAccountUpdate';
29
    const EVENT_AFTER_ACCOUNT_UPDATE = 'afterAccountUpdate';
30
    const EVENT_BEFORE_PROFILE_UPDATE = 'beforeProfileUpdate';
31
    const EVENT_AFTER_PROFILE_UPDATE = 'afterProfileUpdate';
32
    const EVENT_BEFORE_CONFIRMATION = 'beforeConfirmation';
33
    const EVENT_AFTER_CONFIRMATION = 'afterConfirmation';
34
    const EVENT_BEFORE_UNBLOCK = 'beforeUnblock';
35
    const EVENT_AFTER_UNBLOCK = 'afterUnblock';
36
    const EVENT_BEFORE_BLOCK = 'beforeBlock';
37
    const EVENT_AFTER_BLOCK = 'afterBlock';
38
    const EVENT_BEFORE_LOGOUT = 'beforeLogout';
39
    const EVENT_AFTER_LOGOUT = 'afterLogout';
40
    const EVENT_BEFORE_SWITCH_IDENTITY = 'beforeSwitchIdentity';
41
    const EVENT_AFTER_SWITCH_IDENTITY = 'afterSwitchIdentity';
42
43
    protected $user;
44
45 10
    public function __construct(User $user, array $config = [])
46
    {
47 10
        $this->user = $user;
48 10
        parent::__construct($config);
49 10
    }
50
51
    public function getUser()
52
    {
53
        return $this->user;
54
    }
55
}
56