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

Breadcrumb

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

function Stream::getContents

Overrides StreamInterface::getContents

1 call to Stream::getContents()
Stream::__toString in vendor/guzzlehttp/psr7/src/Stream.php
Reads all data from the stream into a string, from the beginning to end.

File

vendor/guzzlehttp/psr7/src/Stream.php, line 95

Class

Stream
PHP stream implementation.

Namespace

GuzzleHttp\Psr7

Code

public function getContents() : string {
    if (!isset($this->stream)) {
        throw new \RuntimeException('Stream is detached');
    }
    if (!$this->readable) {
        throw new \RuntimeException('Cannot read from non-readable stream');
    }
    return Utils::tryGetContents($this->stream);
}

API Navigation

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