SocialNetworkConnectEvent   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 3
c 0
b 0
f 0
lcom 0
cbo 1
dl 0
loc 28
ccs 0
cts 14
cp 0
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A getUser() 0 4 1
A getAccount() 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\SocialNetworkAccount;
15
use Da\User\Model\User;
16
use yii\base\Event;
17
18
/**
19
 * @property-read User $user
20
 * @property-read SocialNetworkAccount $account
21
 */
22
class SocialNetworkConnectEvent extends Event
23
{
24
    const EVENT_BEFORE_CONNECT = 'beforeConnect';
25
    const EVENT_AFTER_CONNECT = 'afterConnect';
26
    const EVENT_BEFORE_DISCONNECT = 'beforeDisconnect';
27
    const EVENT_AFTER_DISCONNECT = 'afterDisconnect';
28
29
    protected $user;
30
    protected $account;
31
32
    public function __construct(User $user, SocialNetworkAccount $account, $config = [])
33
    {
34
        $this->user = $user;
35
        $this->account = $account;
36
37
        parent::__construct($config);
38
    }
39
40
    public function getUser()
41
    {
42
        return $this->user;
43
    }
44
45
    public function getAccount()
46
    {
47
        return $this->account;
48
    }
49
}
50