AccessToken::getScope()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * sources.
4
 * Date: 14/08/15
5
 */
6
7
namespace Mailxpert\Authentication;
8
9
/**
10
 * Class AccessToken
11
 * @package Mailxpert\Authentication
12
 */
13
class AccessToken
14
{
15
    /**
16
     * @var string
17
     */
18
    private $accessToken;
19
20
    /**
21
     * @var string
22
     */
23
    private $refreshToken;
24
25
    /**
26
     * @var int
27
     */
28
    private $expiresAt;
29
30
    /**
31
     * @var int
32
     */
33
    private $refreshTokenExpiresAt;
34
35
    /**
36
     * @var string
37
     */
38
    private $scope;
39
40
    /**
41
     * AccessToken constructor.
42
     *
43
     * @param string      $accessToken
44
     * @param string      $refreshToken
45
     * @param int         $expiresAt
46
     * @param string|null $scope
47
     * @param int         $refreshTokenExpireAt
48
     */
49
    public function __construct($accessToken, $refreshToken, $expiresAt, $scope = null, $refreshTokenExpireAt = 0)
50
    {
51
        $this->accessToken = $accessToken;
52
        $this->refreshToken = $refreshToken;
53
        $this->expiresAt = (int) $expiresAt;
54
        $this->refreshTokenExpiresAt = (int) $refreshTokenExpireAt;
55
        $this->scope = $scope;
56
    }
57
58
    /**
59
     * @return string
60
     */
61
    public function __toString()
62
    {
63
        return (string) $this->getAccessToken();
64
    }
65
66
    /**
67
     * @return string
68
     */
69
    public function getAccessToken()
70
    {
71
        return $this->accessToken;
72
    }
73
74
    /**
75
     * @return string
76
     */
77
    public function getRefreshToken()
78
    {
79
        return $this->refreshToken;
80
    }
81
82
    /**
83
     * @return int
84
     */
85
    public function getExpiresAt()
86
    {
87
        return $this->expiresAt;
88
    }
89
90
    /**
91
     * @return int
92
     */
93
    public function getRefreshTokenExpiresAt()
94
    {
95
        return $this->refreshTokenExpiresAt;
96
    }
97
98
    /**
99
     * @return string
100
     */
101
    public function getScope()
102
    {
103
        return $this->scope;
104
    }
105
}
106