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\Psr7Code
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);
}