Driver::getEndPoint()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
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