GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

DropboxFilesystem::init()   A
last analyzed

Complexity

Conditions 3
Paths 3

Size

Total Lines 12
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 12
rs 9.4285
cc 3
eloc 6
nc 3
nop 0
1
<?php
2
/**
3
 * @link https://github.com/creocoder/yii2-flysystem
4
 * @copyright Copyright (c) 2015 Alexander Kochetov
5
 * @license http://opensource.org/licenses/BSD-3-Clause
6
 */
7
8
namespace creocoder\flysystem;
9
10
use Dropbox\Client;
11
use League\Flysystem\Dropbox\DropboxAdapter;
12
use yii\base\InvalidConfigException;
13
14
/**
15
 * DropboxFilesystem
16
 *
17
 * @author Alexander Kochetov <[email protected]>
18
 */
19
class DropboxFilesystem extends Filesystem
20
{
21
    /**
22
     * @var string
23
     */
24
    public $token;
25
    /**
26
     * @var string
27
     */
28
    public $app;
29
    /**
30
     * @var string|null
31
     */
32
    public $prefix;
33
34
    /**
35
     * @inheritdoc
36
     */
37
    public function init()
38
    {
39
        if ($this->token === null) {
40
            throw new InvalidConfigException('The "token" property must be set.');
41
        }
42
43
        if ($this->app === null) {
44
            throw new InvalidConfigException('The "app" property must be set.');
45
        }
46
47
        parent::init();
48
    }
49
50
    /**
51
     * @return DropboxAdapter
52
     */
53
    protected function prepareAdapter()
54
    {
55
        return new DropboxAdapter(
56
            new Client($this->token, $this->app),
57
            $this->prefix
58
        );
59
    }
60
}
61