1 | <?php declare(strict_types=1); |
||
15 | class CommandBuilder |
||
16 | { |
||
17 | /** |
||
18 | * @var Command[] |
||
19 | */ |
||
20 | private $allCommands = []; |
||
21 | |||
22 | /** |
||
23 | * @var bool |
||
24 | */ |
||
25 | private $ignoreError; |
||
26 | |||
27 | /** |
||
28 | * @var bool |
||
29 | */ |
||
30 | private $tty; |
||
31 | |||
32 | /** |
||
33 | * @var bool |
||
34 | */ |
||
35 | private $template; |
||
36 | |||
37 | /** |
||
38 | * @var bool |
||
39 | */ |
||
40 | private $deferred; |
||
41 | |||
42 | public function __construct() |
||
46 | |||
47 | private function reset() |
||
54 | |||
55 | /** |
||
56 | * @param string $shellCommand |
||
57 | * @param int $startLine |
||
58 | * @return CommandBuilder |
||
59 | */ |
||
60 | public function addProcessCommand(string $shellCommand, int $startLine): CommandBuilder |
||
82 | |||
83 | /** |
||
84 | * @param string $source |
||
85 | * @param string $destination |
||
86 | * @param int $lineNumber |
||
87 | * @return $this |
||
88 | */ |
||
89 | public function addTemplateCommand(string $source, string $destination, int $lineNumber): CommandBuilder |
||
101 | |||
102 | /** |
||
103 | * @param int $lineNumber |
||
104 | * @return CommandBuilder |
||
105 | */ |
||
106 | public function addWaitCommand(int $lineNumber): CommandBuilder |
||
113 | |||
114 | /** |
||
115 | * @param bool $set |
||
116 | * @return CommandBuilder |
||
117 | */ |
||
118 | public function setIgnoreError(bool $set = true): CommandBuilder |
||
124 | |||
125 | /** |
||
126 | * @param bool $set |
||
127 | * @return CommandBuilder |
||
128 | */ |
||
129 | public function setTty(bool $set = true): CommandBuilder |
||
135 | |||
136 | /** |
||
137 | * @param bool $set |
||
138 | * @return CommandBuilder |
||
139 | */ |
||
140 | public function setDeferredExecution(bool $set = true): CommandBuilder |
||
146 | |||
147 | /** |
||
148 | * @param array $commands |
||
149 | * @return CommandBuilder |
||
150 | */ |
||
151 | public function replaceCommands(array $commands): CommandBuilder |
||
157 | |||
158 | /** |
||
159 | * @return SynchronusProcessCommand[] |
||
160 | */ |
||
161 | public function getAll(): array |
||
169 | } |
||
170 |