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

File   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 6
lcom 1
cbo 1
dl 0
loc 37
rs 10
c 0
b 0
f 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getDisk() 0 4 1
A getPath() 0 4 1
A getExtension() 0 4 1
A getFullPath() 0 4 1
A put() 0 4 1
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