You are here

public function StreamDecoratorTrait::__get in Lockr 7.3

Magic method used to create a new stream if streams are not added in the constructor of a decorator (e.g., LazyOpenStream).

Parameters

string $name Name of the property (allows "stream" only).:

Return value

StreamInterface

File

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

Class

StreamDecoratorTrait
Stream decorator trait @property StreamInterface stream

Namespace

GuzzleHttp\Psr7

Code

public function __get($name) {
  if ($name == 'stream') {
    $this->stream = $this
      ->createStream();
    return $this->stream;
  }
  throw new \UnexpectedValueException("{$name} not found on class");
}