WordPress\AiClientDependencies\Nyholm\Psr7

Stream::__constructpublicWP 1.0

Method of the class: Stream{}

No Hooks.

Returns

null. Nothing (null).

Usage

$Stream = new Stream();
$Stream->__construct( $body );
$body(resource) (required)
.

Stream::__construct() code WP 7.0

public function __construct($body)
{
    if (!\is_resource($body)) {
        throw new \InvalidArgumentException('First argument to Stream::__construct() must be resource');
    }
    $this->stream = $body;
    $meta = \stream_get_meta_data($this->stream);
    $this->seekable = $meta['seekable'] && 0 === \fseek($this->stream, 0, \SEEK_CUR);
    $this->readable = isset(self::READ_WRITE_HASH['read'][$meta['mode']]);
    $this->writable = isset(self::READ_WRITE_HASH['write'][$meta['mode']]);
}