AccessToken   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 8
c 2
b 0
f 0
dl 0
loc 46
ccs 0
cts 16
cp 0
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getExpires() 0 3 1
A getToken() 0 3 1
A __construct() 0 4 1
A getUserId() 0 3 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