Completed
Push — master ( 9d2c7e...85264a )
by Jan Philipp
11s
created

ProcessCommand   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 73
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 0
dl 0
loc 73
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 11 1
A getShellCommand() 0 4 1
A isIgnoreError() 0 4 1
A getLineNumber() 0 4 1
A isTTy() 0 4 1
1
<?php declare(strict_types=1);
2
3
4
namespace Shopware\Psh\ScriptRuntime;
5
6
/**
7
 * A single command of a script
8
 */
9
class ProcessCommand implements Command
10
{
11
    /**
12
     * @var string
13
     */
14
    private $shellCommand;
15
16
    /**
17
     * @var bool
18
     */
19
    private $ignoreError;
20
21
    /**
22
     * @var int
23
     */
24
    private $lineNumber;
25
26
    /**
27
     * @var bool
28
     */
29
    private $tty;
30
31
    /**
32
     * Command constructor.
33
     * @param string $shellCommand
34
     * @param int $lineNumber
35
     * @param bool $ignoreError
36
     * @param bool $tty
37
     */
38
    public function __construct(
39
        string $shellCommand,
40
        int $lineNumber,
41
        bool $ignoreError,
42
        bool $tty
43
    ) {
44
        $this->shellCommand = $shellCommand;
45
        $this->ignoreError = $ignoreError;
46
        $this->lineNumber = $lineNumber;
47
        $this->tty = $tty;
48
    }
49
50
    /**
51
     * @return string
52
     */
53
    public function getShellCommand(): string
54
    {
55
        return $this->shellCommand;
56
    }
57
58
    /**
59
     * @return boolean
60
     */
61
    public function isIgnoreError(): bool
62
    {
63
        return $this->ignoreError;
64
    }
65
66
    /**
67
     * @return int
68
     */
69
    public function getLineNumber(): int
70
    {
71
        return $this->lineNumber;
72
    }
73
74
    /**
75
     * @return bool
76
     */
77
    public function isTTy(): bool
78
    {
79
        return $this->tty;
80
    }
81
}
82