Skip to content

Commit 8b1219a

Browse files
authored
Merge pull request #81 from clue-labs/cs
Minor code style improvements
2 parents d4b85cd + f2fa4bf commit 8b1219a

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/Readline.php

+7-7
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
namespace Clue\React\Stdio;
44

5+
use Clue\React\Term\ControlCodeParser;
6+
use Clue\React\Utf8\Sequencer as Utf8Sequencer;
57
use Evenement\EventEmitter;
68
use React\Stream\ReadableStreamInterface;
7-
use React\Stream\WritableStreamInterface;
89
use React\Stream\Util;
9-
use Clue\React\Utf8\Sequencer as Utf8Sequencer;
10-
use Clue\React\Term\ControlCodeParser;
10+
use React\Stream\WritableStreamInterface;
1111

1212
class Readline extends EventEmitter implements ReadableStreamInterface
1313
{
@@ -37,7 +37,8 @@ public function __construct(ReadableStreamInterface $input, WritableStreamInterf
3737
$this->output = $output;
3838

3939
if (!$this->input->isReadable()) {
40-
return $this->close();
40+
$this->close();
41+
return;
4142
}
4243
// push input through control code parser
4344
$parser = new ControlCodeParser($input);
@@ -411,7 +412,7 @@ public function listHistory()
411412
*/
412413
public function limitHistory($limit)
413414
{
414-
$this->historyLimit = $limit === null ? null : (int)$limit;
415+
$this->historyLimit = $limit === null ? null : $limit;
415416

416417
// limit send and currently exceeded
417418
if ($this->historyLimit !== null && isset($this->historyLines[$this->historyLimit])) {
@@ -441,9 +442,8 @@ public function limitHistory($limit)
441442
*
442443
* @param callable|null $autocomplete
443444
* @return self
444-
* @throws InvalidArgumentException if the given callable is invalid
445+
* @throws \InvalidArgumentException if the given callable is invalid
445446
*/
446-
447447
public function setAutocomplete($autocomplete)
448448
{
449449
if ($autocomplete !== null && !is_callable($autocomplete)) {

tests/FunctionalExampleTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function testPeriodicExampleWithClosedInputQuitsImmediately()
4343

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

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

0 commit comments

Comments
 (0)