AccessToken   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 54
Duplicated Lines 0 %

Test Coverage

Coverage 45.45%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 9
dl 0
loc 54
ccs 5
cts 11
cp 0.4545
rs 10
c 2
b 0
f 0
wmc 5

5 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
A getEmail() 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
    }
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
    /**
61
     * {@inheritDoc}
62
     */
63
    public function getEmail()
64
    {
65
        return null;
66
    }
67
}
68