AccessToken   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Test Coverage

Coverage 60%

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getToken() 0 3 1
A __construct() 0 4 1
A getExpires() 0 3 1
A getUserId() 0 3 1
1
<?php
2
/**
3
 * SocialConnect project
4
 * @author: Patsura Dmitry https://github.com/ovr <[email protected]>
5
 */
6
declare(strict_types=1);
7
8
namespace SocialConnect\OpenID;
9
10
use SocialConnect\Provider\AccessTokenInterface;
11
12
class AccessToken implements AccessTokenInterface
13
{
14
    /**
15
     * OpenID does not have a $token, it response $identity, it's a link to user
16
     *
17
     * @var string
18
     */
19
    protected $identity;
20
21
    /**
22
     * @var string|null
23
     */
24
    protected $uid;
25
26
    /**
27
     * @param string $identity
28
     * @param string|null $uid
29
     */
30 1
    public function __construct($identity, string $uid = null)
31
    {
32 1
        $this->identity = $identity;
33 1
        $this->uid = $uid;
34 1
    }
35
36
    /**
37
     * {@inheritdoc}
38
     */
39
    public function getToken()
40
    {
41
        return $this->identity;
42
    }
43
44
    /**
45
     * {@inheritdoc}
46
     */
47 1
    public function getUserId()
48
    {
49 1
        return $this->uid;
50
    }
51
52
    /**
53
     * @return int|null
54
     */
55
    public function getExpires()
56
    {
57
        return null;
58
    }
59
}
60