Passed
Push — master ( 90d55d...0e16d5 )
by Carlos C
03:42 queued 10s
created

ShellExecResult   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 13
dl 0
loc 40
ccs 14
cts 14
cp 1
rs 10
c 0
b 0
f 0
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A output() 0 3 1
A exitStatus() 0 3 1
A errors() 0 3 1
A __construct() 0 6 1
A commandLine() 0 3 1
1
<?php
2
namespace CfdiUtils\Utils\Internal;
3
4
/**
5
 * Internal class, contains the result of ShellExec::exec()
6
 *
7
 * NOTE: Changes on this file will not be considering a BC since this utility class is for internal usage only
8
 *
9
 * @internal
10
 */
11
class ShellExecResult
12
{
13
    /** @var string */
14
    private $output;
15
16
    /** @var string */
17
    private $errors;
18
19
    /** @var string */
20
    private $commandLine;
21
22
    /** @var int */
23
    private $exitStatus;
24
25 22
    public function __construct(string $commandLine, int $exitStatus, string $output, string $errors)
26
    {
27 22
        $this->commandLine = $commandLine;
28 22
        $this->exitStatus = $exitStatus;
29 22
        $this->output = $output;
30 22
        $this->errors = $errors;
31 22
    }
32
33 11
    public function commandLine(): string
34
    {
35 11
        return $this->commandLine;
36
    }
37
38 19
    public function exitStatus(): int
39
    {
40 19
        return $this->exitStatus;
41
    }
42
43 18
    public function output(): string
44
    {
45 18
        return $this->output;
46
    }
47
48 12
    public function errors(): string
49
    {
50 12
        return $this->errors;
51
    }
52
}
53