@@ -74,13 +74,6 @@ advanced usage.
7474The ` Stdio ` is a well-behaving writable stream
7575implementing ReactPHP's ` WritableStreamInterface ` .
7676
77- The ` writeln($line) ` method can be used to print a line to console output.
78- A trailing newline will be added automatically.
79-
80- ``` php
81- $stdio->writeln('hello world');
82- ```
83-
8477The ` write($text) ` method can be used to print the given text characters to console output.
8578This is useful if you need more control or want to output individual bytes or binary output:
8679
@@ -89,11 +82,20 @@ $stdio->write('hello');
8982$stdio->write(" world\n");
9083```
9184
92- The ` overwrite($text) ` method can be used to overwrite/replace the last
85+ [ Deprecated] The ` writeln($line) ` method can be used to print a line to console output.
86+ A trailing newline will be added automatically.
87+
88+ ``` php
89+ // deprecated
90+ $stdio->writeln('hello world');
91+ ```
92+
93+ [ Deprecated] The ` overwrite($text) ` method can be used to overwrite/replace the last
9394incomplete line with the given text:
9495
9596``` php
9697$stdio->write('Loading…');
98+ // deprecated
9799$stdio->overwrite('Done!');
98100```
99101
@@ -477,7 +479,7 @@ $readline->setAutocomplete(null);
477479
478480#### Stdout
479481
480- The ` Stdout ` represents a ` WritableStream ` and is responsible for handling console output.
482+ [ Deprecated ] The ` Stdout ` represents a ` WritableStream ` and is responsible for handling console output.
481483
482484Interfacing with it directly is * not recommended* and considered * advanced usage* .
483485
@@ -490,6 +492,7 @@ $stdio->write('hello');
490492Should you need to interface with the ` Stdout ` , you can access the current instance through the [ ` Stdio ` ] ( #stdio ) :
491493
492494``` php
495+ // deprecated
493496$stdout = $stdio->getOutput();
494497```
495498
@@ -503,7 +506,7 @@ If you want to read a line from console input, use the [`Stdio::on()`](#input) i
503506
504507``` php
505508$stdio->on('line', function ($line) use ($stdio) {
506- $stdio->writeln ('You said "' . $line . '"');
509+ $stdio->write ('You said "' . $line . '"' . PHP_EOL );
507510});
508511```
509512
0 commit comments