Total Complexity | 7 |
Total Lines | 92 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
8 | class Token implements TokenInterface |
||
9 | { |
||
10 | /** |
||
11 | * @var string |
||
12 | */ |
||
13 | protected $tokenType; |
||
14 | |||
15 | /** |
||
16 | * @var string |
||
17 | */ |
||
18 | protected $accessToken; |
||
19 | |||
20 | /** |
||
21 | * @var string |
||
22 | */ |
||
23 | protected $refreshToken; |
||
24 | |||
25 | /** |
||
26 | * @var string |
||
27 | */ |
||
28 | protected $instanceUrl; |
||
29 | |||
30 | /** |
||
31 | * @param string $tokenType |
||
32 | * @param string $accessToken |
||
33 | * @param string $instanceUrl |
||
34 | * @param string $refreshToken |
||
35 | */ |
||
36 | 3 | public function __construct(string $tokenType, string $accessToken, string $instanceUrl, string $refreshToken = '') |
|
37 | { |
||
38 | 3 | $this->tokenType = $tokenType; |
|
39 | 3 | $this->accessToken = $accessToken; |
|
40 | 3 | $this->refreshToken = $refreshToken; |
|
41 | 3 | $this->instanceUrl = $instanceUrl; |
|
42 | 3 | } |
|
43 | |||
44 | /** |
||
45 | * {@inheritdoc} |
||
46 | */ |
||
47 | 1 | public function getTokenType(): string |
|
48 | { |
||
49 | 1 | return $this->tokenType; |
|
50 | } |
||
51 | |||
52 | /** |
||
53 | * {@inheritdoc} |
||
54 | */ |
||
55 | 1 | public function getAccessToken(): string |
|
58 | } |
||
59 | |||
60 | /** |
||
61 | * {@inheritdoc} |
||
62 | */ |
||
63 | 1 | public function getRefreshToken(): string |
|
64 | { |
||
65 | 1 | return $this->refreshToken; |
|
66 | } |
||
67 | |||
68 | /** |
||
69 | * {@inheritdoc} |
||
70 | */ |
||
71 | 1 | public function getInstanceUrl(): string |
|
74 | } |
||
75 | |||
76 | /** |
||
77 | * {@inheritdoc} |
||
78 | */ |
||
79 | 1 | public function serialize(): string |
|
80 | { |
||
81 | 1 | return serialize([ |
|
82 | 1 | $this->tokenType, |
|
83 | 1 | $this->accessToken, |
|
84 | 1 | $this->instanceUrl, |
|
85 | 1 | $this->refreshToken, |
|
86 | ]); |
||
87 | } |
||
88 | |||
89 | /** |
||
90 | * {@inheritdoc} |
||
91 | */ |
||
92 | 1 | public function unserialize($serialized) |
|
100 | 1 | } |
|
101 | } |
||
102 |