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

AliyunOssDriver::createAdapter()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 16

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 16
ccs 0
cts 4
cp 0
rs 9.7333
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
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