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