Completed
Pull Request — master (#111)
by Jan Philipp
02:46 queued 41s
created

BashCommand::getWorkingDirectory()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
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