AwsS3v2Adapter   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 2
dl 0
loc 20
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getTemporaryUrl() 0 9 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;
9
10
use DateTimeInterface;
11
use League\Flysystem\AwsS3v2\AwsS3Adapter;
12
13
/**
14
 * @author Vuong Minh <[email protected]>
15
 * @since 1.0.0
16
 */
17
class AwsS3v2Adapter extends AwsS3Adapter
18
{
19
    /**
20
     * Trả về AWS S3v2 Temporary URL theo đường dẫn chỉ định.
21
     *
22
     * @param  string  $path
23
     * @param  DateTimeInterface  $expiration
24
     * @param  array  $options
25
     * @return string
26
     */
27
    public function getTemporaryUrl(string $path, DateTimeInterface $expiration, array $options = []): string
28
    {
29
        return (string) $this->getClient()->getObjectUrl(
30
            $this->getBucket(),
31
            $this->getPathPrefix().$path,
32
            $expiration,
33
            $options
34
        );
35
    }
36
}
37