FileMutationsBuilder   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 23
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A build() 0 3 1
A __construct() 0 3 1
A addFileMutation() 0 3 1
1
<?php
2
3
/**
4
 * Static Analysis Results Baseliner (sarb).
5
 *
6
 * (c) Dave Liddament
7
 *
8
 * For the full copyright and licence information please view the LICENSE file distributed with this source code.
9
 */
10
11
declare(strict_types=1);
12
13
namespace DaveLiddament\StaticAnalysisResultsBaseliner\Domain\HistoryAnalyser\UnifiedDiffParser\internal;
14
15
use DaveLiddament\StaticAnalysisResultsBaseliner\Domain\HistoryAnalyser\UnifiedDiffParser\FileMutation;
16
use DaveLiddament\StaticAnalysisResultsBaseliner\Domain\HistoryAnalyser\UnifiedDiffParser\FileMutations;
17
18
final class FileMutationsBuilder
19
{
20
    /**
21
     * @var FileMutation[]
22
     */
23
    private $fileMutations;
24
25
    /**
26
     * FileMutationsBuilder constructor.
27
     */
28
    public function __construct()
29
    {
30
        $this->fileMutations = [];
31
    }
32
33
    public function addFileMutation(FileMutation $fileMutation): void
34
    {
35
        $this->fileMutations[] = $fileMutation;
36
    }
37
38
    public function build(): FileMutations
39
    {
40
        return new FileMutations($this->fileMutations);
41
    }
42
}
43