File   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 12
dl 0
loc 36
rs 10
c 0
b 0
f 0
wmc 6

6 Methods

Rating   Name   Duplication   Size   Complexity  
A basename() 0 3 1
A info() 0 3 1
A __construct() 0 5 1
A extension() 0 3 1
A key() 0 3 1
A storage() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Damax\Media\Domain\Model;
6
7
final class File
8
{
9
    private $key;
10
    private $storage;
11
    private $info;
12
13
    public function __construct(string $key, string $storage, FileInfo $info)
14
    {
15
        $this->key = $key;
16
        $this->storage = $storage;
17
        $this->info = $info;
18
    }
19
20
    public function key(): string
21
    {
22
        return $this->key;
23
    }
24
25
    public function storage(): string
26
    {
27
        return $this->storage;
28
    }
29
30
    public function info(): FileInfo
31
    {
32
        return $this->info;
33
    }
34
35
    public function basename(): ?string
36
    {
37
        return pathinfo($this->key, PATHINFO_BASENAME);
38
    }
39
40
    public function extension(): ?string
41
    {
42
        return pathinfo($this->key, PATHINFO_EXTENSION);
43
    }
44
}
45