AccessToken   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 0
dl 0
loc 48
ccs 0
cts 17
cp 0
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getToken() 0 4 1
A getUserId() 0 4 1
A getExpires() 0 4 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\Provider\AccessTokenInterface;
10
11
class AccessToken implements AccessTokenInterface
12
{
13
    /**
14
     * OpenID does not have a $token, it response $identity, it's a link to user
15
     *
16
     * @var string
17
     */
18
    protected $identity;
19
20
    /**
21
     * @var integer|null
22
     */
23
    protected $uid;
24
25
    /**
26
     * @param string $identity
27
     * @param int|null $uid
28
     */
29
    public function __construct($identity, $uid = null)
30
    {
31
        $this->identity = $identity;
32
        $this->uid = $uid;
33
    }
34
35
    /**
36
     * {@inheritdoc}
37
     */
38
    public function getToken()
39
    {
40
        return $this->identity;
41
    }
42
43
    /**
44
     * {@inheritdoc}
45
     */
46
    public function getUserId()
47
    {
48
        return $this->uid;
49
    }
50
51
    /**
52
     * @return int|null
53
     */
54
    public function getExpires()
55
    {
56
        return null;
57
    }
58
}
59