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

ResultProcessedMutableFile   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 33
rs 10
c 0
b 0
f 0
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A addConflic() 0 3 1
A getConflicts() 0 3 1
A getFileName() 0 3 1
A __construct() 0 3 1
A getReadOnlyProcessedFile() 0 4 1
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