Passed
Push — master ( a45834...0e9c59 )
by alpha
09:47
created

AliyunOssDriver   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 0
dl 0
loc 27
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A createAdapter() 0 16 1
1
<?php
2
3
namespace AlphaSnow\AliyunOss;
4
5
use League\Flysystem\AdapterInterface;
6
use League\Flysystem\Adapter\Local as LocalAdapter;
7
use think\filesystem\Driver;
8
use think\Container;
9
10
class AliyunOssDriver extends Driver
11
{
12
    /**
13
     * 配置参数
14
     * @var array
15
     */
16
    protected $config = [
17
        'root' => '',
18
    ];
19
20
    protected function createAdapter(): AdapterInterface
21
    {
22
        return Container::getInstance()->get('aliyun.oss.adapter');
23
//        $permissions = $this->config['permissions'] ?? [];
24
//
25
//        $links = ($this->config['links'] ?? null) === 'skip'
26
//            ? LocalAdapter::SKIP_LINKS
27
//            : LocalAdapter::DISALLOW_LINKS;
28
//
29
//        return new LocalAdapter(
30
//            $this->config['root'],
31
//            LOCK_EX,
32
//            $links,
33
//            $permissions
34
//        );
35
    }
36
}
37