AccessToken::setToken()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
/**
3
 * Slince shipment tracker library
4
 * @author Tao <[email protected]>
5
 */
6
namespace Slince\ShipmentTracking\DHLECommerce;
7
8
final class AccessToken
9
{
10
    /**
11
     * @var string
12
     */
13
    protected $token;
14
15
    /**
16
     * @var int
17
     */
18
    protected $expiresIn;
19
20
    /**
21
     * @var string
22
     */
23
    protected $type;
24
25
    public function __construct($token, $type = null, $expiresIn = null)
26
    {
27
        $this->token = $token;
28
        $this->type = $type;
29
        $this->expiresIn = $expiresIn;
30
    }
31
32
    public function __toString()
33
    {
34
        return $this->token;
35
    }
36
37
    /**
38
     * @return string
39
     */
40
    public function getToken()
41
    {
42
        return $this->token;
43
    }
44
45
    /**
46
     * @param string $token
47
     * @return AccessToken
48
     */
49
    public function setToken($token)
50
    {
51
        $this->token = $token;
52
        return $this;
53
    }
54
55
    /**
56
     * @return int
57
     */
58
    public function getExpiresIn()
59
    {
60
        return $this->expiresIn;
61
    }
62
63
    /**
64
     * @param int $expiresIn
65
     * @return AccessToken
66
     */
67
    public function setExpiresIn($expiresIn)
68
    {
69
        $this->expiresIn = $expiresIn;
70
        return $this;
71
    }
72
73
    /**
74
     * @return string
75
     */
76
    public function getType()
77
    {
78
        return $this->type;
79
    }
80
81
    /**
82
     * @param string $type
83
     * @return AccessToken
84
     */
85
    public function setType($type)
86
    {
87
        $this->type = $type;
88
        return $this;
89
    }
90
}