Completed
Push — develop ( 10a3f8...fe23c8 )
by Jens
10:24
created

Token::setRefreshToken()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 6
ccs 0
cts 0
cp 0
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
crap 2
1
<?php
2
/**
3
 * @author @jayS-de <[email protected]>
4
 * @created: 22.01.15, 11:41
5
 */
6
7
namespace Commercetools\Core\Client\OAuth;
8
9
/**
10
 * @package Commercetools\Core\OAuth
11
 */
12
class Token
13
{
14
    /**
15
     * @var string
16
     */
17
    protected $token;
18
19
    /**
20
     * @var \DateTime
21
     */
22
    protected $validTo;
23
24
    /**
25
     * @var int
26
     */
27
    protected $ttl;
28
29
    /**
30
     * @var string
31
     */
32
    protected $scope;
33
34 296
    /**
35
     * @var string
36 296
     */
37 296
    protected $refreshToken;
38
39
    public function __construct($token = null, $ttl = null, $scope = null)
40
    {
41
        $this->setToken($token)->setTtl($ttl)->setScope($scope);
42 294
    }
43
44 294
    /**
45
     * @return string
46
     */
47
    public function getToken()
48
    {
49
        return $this->token;
50
    }
51 296
52
    /**
53 296
     * @param string $token
54
     * @return $this
55 296
     */
56
    public function setToken($token)
57
    {
58
        $this->token = $token;
59
60
        return $this;
61 1
    }
62
63 1
    /**
64
     * @return \DateTime
65
     */
66
    public function getValidTo()
67
    {
68
        return $this->validTo;
69
    }
70 7
71
    /**
72 7
     * @param \DateTime $validTo
73
     * @return $this
74 7
     */
75
    public function setValidTo(\DateTime $validTo)
76
    {
77
        $this->validTo = $validTo;
78
79
        return $this;
80 7
    }
81
82 7
    /**
83
     * @return int
84
     */
85
    public function getTtl()
86
    {
87
        return $this->ttl;
88
    }
89 296
90
    /**
91 296
     * @param int $ttl
92
     * @return $this
93 296
     */
94
    public function setTtl($ttl)
95
    {
96
        $this->ttl = $ttl;
97
98
        return $this;
99 3
    }
100
101 3
    /**
102
     * @return string
103
     */
104
    public function getScope()
105
    {
106
        return $this->scope;
107
    }
108 296
109
    /**
110 296
     * @param string $scope
111
     * @return $this
112 296
     */
113
    public function setScope($scope)
114
    {
115
        $this->scope = $scope;
116
117
        return $this;
118
    }
119
120
    /**
121
     * @return string
122
     */
123
    public function getRefreshToken()
124
    {
125
        return $this->refreshToken;
126
    }
127
128
    /**
129
     * @param string $refreshToken
130
     * @return $this
131
     */
132
    public function setRefreshToken($refreshToken)
133
    {
134
        $this->refreshToken = $refreshToken;
135
136
        return $this;
137
    }
138
}
139