Completed
Push — master ( 483eda...cb59ac )
by Дмитрий
03:04
created

AccessToken::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 10
rs 9.4285
cc 2
eloc 5
nc 2
nop 1
1
<?php
2
/**
3
 * SocialConnect project
4
 * @author: Patsura Dmitry https://github.com/ovr <[email protected]>
5
 */
6
7
namespace SocialConnect\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
    public function __construct($token)
27
    {
28
        if (!is_string($token)) {
29
            throw new InvalidArgumentException(
30
                '$token must be a string, passed: ' . gettype($token)
31
            );
32
        }
33
34
        $this->token = $token;
35
    }
36
37
    /**
38
     * @return string
39
     */
40
    public function getToken()
41
    {
42
        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