Test Failed
Push — master ( 36eeda...83b81c )
by BruceScrutinizer
08:00
created

ResultProcessedMutableFile::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace NamespaceProtector\Result;
6
7
final class ResultProcessedMutableFile implements ResultProcessedMutableFileInterface
8
{
9
    /** @var string  */
10
    private $file;
11
12
    /** @var array<ErrorResult> */
13
    private $conflicts = [];
14
15
    public function __construct(string $file)
16
    {
17
        $this->file = $file;
18
    }
19
20
    public function getFileName(): String
21
    {
22
        return $this->file;
23
    }
24
25
    public function addConflic(ErrorResult $conflic): void
26
    {
27
        $this->conflicts[] = $conflic;
28
    }
29
30
    /** @return array<ErrorResult> */
31
    public function getConflicts(): array
32
    {
33
        return $this->conflicts;
34
    }
35
36
    public function getReadOnlyProcessedFile(): ResultProcessedFileReadOnly
37
    {
38
        $processedFile = new ResultProcessedFileReadOnly($this->file, $this->getConflicts());
39
        return $processedFile;
40
    }
41
}
42