AccessToken   A
last analyzed

Complexity

Total Complexity 8

Size/Duplication

Total Lines 83
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 8
lcom 0
cbo 0
dl 0
loc 83
rs 10
c 0
b 0
f 0

8 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A __toString() 0 4 1
A getToken() 0 4 1
A setToken() 0 5 1
A getExpiresIn() 0 4 1
A setExpiresIn() 0 5 1
A getType() 0 4 1
A setType() 0 5 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
}