Completed
Pull Request — master (#184)
by
unknown
06:02
created

DropboxApp::getRefreshToken()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 0
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
1
<?php
2
namespace Kunnu\Dropbox;
3
4
class DropboxApp
5
{
6
7
    /**
8
     * The Client ID of the App
9
     *
10
     * @link https://www.dropbox.com/developers/apps
11
     *
12
     * @var string
13
     */
14
    protected $clientId;
15
16
    /**
17
     * The Client Secret of the App
18
     *
19
     * @link https://www.dropbox.com/developers/apps
20
     *
21
     * @var string
22
     */
23
    protected $clientSecret;
24
25
    /**
26
     * The Access Token
27
     *
28
     * @var string
29
     */
30
    protected $accessToken;
31
32
    /**
33
     * The Refresh Token is a long-lived token that can be used to request new short-lived access tokens without
34
     * direct interaction from a user in your app.
35
     *
36
     * @var string
37
     */
38
    protected $refreshToken;
39
40
    /**
41
     * Create a new Dropbox instance
42
     *
43
     * @param string $clientId     Application Client ID
44
     * @param string $clientSecret Application Client Secret
45
     * @param string $accessToken  Access Token
46
     */
47
    public function __construct($clientId, $clientSecret, $accessToken = null, $refreshToken = null)
48
    {
49
        $this->clientId = $clientId;
50
        $this->clientSecret = $clientSecret;
51
        $this->accessToken = $accessToken;
52
        $this->refreshToken = $refreshToken;
53
    }
54
55
    /**
56
     * Get the App Client ID
57
     *
58
     * @return string
59
     */
60
    public function getClientId()
61
    {
62
        return $this->clientId;
63
    }
64
65
    /**
66
     * Get the App Client Secret
67
     *
68
     * @return string
69
     */
70
    public function getClientSecret()
71
    {
72
        return $this->clientSecret;
73
    }
74
75
    /**
76
     * Get the Access Token
77
     *
78
     * @return string
79
     */
80
    public function getAccessToken()
81
    {
82
        return $this->accessToken;
83
    }
84
85
    /**
86
     * Get the long lived Refresh Token
87
     *
88
     * @return string
89
     */
90
    public function getRefreshToken()
91
    {
92
        return $this->refreshToken;
93
    }
94
}
95