StubGitWrapper::getCurrentSha()   A
last analyzed

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
final class StubGitWrapper implements GitWrapper
12
{
13
    public const GIT_SHA_1 = '683031e66625ba768350e5cb90d01121eae2ba00';
14
    public const GIT_SHA_2 = '0dcb42273e9deffb76997926d6748aa04487a75c';
15
16
    public function __construct(
17
        private string $sha,
18
        private string $diff,
19
    ) {
20
    }
21
22
    public function getCurrentSha(ProjectRoot $projectRoot): GitCommit
23
    {
24
        return new GitCommit($this->sha);
25
    }
26
27
    public function getGitDiff(ProjectRoot $projectRoot, GitCommit $originalCommit): string
28
    {
29
        return $this->diff;
30
    }
31
32
    public function isClean(ProjectRoot $projectRoot): bool
33
    {
34
        return true;
35
    }
36
}
37