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.

CopyFilesystem   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 58
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
B init() 0 20 5
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 Barracuda\Copy\API;
11
use League\Flysystem\Copy\CopyAdapter;
12
use yii\base\InvalidConfigException;
13
14
/**
15
 * CopyFilesystem
16
 *
17
 * @author Alexander Kochetov <[email protected]>
18
 */
19
class CopyFilesystem extends Filesystem
20
{
21
    /**
22
     * @var string
23
     */
24
    public $consumerKey;
25
    /**
26
     * @var string
27
     */
28
    public $consumerSecret;
29
    /**
30
     * @var string
31
     */
32
    public $accessToken;
33
    /**
34
     * @var string
35
     */
36
    public $tokenSecret;
37
    /**
38
     * @var string|null
39
     */
40
    public $prefix;
41
42
    /**
43
     * @inheritdoc
44
     */
45
    public function init()
46
    {
47
        if ($this->consumerKey === null) {
48
            throw new InvalidConfigException('The "consumerKey" property must be set.');
49
        }
50
51
        if ($this->consumerSecret === null) {
52
            throw new InvalidConfigException('The "consumerSecret" property must be set.');
53
        }
54
55
        if ($this->accessToken === null) {
56
            throw new InvalidConfigException('The "accessToken" property must be set.');
57
        }
58
59
        if ($this->tokenSecret === null) {
60
            throw new InvalidConfigException('The "tokenSecret" property must be set.');
61
        }
62
63
        parent::init();
64
    }
65
66
    /**
67
     * @return CopyAdapter
68
     */
69
    protected function prepareAdapter()
70
    {
71
        return new CopyAdapter(
72
            new API($this->consumerKey, $this->consumerSecret, $this->accessToken, $this->tokenSecret),
73
            $this->prefix
74
        );
75
    }
76
}
77