You are here

public function Stream::getContents in Auth0 Single Sign On 8.2

Returns the remaining contents in a string

Return value

string

Throws

\RuntimeException if unable to read or an error occurs while reading.

Overrides StreamInterface::getContents

File

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

Class

Stream
PHP stream implementation.

Namespace

GuzzleHttp\Psr7

Code

public function getContents() {
  if (!isset($this->stream)) {
    throw new \RuntimeException('Stream is detached');
  }
  $contents = stream_get_contents($this->stream);
  if ($contents === false) {
    throw new \RuntimeException('Unable to read stream contents');
  }
  return $contents;
}