Completed
Pull Request — master (#86)
by Jan Philipp
01:53
created

BashCommand   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 70
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 7
lcom 1
cbo 0
dl 0
loc 70
rs 10
c 0
b 0
f 0

7 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getScript() 0 4 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
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
16
     */
17
    private $warning;
18
19
    /**
20
     * @param Script $script
21
     * @param string $warning
22
     */
23
    public function __construct(Script $script, string $warning = null)
24
    {
25
        $this->script = $script;
26
        $this->warning = $warning;
27
    }
28
29
    /**
30
     * @return Script
31
     */
32
    public function getScript(): Script
33
    {
34
        return $this->script;
35
    }
36
37
    /**
38
     * @return int
39
     */
40
    public function getLineNumber(): int
41
    {
42
        return 1;
43
    }
44
45
    /**
46
     * @return boolean
47
     */
48
    public function isIgnoreError(): bool
49
    {
50
        return false;
51
    }
52
53
    /**
54
     * @return bool
55
     */
56
    public function isTTy(): bool
57
    {
58
        return false;
59
    }
60
61
    /**
62
     * @return bool
63
     */
64
    public function hasWarning(): bool
65
    {
66
        return null !== $this->warning;
67
    }
68
69
    /**
70
     * @return string
71
     */
72
    public function getWarning(): string
73
    {
74
        return $this->warning;
75
    }
76
}
77