| 1 | <?php declare(strict_types=1); |
||
| 9 | class CommandBuilder |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * @var ProcessCommand[] |
||
| 13 | */ |
||
| 14 | private $allCommands = []; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * @var bool |
||
| 18 | */ |
||
| 19 | private $ignoreError; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @var bool |
||
| 23 | */ |
||
| 24 | private $tty; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @var bool |
||
| 28 | */ |
||
| 29 | private $template; |
||
| 30 | |||
| 31 | /** |
||
| 32 | * @var bool |
||
| 33 | */ |
||
| 34 | private $deferred; |
||
| 35 | |||
| 36 | public function __construct() |
||
| 40 | |||
| 41 | private function reset() |
||
| 48 | |||
| 49 | /** |
||
| 50 | * @param string $shellCommand |
||
| 51 | * @param int $startLine |
||
| 52 | * @return CommandBuilder |
||
| 53 | */ |
||
| 54 | public function addProcessCommand(string $shellCommand, int $startLine): CommandBuilder |
||
| 68 | |||
| 69 | /** |
||
| 70 | * @param string $source |
||
| 71 | * @param string $destination |
||
| 72 | * @param int $lineNumber |
||
| 73 | * @return $this |
||
| 74 | */ |
||
| 75 | public function addTemplateCommand(string $source, string $destination, int $lineNumber): CommandBuilder |
||
| 87 | |||
| 88 | /** |
||
| 89 | * @param int $lineNumber |
||
| 90 | * @return CommandBuilder |
||
| 91 | */ |
||
| 92 | public function addWaitCommand(int $lineNumber): CommandBuilder |
||
| 99 | |||
| 100 | /** |
||
| 101 | * @param bool $set |
||
| 102 | * @return CommandBuilder |
||
| 103 | */ |
||
| 104 | public function setIgnoreError(bool $set = true): CommandBuilder |
||
| 110 | |||
| 111 | /** |
||
| 112 | * @param bool $set |
||
| 113 | * @return CommandBuilder |
||
| 114 | */ |
||
| 115 | public function setTty(bool $set = true): CommandBuilder |
||
| 121 | |||
| 122 | /** |
||
| 123 | * @param bool $set |
||
| 124 | * @return CommandBuilder |
||
| 125 | */ |
||
| 126 | public function setDeferredExecution(bool $set = true): CommandBuilder |
||
| 132 | |||
| 133 | /** |
||
| 134 | * @param array $commands |
||
| 135 | * @return CommandBuilder |
||
| 136 | */ |
||
| 137 | public function replaceCommands(array $commands): CommandBuilder |
||
| 143 | |||
| 144 | /** |
||
| 145 | * @return ProcessCommand[] |
||
| 146 | */ |
||
| 147 | public function getAll(): array |
||
| 155 | } |
||
| 156 |