Completed
Push — master ( 1abdda...74bc12 )
by Pascal
02:08
created

File::getExtension()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Pbmedia\LaravelFFMpeg;
4
5
class File
6
{
7
    protected $disk;
8
9
    protected $path;
10
11
    public function __construct(Disk $disk, string $path)
12
    {
13
        $this->disk = $disk;
14
        $this->path = $path;
15
    }
16
17
    public function getDisk(): Disk
18
    {
19
        return $this->disk;
20
    }
21
22
    public function getPath(): string
23
    {
24
        return $this->path;
25
    }
26
27
    public function getExtension(): string
28
    {
29
        return pathinfo($this->getPath())['extension'];
30
    }
31
32
    public function getFullPath(): string
33
    {
34
        return $this->getDisk()->getPath() . $this->getPath();
35
    }
36
37
    public function put($content): bool
38
    {
39
        return $this->getDisk()->put($this->getPath(), $content);
40
    }
41
}
42