Completed
Push — master ( 72845a...993abf )
by Дмитрий
04:36 queued 02:07
created

AccessToken::getUid()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
/**
3
 * SocialConnect project
4
 * @author: Patsura Dmitry https://github.com/ovr <[email protected]>
5
 */
6
7
namespace SocialConnect\Auth\Provider\OAuth2;
8
9
use InvalidArgumentException;
10
11
class AccessToken
12
{
13
    /**
14
     * @var string
15
     */
16
    protected $token;
17
18
    /**
19
     * @var integer|null
20
     */
21
    protected $uid;
22
23
    /**
24
     * @param string $token
25
     */
26 4
    public function __construct($token)
27
    {
28 4
        if (!is_string($token)) {
29 1
            throw new InvalidArgumentException(
30 1
                '$token must be a string, passed: ' . gettype($token)
31 1
            );
32
        }
33
34 3
        $this->token = $token;
35 3
    }
36
37
    /**
38
     * @return string
39
     */
40 3
    public function getToken()
41
    {
42 3
        return $this->token;
43
    }
44
45
    /**
46
     * @return int|null
47
     */
48
    public function getUid()
49
    {
50
        return $this->uid;
51
    }
52
53
    /**
54
     * @param int|null $uid
55
     */
56
    public function setUid($uid)
57
    {
58
        $this->uid = $uid;
59
    }
60
}
61