Skip to content

Commit 56833a4

Browse files
committed
Move deprecated Stdin and Stdout classes to internal Io namespace
1 parent b61758b commit 56833a4

File tree

4 files changed

+8
-38
lines changed

4 files changed

+8
-38
lines changed

README.md

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@ built on top of for [ReactPHP](https://reactphp.org).
1717
* [Cursor](#cursor)
1818
* [History](#history)
1919
* [Autocomplete](#autocomplete)
20-
* [Advanced](#advanced)
21-
* [Stdout](#stdout)
22-
* [Stdin](#stdin)
2320
* [Pitfalls](#pitfalls)
2421
* [Install](#install)
2522
* [Tests](#tests)
@@ -456,35 +453,6 @@ disable the autocomplete function:
456453
$readline->setAutocomplete(null);
457454
```
458455

459-
### Advanced
460-
461-
#### Stdout
462-
463-
[Deprecated] The `Stdout` represents a `WritableStream` and is responsible for handling console output.
464-
465-
Interfacing with it directly is *not recommended* and considered *advanced usage*.
466-
467-
If you want to print some text to console output, use the [`Stdio::write()`](#output) instead:
468-
469-
```php
470-
$stdio->write('hello');
471-
```
472-
473-
#### Stdin
474-
475-
[Deprecated] The `Stdin` represents a `ReadableStream` and is responsible for handling console input.
476-
477-
Interfacing with it directly is *not recommended* and considered *advanced usage*.
478-
479-
If you want to read a line from console input, use the [`Stdio::on()`](#input) instead:
480-
481-
```php
482-
$stdio->on('data', function ($line) use ($stdio) {
483-
$line = rtrim($line, "\r\n");
484-
$stdio->write('You said "' . $line . '"' . PHP_EOL);
485-
});
486-
```
487-
488456
## Pitfalls
489457

490458
The [`Readline`](#readline) has to redraw the current user

src/Stdin.php renamed to src/Io/Stdin.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<?php
22

3-
namespace Clue\React\Stdio;
3+
namespace Clue\React\Stdio\Io;
44

55
use React\Stream\Stream;
66
use React\EventLoop\LoopInterface;
77

88
/**
9-
* @deprecated
9+
* @internal
1010
*/
1111
class Stdin extends Stream
1212
{

src/Stdout.php renamed to src/Io/Stdout.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<?php
22

3-
namespace Clue\React\Stdio;
3+
namespace Clue\React\Stdio\Io;
44

55
use React\Stream\WritableStream;
66

77
/**
8-
* @deprecated
8+
* @internal
99
*/
1010
class Stdout extends WritableStream
1111
{

src/Stdio.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@
22

33
namespace Clue\React\Stdio;
44

5+
use Clue\React\Stdio\Io\Stdin;
6+
use Clue\React\Stdio\Io\Stdout;
57
use Evenement\EventEmitter;
6-
use React\Stream\DuplexStreamInterface;
78
use React\EventLoop\LoopInterface;
9+
use React\Stream\DuplexStreamInterface;
810
use React\Stream\ReadableStreamInterface;
9-
use React\Stream\WritableStreamInterface;
1011
use React\Stream\Util;
12+
use React\Stream\WritableStreamInterface;
1113

1214
class Stdio extends EventEmitter implements DuplexStreamInterface
1315
{

0 commit comments

Comments
 (0)