Skip to content

Commit 6f92680

Browse files
committed
"Fix" minor BC break
:-)
1 parent 5b4ccbb commit 6f92680

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ succeeds or fails.
4141
```php
4242
$connector = new React\SocketClient\Connector($loop, $dns);
4343

44-
$connector->create('www.google.com', 80)->then(function (React\Stream\Stream $stream) {
44+
$connector->create('www.google.com', 80)->then(function (React\Stream\DuplexStreamInterface $stream) {
4545
$stream->write('...');
4646
$stream->close();
4747
});
@@ -57,7 +57,7 @@ a `Stream` instance that can be used just like any non-encrypted stream.
5757
```php
5858
$secureConnector = new React\SocketClient\SecureConnector($connector, $loop);
5959

60-
$secureConnector->create('www.google.com', 443)->then(function (React\Stream\Stream $stream) {
60+
$secureConnector->create('www.google.com', 443)->then(function (React\Stream\DuplexStreamInterface $stream) {
6161
$stream->write("GET / HTTP/1.0\r\nHost: www.google.com\r\n\r\n");
6262
...
6363
});

src/SecureStream.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
use React\Stream\Stream;
1010
use React\Stream\Util;
1111

12-
class SecureStream implements DuplexStreamInterface
12+
class SecureStream extends Stream implements DuplexStreamInterface
1313
{
14-
use EventEmitterTrait;
15-
14+
// use EventEmitterTrait;
15+
1616
public $stream;
17-
17+
1818
public $decorating;
1919
protected $loop;
2020

@@ -35,12 +35,12 @@ public function __construct(Stream $stream, LoopInterface $loop) {
3535
$stream->on('drain', function() {
3636
$this->emit('drain', [$this]);
3737
});
38-
38+
3939
$stream->pause();
40-
40+
4141
$this->resume();
4242
}
43-
43+
4444
public function handleData($stream)
4545
{
4646
$data = stream_get_contents($stream);
@@ -51,7 +51,7 @@ public function handleData($stream)
5151
$this->end();
5252
}
5353
}
54-
54+
5555
public function pause()
5656
{
5757
$this->loop->removeReadStream($this->decorating->stream);

0 commit comments

Comments
 (0)