pjpawel /
LightApi
| 1 | <?php |
||
| 2 | |||
| 3 | namespace pjpawel\LightApi\Command\Output; |
||
| 4 | |||
| 5 | class Stdout implements OutputInterface |
||
| 6 | { |
||
| 7 | |||
| 8 | /** |
||
| 9 | * @inheritDoc |
||
| 10 | */ |
||
| 11 | public function write(string $text): void |
||
| 12 | { |
||
| 13 | echo $text; |
||
| 14 | } |
||
| 15 | |||
| 16 | /** |
||
| 17 | * @inheritDoc |
||
| 18 | */ |
||
| 19 | public function writeln(array|string $text): void |
||
| 20 | { |
||
| 21 | if (is_array($text)) { |
||
|
0 ignored issues
–
show
introduced
by
Loading history...
|
|||
| 22 | echo implode(PHP_EOL, $text) . PHP_EOL; |
||
| 23 | } else { |
||
| 24 | echo $text . PHP_EOL; |
||
| 25 | } |
||
| 26 | } |
||
| 27 | } |