You are here

public function StreamDecoratorTrait::__toString in Lockr 7.3

File

vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php, line 38

Class

StreamDecoratorTrait
Stream decorator trait @property StreamInterface stream

Namespace

GuzzleHttp\Psr7

Code

public function __toString() {
  try {
    if ($this
      ->isSeekable()) {
      $this
        ->seek(0);
    }
    return $this
      ->getContents();
  } catch (\Exception $e) {

    // Really, PHP? https://bugs.php.net/bug.php?id=53648
    trigger_error('StreamDecorator::__toString exception: ' . (string) $e, E_USER_ERROR);
    return '';
  }
}