|
2 | 2 |
|
3 | 3 | namespace Clue\React\Stdio;
|
4 | 4 |
|
| 5 | +use Clue\React\Term\ControlCodeParser; |
| 6 | +use Clue\React\Utf8\Sequencer as Utf8Sequencer; |
5 | 7 | use Evenement\EventEmitter;
|
6 | 8 | use React\Stream\ReadableStreamInterface;
|
7 |
| -use React\Stream\WritableStreamInterface; |
8 | 9 | use React\Stream\Util;
|
9 |
| -use Clue\React\Utf8\Sequencer as Utf8Sequencer; |
10 |
| -use Clue\React\Term\ControlCodeParser; |
| 10 | +use React\Stream\WritableStreamInterface; |
11 | 11 |
|
12 | 12 | class Readline extends EventEmitter implements ReadableStreamInterface
|
13 | 13 | {
|
@@ -37,7 +37,8 @@ public function __construct(ReadableStreamInterface $input, WritableStreamInterf
|
37 | 37 | $this->output = $output;
|
38 | 38 |
|
39 | 39 | if (!$this->input->isReadable()) {
|
40 |
| - return $this->close(); |
| 40 | + $this->close(); |
| 41 | + return; |
41 | 42 | }
|
42 | 43 | // push input through control code parser
|
43 | 44 | $parser = new ControlCodeParser($input);
|
@@ -411,7 +412,7 @@ public function listHistory()
|
411 | 412 | */
|
412 | 413 | public function limitHistory($limit)
|
413 | 414 | {
|
414 |
| - $this->historyLimit = $limit === null ? null : (int)$limit; |
| 415 | + $this->historyLimit = $limit === null ? null : $limit; |
415 | 416 |
|
416 | 417 | // limit send and currently exceeded
|
417 | 418 | if ($this->historyLimit !== null && isset($this->historyLines[$this->historyLimit])) {
|
@@ -441,9 +442,8 @@ public function limitHistory($limit)
|
441 | 442 | *
|
442 | 443 | * @param callable|null $autocomplete
|
443 | 444 | * @return self
|
444 |
| - * @throws InvalidArgumentException if the given callable is invalid |
| 445 | + * @throws \InvalidArgumentException if the given callable is invalid |
445 | 446 | */
|
446 |
| - |
447 | 447 | public function setAutocomplete($autocomplete)
|
448 | 448 | {
|
449 | 449 | if ($autocomplete !== null && !is_callable($autocomplete)) {
|
|
0 commit comments