Completed
Push — 6.0 ( c6d21a...a43f83 )
by yun
15:10 queued 11:06
created

Local   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Test Coverage

Coverage 85.71%

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 17
ccs 6
cts 7
cp 0.8571
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A createAdapter() 0 10 2
1
<?php
2
0 ignored issues
show
Coding Style introduced by
Missing file doc comment
Loading history...
3
namespace think\filesystem\driver;
4
5
use League\Flysystem\Adapter\Local as LocalAdapter;
6
use League\Flysystem\AdapterInterface;
7
use think\filesystem\Driver;
8
9
class Local extends Driver
1 ignored issue
show
Coding Style introduced by
Missing doc comment for class Local
Loading history...
10
{
11
12
    protected $config = [
13
        'root' => '',
14
    ];
15
16 2
    protected function createAdapter(): AdapterInterface
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function createAdapter()
Loading history...
17
    {
18 2
        $permissions = $this->config['permissions'] ?? [];
19
20 2
        $links = ($this->config['links'] ?? null) === 'skip'
21
            ? LocalAdapter::SKIP_LINKS
22 2
            : LocalAdapter::DISALLOW_LINKS;
23
24 2
        return new LocalAdapter(
25 2
            $this->config['root'], LOCK_EX, $links, $permissions
0 ignored issues
show
Bug introduced by
It seems like $permissions can also be of type string; however, parameter $permissions of League\Flysystem\Adapter\Local::__construct() does only seem to accept array, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

25
            $this->config['root'], LOCK_EX, $links, /** @scrutinizer ignore-type */ $permissions
Loading history...
26
        );
27
    }
28
}
29