Driver   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 4
dl 0
loc 25
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A createFilesystem() 0 9 2
A getEndPoint() 0 4 1
1
<?php
2
/**
3
 * @link https://github.com/phpviet/laravel-flysystem
4
 * @copyright (c) PHP Viet
5
 * @license [MIT](http://www.opensource.org/licenses/MIT)
6
 */
7
8
namespace PHPViet\Laravel\Flysystem\Drivers\Viettel;
9
10
use Illuminate\Support\Arr;
11
use League\Flysystem\FilesystemInterface;
12
use PHPViet\Laravel\Flysystem\Drivers\BaseDriver;
13
use PHPViet\Laravel\Flysystem\Drivers\AwsS3v2DriverCompatible;
14
15
/**
16
 * @author Vuong Minh <[email protected]>
17
 * @since 1.0.0
18
 */
19
class Driver extends BaseDriver
20
{
21
    use AwsS3v2DriverCompatible;
22
23
    /**
24
     * {@inheritdoc}
25
     */
26
    protected function createFilesystem(): FilesystemInterface
27
    {
28
        $config = Arr::only($this->config, ['visibility', 'disable_asserts', 'url']);
29
30
        return new Filesystem(
31
            $this->createFilesystemAdapter(),
32
            count($config) > 0 ? $config : null
33
        );
34
    }
35
36
    /**
37
     * {@inheritdoc}
38
     */
39
    protected function getEndPoint(): string
40
    {
41
        return 'http://'.$this->config['key'].'.cloudstorage.com.vn';
42
    }
43
}
44