Completed
Pull Request — master (#59)
by Alessandro
05:30
created

TempFilenameFactory::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
3
namespace Paraunit\Configuration;
4
5
use Paraunit\File\TempDirectory;
6
7
/**
8
 * Class TempFilenameFactory
9
 * @package Tests\Unit\Parser
10
 */
11
class TempFilenameFactory
12
{
13
    /** @var  TempDirectory */
14
    private $tempDirectory;
15
16
    /**
17
     * TempFilenameFactory constructor.
18
     * @param TempDirectory $tempDirectory
19
     */
20 27
    public function __construct(TempDirectory $tempDirectory)
21
    {
22 27
        $this->tempDirectory = $tempDirectory;
23 27
    }
24
25
    /**
26
     * @param string $uniqueId
27
     * @return string
28
     */
29 25
    public function getFilenameForLog($uniqueId)
30
    {
31 25
        return $this->tempDirectory->getTempDirForThisExecution()
32
            . '/logs/'
33 25
            . $uniqueId
34 25
            . '.json.log';
35
    }
36
37
    /**
38
     * @param string $uniqueId
39
     * @return string
40
     */
41 1
    public function getFilenameForCoverage($uniqueId)
42
    {
43 1
        return $this->tempDirectory->getTempDirForThisExecution()
44
            . '/coverage/'
45 1
            . $uniqueId
46 1
            . '.php';
47
    }
48
}
49