Completed
Pull Request — master (#111)
by Jan Philipp
02:16
created

BashCommand   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 53
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 1

Importance

Changes 0
Metric Value
wmc 8
lcom 2
cbo 1
dl 0
loc 53
rs 10
c 0
b 0
f 0

8 Methods

Rating   Name   Duplication   Size   Complexity  
A getScript() 0 4 1
A __construct() 0 5 1
A getLineNumber() 0 4 1
A isIgnoreError() 0 4 1
A isTTy() 0 4 1
A hasWarning() 0 4 1
A getWarning() 0 4 1
A getWorkingDirectory() 0 4 1
1
<?php declare(strict_types=1);
2
3
namespace Shopware\Psh\ScriptRuntime;
4
5
use Shopware\Psh\Listing\Script;
6
7
class BashCommand implements ProcessCommand
8
{
9
    /**
10
     * @var Script
11
     */
12
    private $script;
13
14
    /**
15
     * @var string|null
16
     */
17
    private $warning;
18
19
    public function __construct(Script $script, ?string $warning = null)
20
    {
21
        $this->script = $script;
22
        $this->warning = $warning;
23
    }
24
25
    public function getScript(): Script
26
    {
27
        return $this->script;
28
    }
29
30
    public function getLineNumber(): int
31
    {
32
        return 1;
33
    }
34
35
    public function isIgnoreError(): bool
36
    {
37
        return false;
38
    }
39
40
    public function isTTy(): bool
41
    {
42
        return false;
43
    }
44
45
    public function hasWarning(): bool
46
    {
47
        return $this->warning !== null;
48
    }
49
50
    public function getWarning(): ?string
51
    {
52
        return $this->warning;
53
    }
54
55
    public function getWorkingDirectory(): string
56
    {
57
        return $this->script->getWorkingDirectory();
58
    }
59
}
60