This class seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate
the same code in three or more different places, we strongly encourage you to
look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.
Loading history...
10
{
11
12
public static $ID = 2;
13
14
public $debug = true;
15
public $truncatedDebug = false;
16
17
public function __construct()
18
{
19
20
}
21
22
protected function getConnection($token = false)
23
{
24
return $this->login();
25
}
26
27
public function getToken()
28
{
29
$dropbox = new \MetzWeb\Dropbox\Dropbox(
30
array(
31
'apiKey' => 'YOUR_APP_KEY',
32
'apiSecret' => 'YOUR_APP_SECRET',
33
'apiCallback' => 'YOUR_APP_CALLBACK'
34
)
35
);
36
37
$token = 'USER_ACCESS_TOKEN';
38
$dropbox->setAccessToken($token);
39
return $dropbox;
40
}
41
42
public function getUsername()
43
{
44
return env('dropboxusername');
45
}
46
47
public function getPassword()
48
{
49
return env('dropboxpassword');
50
}
51
52
public function login()
53
{
54
$ig = new \DropboxAPI\Dropbox($this->debug, $this->truncatedDebug);
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.