Passed
Push — master ( 6309f1...8af892 )
by Pascal
02:12
created

MediaOnNetwork::getCompiledHeaders()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
namespace ProtoneMedia\LaravelFFMpeg\Filesystem;
4
5
use ProtoneMedia\LaravelFFMpeg\FFMpeg\InteractsWithHttpHeaders;
6
7
class MediaOnNetwork
8
{
9
    use InteractsWithHttpHeaders;
10
11
    /**
12
     * @var string
13
     */
14
    private $path;
15
16
    public function __construct(string $path, array $headers = [])
17
    {
18
        $this->path    = $path;
19
        $this->headers = $headers;
20
    }
21
22
    public static function make(string $path, array $headers = []): self
23
    {
24
        return new static($path, $headers);
25
    }
26
27
    public function getPath(): string
28
    {
29
        return $this->path;
30
    }
31
32
    public function getDisk(): Disk
33
    {
34
        return Disk::make(config('filesystems.default'));
35
    }
36
37
    public function getLocalPath(): string
38
    {
39
        return $this->path;
40
    }
41
42
    public function getFilenameWithoutExtension(): string
43
    {
44
        return pathinfo($this->getPath())['filename'];
45
    }
46
47
    public function getFilename(): string
48
    {
49
        return pathinfo($this->getPath())['basename'];
50
    }
51
52
    public function getCompiledHeaders(): array
53
    {
54
        return static::compileHeaders($this->getHeaders());
55
    }
56
}
57