Completed
Push — master ( 41ae82...437c90 )
by Dave
13s queued 11s
created

FindFileDiffStartState::__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
/**
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
class FindFileDiffStartState implements State
16
{
17
    /**
18
     * @var FileMutationsBuilder
19
     */
20
    private $fileMutationsBuilder;
21
22
    /**
23
     * FindFileDiffStartState constructor.
24
     */
25
    public function __construct(FileMutationsBuilder $fileMutationsBuilder)
26
    {
27
        $this->fileMutationsBuilder = $fileMutationsBuilder;
28
    }
29
30
    public function processLine(string $line): State
31
    {
32
        if (LineTypeDetector::isStartOfFileDiff($line)) {
33
            return new FindOriginalFileNameState($this->fileMutationsBuilder);
34
        }
35
36
        return $this;
37
    }
38
39
    public function finish(): void
40
    {
41
        // Nothing to do. Not in the middle of anything.
42
    }
43
}
44