function Stream::getMetadata
Return value
mixed
Overrides StreamInterface::getMetadata
1 call to Stream::getMetadata()
- Stream::__construct in vendor/
guzzlehttp/ psr7/ src/ Stream.php - This constructor accepts an associative array of options.
File
-
vendor/
guzzlehttp/ psr7/ src/ Stream.php, line 269
Class
- Stream
- PHP stream implementation.
Namespace
GuzzleHttp\Psr7Code
public function getMetadata($key = null) {
if (!isset($this->stream)) {
return $key ? null : [];
}
elseif (!$key) {
return $this->customMetadata + stream_get_meta_data($this->stream);
}
elseif (isset($this->customMetadata[$key])) {
return $this->customMetadata[$key];
}
$meta = stream_get_meta_data($this->stream);
return $meta[$key] ?? null;
}