Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Stream.php

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\Psr7

Code

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;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal