Completed
Push — output_parsers_refactor ( ea70d9...668933 )
by Alessandro
02:32
created

JSONLogFilename   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 3
c 2
b 0
f 0
lcom 1
cbo 2
dl 0
loc 24
ccs 7
cts 7
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A generate() 0 4 1
A generateFromUniqueId() 0 4 1
1
<?php
2
3
namespace Paraunit\Configuration;
4
use Paraunit\Process\ParaunitProcessInterface;
5
6
7
/**
8
 * Class JSONLogFilename
9
 * @package Paraunit\Tests\Unit\Parser
10
 */
11
class JSONLogFilename
12
{
13
    /** @var  Paraunit */
14
    private $configuration;
15
16
    /**
17
     * JSONLogFilename constructor.
18
     * @param Paraunit $configuration
19
     */
20 19
    public function __construct(Paraunit $configuration)
21
    {
22 19
        $this->configuration = $configuration;
23 19
    }
24
25 17
    public function generate(ParaunitProcessInterface $process)
26
    {
27 17
        return $this->generateFromUniqueId($process->getUniqueId());
28
    }
29
30 17
    public function generateFromUniqueId($uniqueId)
31
    {
32 17
        return $this->configuration->getTempDirForThisExecution() . '/logs/' . $uniqueId . '.json.log';
33
    }
34
}
35