Skip to content

Commit f799ca6

Browse files
authored
Changed $stream from DuplexStreamInterface to ReadableStreamInterface in Response constructor (#63)
Changed $stream from DuplexStreamInterface to ReadableStreamInterface in Response constructor (#63)
1 parent 4d367ff commit f799ca6

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/Response.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace React\HttpClient;
44

55
use Evenement\EventEmitterTrait;
6-
use React\Stream\DuplexStreamInterface;
76
use React\Stream\ReadableStreamInterface;
87
use React\Stream\Util;
98
use React\Stream\WritableStreamInterface;
@@ -25,7 +24,7 @@ class Response implements ReadableStreamInterface
2524
private $headers;
2625
private $readable = true;
2726

28-
public function __construct(DuplexStreamInterface $stream, $protocol, $version, $code, $reasonPhrase, $headers)
27+
public function __construct(ReadableStreamInterface $stream, $protocol, $version, $code, $reasonPhrase, $headers)
2928
{
3029
$this->stream = $stream;
3130
$this->protocol = $protocol;
@@ -108,7 +107,7 @@ public function close(\Exception $error = null)
108107
$this->emit('end', array($error, $this));
109108

110109
$this->removeAllListeners();
111-
$this->stream->end();
110+
$this->stream->close();
112111
}
113112

114113
public function isReadable()

tests/ResponseTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function responseShouldEmitEndEventOnEnd()
5151

5252
$this->stream
5353
->expects($this->at(0))
54-
->method('end');
54+
->method('close');
5555

5656
$response->handleData('some data');
5757
$response->handleEnd();

0 commit comments

Comments
 (0)