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   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 4
c 2
b 0
f 0
lcom 1
cbo 4
dl 0
loc 42
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A init() 0 12 3
A prepareAdapter() 0 7 1
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