AccessToken::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 2
dl 0
loc 4
rs 10
c 0
b 0
f 0
ccs 3
cts 3
cp 1
crap 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