Result   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 2
cbo 1
dl 0
loc 30
ccs 11
cts 11
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A isSuccess() 0 4 1
A getOutput() 0 4 1
A getErrorMessage() 0 4 1
1
<?php declare(strict_types=1);
2
3
namespace Gitilicious\GitClient\Cli\Output;
4
5
class Result
6
{
7
    private $exitCode = 0;
8
9
    private $stdOut;
10
11
    private $stdErr;
12
13 21
    public function __construct(int $exitCode, string $stdOut, string $stdErr)
14
    {
15 21
        $this->exitCode = $exitCode;
16 21
        $this->stdOut   = new Output($stdOut);
17 21
        $this->stdErr   = new Output($stdErr);
18 21
    }
19
20 16
    public function isSuccess(): bool
21
    {
22 16
        return $this->exitCode === 0;
23
    }
24
25 2
    public function getOutput(): Output
26
    {
27 2
        return $this->stdOut;
28
    }
29
30 4
    public function getErrorMessage(): string
31
    {
32 4
        return $this->stdErr->getLine(1);
33
    }
34
}
35