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
15 changes: 9 additions & 6 deletions src/DuplexResourceStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@

class DuplexResourceStream extends EventEmitter implements DuplexStreamInterface
{
private $stream;
private $loop;

/**
* Controls the maximum buffer size in bytes to read at once from the stream.
*
Expand All @@ -25,13 +28,11 @@ class DuplexResourceStream extends EventEmitter implements DuplexStreamInterface
* @var int
*/
private $bufferSize;
private $buffer;

private $stream;
protected $readable = true;
protected $writable = true;
protected $closing = false;
protected $loop;
protected $buffer;
private $readable = true;
private $writable = true;
private $closing = false;

public function __construct($stream, LoopInterface $loop, $readChunkSize = null, WritableStreamInterface $buffer = null)
{
Expand Down Expand Up @@ -157,6 +158,7 @@ public function pipe(WritableStreamInterface $dest, array $options = array())
return Util::pipe($this, $dest, $options);
}

/** @internal */
public function handleData($stream)
{
$error = null;
Expand Down Expand Up @@ -189,6 +191,7 @@ public function handleData($stream)
}
}

/** @internal */
public function handleClose()
{
if (is_resource($this->stream)) {
Expand Down
13 changes: 7 additions & 6 deletions src/ReadableResourceStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@

class ReadableResourceStream extends EventEmitter implements ReadableStreamInterface
{
/**
* @var resource
*/
private $stream;

private $loop;

/**
* Controls the maximum buffer size in bytes to read at once from the stream.
*
Expand All @@ -28,13 +35,7 @@ class ReadableResourceStream extends EventEmitter implements ReadableStreamInter
*/
private $bufferSize;

/**
* @var resource
*/
private $stream;

private $closed = false;
private $loop;

public function __construct($stream, LoopInterface $loop, $readChunkSize = null)
{
Expand Down