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
8 changes: 7 additions & 1 deletion src/DuplexResourceStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,13 @@ final class DuplexResourceStream extends EventEmitter implements DuplexStreamInt
private $closing = false;
private $listening = false;

public function __construct($stream, LoopInterface $loop = null, $readChunkSize = null, WritableStreamInterface $buffer = null)
/**
* @param resource $stream
* @param ?LoopInterface $loop
* @param ?int $readChunkSize
* @param ?WritableStreamInterface $buffer
*/
public function __construct($stream, ?LoopInterface $loop = null, $readChunkSize = null, ?WritableStreamInterface $buffer = null)
{
if (!\is_resource($stream) || \get_resource_type($stream) !== "stream") {
throw new InvalidArgumentException('First parameter must be a valid stream resource');
Expand Down
7 changes: 6 additions & 1 deletion src/ReadableResourceStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,12 @@ final class ReadableResourceStream extends EventEmitter implements ReadableStrea
private $closed = false;
private $listening = false;

public function __construct($stream, LoopInterface $loop = null, $readChunkSize = null)
/**
* @param resource $stream
* @param ?LoopInterface $loop
* @param ?int $readChunkSize
*/
public function __construct($stream, ?LoopInterface $loop = null, $readChunkSize = null)
{
if (!\is_resource($stream) || \get_resource_type($stream) !== "stream") {
throw new InvalidArgumentException('First parameter must be a valid stream resource');
Expand Down
8 changes: 7 additions & 1 deletion src/WritableResourceStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,13 @@ final class WritableResourceStream extends EventEmitter implements WritableStrea
private $closed = false;
private $data = '';

public function __construct($stream, LoopInterface $loop = null, $writeBufferSoftLimit = null, $writeChunkSize = null)
/**
* @param resource $stream
* @param ?LoopInterface $loop
* @param ?int $writeBufferSoftLimit
* @param ?int $writeChunkSize
*/
public function __construct($stream, ?LoopInterface $loop = null, $writeBufferSoftLimit = null, $writeChunkSize = null)
{
if (!\is_resource($stream) || \get_resource_type($stream) !== "stream") {
throw new \InvalidArgumentException('First parameter must be a valid stream resource');
Expand Down