Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/Readline.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

namespace Clue\React\Stdio;

use Clue\React\Term\ControlCodeParser;
use Clue\React\Utf8\Sequencer as Utf8Sequencer;
use Evenement\EventEmitter;
use React\Stream\ReadableStreamInterface;
use React\Stream\WritableStreamInterface;
use React\Stream\Util;
use Clue\React\Utf8\Sequencer as Utf8Sequencer;
use Clue\React\Term\ControlCodeParser;
use React\Stream\WritableStreamInterface;

class Readline extends EventEmitter implements ReadableStreamInterface
{
Expand Down Expand Up @@ -37,7 +37,8 @@ public function __construct(ReadableStreamInterface $input, WritableStreamInterf
$this->output = $output;

if (!$this->input->isReadable()) {
return $this->close();
$this->close();
return;
}
// push input through control code parser
$parser = new ControlCodeParser($input);
Expand Down Expand Up @@ -411,7 +412,7 @@ public function listHistory()
*/
public function limitHistory($limit)
{
$this->historyLimit = $limit === null ? null : (int)$limit;
$this->historyLimit = $limit === null ? null : $limit;

// limit send and currently exceeded
if ($this->historyLimit !== null && isset($this->historyLines[$this->historyLimit])) {
Expand Down Expand Up @@ -441,9 +442,8 @@ public function limitHistory($limit)
*
* @param callable|null $autocomplete
* @return self
* @throws InvalidArgumentException if the given callable is invalid
* @throws \InvalidArgumentException if the given callable is invalid
*/

public function setAutocomplete($autocomplete)
{
if ($autocomplete !== null && !is_callable($autocomplete)) {
Expand Down
2 changes: 1 addition & 1 deletion tests/FunctionalExampleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function testPeriodicExampleWithClosedInputQuitsImmediately()

public function testPeriodicExampleWithClosedInputAndOutputQuitsImmediatelyWithoutOutput()
{
$output = $this->execExample('php 01-periodic.php <&- >&- 2>&1');
$output = $this->execExample('php 01-periodic.php <&- >&- 2>&-');

if (strpos($output, 'said') !== false) {
$this->markTestIncomplete('Your platform exhibits a closed STDIN bug, this may need some further debugging');
Expand Down