| 1 | <?php |
||
| 15 | class CliOutput implements Output |
||
| 16 | { |
||
| 17 | /** |
||
| 18 | * @var bool |
||
| 19 | */ |
||
| 20 | private $quietMode = false; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * @param string $message |
||
| 24 | * @return $this |
||
| 25 | */ |
||
| 26 | public function writeln($message) |
||
| 31 | |||
| 32 | /** |
||
| 33 | * @param string $message |
||
| 34 | * @return $this |
||
| 35 | */ |
||
| 36 | public function write($message) |
||
| 37 | { |
||
| 38 | $this->quietMode||file_put_contents('php://stdout', $message); |
||
| 39 | return $this; |
||
| 40 | } |
||
| 41 | |||
| 42 | /** |
||
| 43 | * @param string $message |
||
| 44 | * @return $this |
||
| 45 | */ |
||
| 46 | public function err($message) |
||
| 47 | { |
||
| 48 | file_put_contents('php://stderr', $message); |
||
| 49 | return $this; |
||
| 50 | } |
||
| 51 | |||
| 52 | public function clearln() |
||
| 58 | |||
| 59 | /** |
||
| 60 | * @param bool $quietMode |
||
| 61 | * @return $this |
||
| 62 | */ |
||
| 63 | public function setQuietMode($quietMode) |
||
| 68 | |||
| 69 | /** |
||
| 70 | * @inheritDoc |
||
| 71 | */ |
||
| 72 | public function hasAnsi() |
||
| 87 | } |
||
| 88 |