FilePathResolverResult::getFileName()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace AHJ\ApprovalTests;
6
7
final class FilePathResolverResult
8
{
9
    public string $dirPath;
10
11
    public string $fileName;
12
13 2
    public function __construct(
14
        string $dirPath,
15
        string $fileName
16
    ) {
17 2
        $this->dirPath = $dirPath;
18 2
        $this->fileName = $fileName;
19 2
    }
20
21 2
    public function getDirPath(): string
22
    {
23 2
        return $this->dirPath;
24
    }
25
26
    public function getFileName(): string
27
    {
28
        return $this->fileName;
29
    }
30
31 2
    public function getReceivedName(): string
32
    {
33 2
        return sprintf('%s.received.txt', $this->fileName);
34
    }
35
36
    public function getApprovedName(): string
37
    {
38
        return sprintf('%s.approved.txt', $this->fileName);
39
    }
40
41 2
    public function getReceivedFile(): string
42
    {
43 2
        return sprintf('%s/%s.received.txt', $this->dirPath, $this->fileName);
44
    }
45
46 2
    public function getApprovedFile(): string
47
    {
48 2
        return sprintf('%s/%s.approved.txt', $this->dirPath, $this->fileName);
49
    }
50
}
51