SocialNetworkAuthEvent::getAccount()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
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 yii\authclient\ClientInterface;
16
use yii\base\Event;
17
18
/**
19
 * @property-read SocialNetworkAccount $account
20
 * @property-read ClientInterface $client
21
 */
22
class SocialNetworkAuthEvent extends Event
23
{
24
    const EVENT_BEFORE_AUTHENTICATE = 'beforeAuthenticate';
25
    const EVENT_AFTER_AUTHENTICATE = 'afterAuthenticate';
26
    const EVENT_BEFORE_CONNECT = 'beforeConnect';
27
    const EVENT_AFTER_CONNECT = 'afterConnect';
28
29
    protected $client;
30
    protected $account;
31
32
    public function __construct(SocialNetworkAccount $account, ClientInterface $client, $config = [])
33
    {
34
        $this->account = $account;
35
        $this->client = $client;
36
37
        parent::__construct($config);
38
    }
39
40
    public function getClient()
41
    {
42
        return $this->client;
43
    }
44
45
    public function getAccount()
46
    {
47
        return $this->account;
48
    }
49
}
50