Skip to content

Commit

Permalink
Fix inconsistent return points.
Browse files Browse the repository at this point in the history
  • Loading branch information
derrabus authored and nicolas-grekas committed Aug 20, 2019
1 parent 60838d6 commit 5179b12
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Pipes/AbstractPipes.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,14 @@ protected function unblock()
/**
* Writes input to stdin.
*
* @return array|null
*
* @throws InvalidArgumentException When an input iterator yields a non supported value
*/
protected function write()
{
if (!isset($this->pipes[0])) {
return;
return null;
}
$input = $this->input;

Expand Down Expand Up @@ -122,7 +124,7 @@ protected function write()

// let's have a look if something changed in streams
if (false === @stream_select($r, $w, $e, 0, 0)) {
return;
return null;
}

foreach ($w as $stdin) {
Expand Down Expand Up @@ -166,6 +168,8 @@ protected function write()
} elseif (!$w) {
return [$this->pipes[0]];
}

return null;
}

/**
Expand Down
2 changes: 2 additions & 0 deletions Tests/ProcessTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1231,6 +1231,8 @@ public function testInputStreamWithCallable()

return $stream;
}

return null;
};

$input = new InputStream();
Expand Down

0 comments on commit 5179b12

Please sign in to comment.