Completed
Push — develop ( 1f3cb9...e63421 )
by Jens
12:06
created

Token::getToken()   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
Metric Value
dl 0
loc 4
ccs 0
cts 0
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 0
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 286
    /**
30
     * @var string
31 286
     */
32 286
    protected $scope;
33
34
    public function __construct($token = null, $ttl = null, $scope = null)
35
    {
36
        $this->setToken($token)->setTtl($ttl)->setScope($scope);
37 283
    }
38
39 283
    /**
40
     * @return string
41
     */
42
    public function getToken()
43
    {
44
        return $this->token;
45
    }
46 286
47
    /**
48 286
     * @param string $token
49
     * @return $this
50 286
     */
51
    public function setToken($token)
52
    {
53
        $this->token = $token;
54
55
        return $this;
56 1
    }
57
58 1
    /**
59
     * @return \DateTime
60
     */
61
    public function getValidTo()
62
    {
63
        return $this->validTo;
64
    }
65 3
66
    /**
67 3
     * @param \DateTime $validTo
68
     * @return $this
69 3
     */
70
    public function setValidTo(\DateTime $validTo)
71
    {
72
        $this->validTo = $validTo;
73
74
        return $this;
75 4
    }
76
77 4
    /**
78
     * @return int
79
     */
80
    public function getTtl()
81
    {
82
        return $this->ttl;
83 286
    }
84
85 286
    /**
86
     * @param int $ttl
87 286
     * @return $this
88
     */
89
    public function setTtl($ttl)
90
    {
91
        $this->ttl = $ttl;
92
93
        return $this;
94
    }
95
96
    /**
97
     * @return string
98
     */
99
    public function getScope()
100
    {
101
        return $this->scope;
102
    }
103
104
    /**
105
     * @param string $scope
106
     * @return $this
107
     */
108
    public function setScope($scope)
109
    {
110
        $this->scope = $scope;
111
112
        return $this;
113
114
    }
115
}
116