Passed
Pull Request — master (#75)
by Dave
02:21 queued 11s
created

StubGitWrapper::isClean()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace DaveLiddament\StaticAnalysisResultsBaseliner\Tests\Unit\Plugins\GitDiffHistoryAnalyser\internal;
6
7
use DaveLiddament\StaticAnalysisResultsBaseliner\Domain\Common\ProjectRoot;
8
use DaveLiddament\StaticAnalysisResultsBaseliner\Plugins\GitDiffHistoryAnalyser\GitCommit;
9
use DaveLiddament\StaticAnalysisResultsBaseliner\Plugins\GitDiffHistoryAnalyser\internal\GitWrapper;
10
11
class StubGitWrapper implements GitWrapper
12
{
13
    public const GIT_SHA_1 = '683031e66625ba768350e5cb90d01121eae2ba00';
14
    public const GIT_SHA_2 = '0dcb42273e9deffb76997926d6748aa04487a75c';
15
16
    /**
17
     * @var string
18
     */
19
    private $sha;
20
21
    /**
22
     * @var string
23
     */
24
    private $diff;
25
26
    public function __construct(string $gitSha, string $diff)
27
    {
28
        $this->sha = $gitSha;
29
        $this->diff = $diff;
30
    }
31
32
    public function getCurrentSha(ProjectRoot $projectRoot): GitCommit
33
    {
34
        return new GitCommit($this->sha);
35
    }
36
37
    public function getGitDiff(ProjectRoot $projectRoot, GitCommit $originalCommit): string
38
    {
39
        return $this->diff;
40
    }
41
42
    public function isClean(ProjectRoot $projectRoot): bool
43
    {
44
        return true;
45
    }
46
}
47