Completed
Push — master ( fdad86...4add92 )
by Alessandro
08:39
created

DumbTestResultContainer::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 5
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
3
namespace Paraunit\TestResult;
4
5
use Paraunit\Process\ProcessWithResultsInterface;
6
use Paraunit\TestResult\Interfaces\TestFilenameBearerInterface;
7
8
/**
9
 * Class DumbTestResultContainer
10
 * @package Paraunit\TestResult
11
 */
12
class DumbTestResultContainer implements TestFilenameBearerInterface
13
{
14
    /** @var  TestResultFormat */
15
    protected $testResultFormat;
16
17
    /** @var  string[] */
18
    protected $filenames;
19
20
    /**
21
     * DumbTestResultContainer constructor.
22
     * @param TestResultFormat $testResultFormat
23
     */
24
    public function __construct(TestResultFormat $testResultFormat)
25
    {
26
        $this->testResultFormat = $testResultFormat;
27
        $this->filenames = array();
28
    }
29
30
    public function addProcessToFilenames(ProcessWithResultsInterface $process)
31
    {
32
        // trick for unique
33
        $this->filenames[$process->getUniqueId()] = $process->getFilename();
34
    }
35
36
    /**
37
     * @return TestResultFormat
38
     */
39
    public function getTestResultFormat()
40
    {
41
        return $this->testResultFormat;
42
    }
43
44
    /**
45
     * @return string[]
46
     */
47
    public function getFileNames()
48
    {
49
        return $this->filenames;
50
    }
51
}
52