Skip to content

Commit ae5d3fc

Browse files
committed
Remove deprecated "line" event
1 parent 611af8f commit ae5d3fc

File tree

3 files changed

+0
-17
lines changed

3 files changed

+0
-17
lines changed

README.md

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -109,19 +109,6 @@ streams.
109109
You can control various aspects of the console input through the [`Readline`](#readline),
110110
so read on..
111111

112-
[Deprecated] It will emit a `line` event for every line read from console input.
113-
The event will contain the input buffer as-is, without the trailing newline.
114-
You can register any number of event handlers like this:
115-
116-
```php
117-
// deprecated
118-
$stdio->on('line', function ($line) {
119-
if ($line === 'start') {
120-
doSomething();
121-
}
122-
});
123-
```
124-
125112
### Readline
126113

127114
The [`Readline`](#readline) class is responsible for reacting to user input and presenting a prompt to the user.

src/Stdio.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,6 @@ public function __construct(LoopInterface $loop, ReadableStreamInterface $input
4747

4848
// emit data with trailing newline in order to preserve readable API
4949
$that->emit('data', array($line . PHP_EOL));
50-
51-
// emit custom line event for ease of use
52-
$that->emit('line', array($line, $that));
5350
});
5451

5552
// handle all input events (readline forwards all input events)

tests/StdioTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,6 @@ public function testDataEventWillBeForwarded()
384384
$stdio = new Stdio($this->loop, $input, $output, $readline);
385385

386386
$stdio->on('data', $this->expectCallableOnceWith("hello\n"));
387-
$stdio->on('line', $this->expectCallableOnceWith('hello'));
388387

389388
$readline->emit('data', array('hello'));
390389
}

0 commit comments

Comments
 (0)