File::make()   A
last analyzed

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 2
dl 0
loc 3
rs 10
1
<?php
2
3
namespace Da\Mailer\Mail\Dto;
4
5
final class File
6
{
7
    /**
8
     * @var string
9
     */
10
    private string $path;
11
    /**
12
     * @var string|null
13
     */
14
    private ?string $name;
15
16
    /**
17
     * @param string $path
18
     * @param string|null $name
19
     */
20
    public function __construct(string $path, ?string $name = '')
21
    {
22
        $this->path = $path;
23
        $this->name = $name;
24
    }
25
26
    /**
27
     * @param string $path
28
     * @param string|null $name
29
     * @return File
30
     */
31
    public static function make(string $path, ?string $name = ''): self
32
    {
33
        return new self($path, $name);
34
    }
35
36
    /**
37
     * @return string
38
     */
39
    public function getPath(): string
40
    {
41
        return $this->path;
42
    }
43
44
    /**
45
     * @return string|null
46
     */
47
    public function getName(): ?string
48
    {
49
        return $this->name;
50
    }
51
}
52