Completed
Push — master ( b7a3de...2fd7f6 )
by Дмитрий
04:56
created

AccessToken   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 31
ccs 0
cts 12
cp 0
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getToken() 0 4 1
A getUserId() 0 5 1
1
<?php
2
/**
3
 * SocialConnect project
4
 * @author: Patsura Dmitry https://github.com/ovr <[email protected]>
5
 */
6
7
namespace SocialConnect\OpenID;
8
9
use SocialConnect\Auth\AccessTokenInterface;
10
11
class AccessToken implements AccessTokenInterface
12
{
13
    /**
14
     * OpenID doesnot have a $token, it response $identity, it's a link to user
15
     *
16
     * @var string
17
     */
18
    protected $identity;
19
20
    public function __construct($identity)
21
    {
22
        $this->identity = $identity;
23
    }
24
25
    /**
26
     * {@inheritdoc}
27
     */
28
    public function getToken()
29
    {
30
        return $this->identity;
31
    }
32
33
    /**
34
     * {@inheritdoc}
35
     */
36
    public function getUserId()
37
    {
38
        // not supported for OpenId
39
        return null;
40
    }
41
}
42