WordPress\AiClientDependencies\Nyholm\Psr7

Stream::getMetadatapublicWP 1.0

Method of the class: Stream{}

No Hooks.

Returns

Mixed.

Usage

$Stream = new Stream();
$Stream->getMetadata( $key );
$key
.
Default: null

Stream::getMetadata() code WP 7.0

public function getMetadata($key = null)
{
    if (null !== $key && !\is_string($key)) {
        throw new \InvalidArgumentException('Metadata key must be a string');
    }
    if (!isset($this->stream)) {
        return $key ? null : [];
    }
    $meta = \stream_get_meta_data($this->stream);
    if (null === $key) {
        return $meta;
    }
    return $meta[$key] ?? null;
}