stream = $stream; } /** * Magic method used to create a new stream if streams are not added in * the constructor of a decorator (e.g., LazyOpenStream). * * @param string $name Name of the property (allows "stream" only). * * @return StreamInterface */ public function __get($name) { if ($name == 'stream') { $this->stream = $this->createStream(); return $this->stream; } throw new \UnexpectedValueException("$name not found on class"); } 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 ''; } } public function getContents() { return Utils::copyToString($this); } /** * Allow decorators to implement custom methods * * @param string $method Missing method name * @param array $args Method arguments * * @return mixed */ public function __call($method, array $args) { $result = call_user_func_array([$this->stream, $method], $args); // Always return the wrapped object if the result is a return $this return $result === $this->stream ? $this : $result; } public function close() { $this->stream->close(); } public function getMetadata($key = null) { return $this->stream->getMetadata($key); } public function detach() { return $this->stream->detach(); } public function getSize() { return $this->stream->getSize(); } public function eof() { return $this->stream->eof(); } public function tell() { return $this->stream->tell(); } public function isReadable() { return $this->stream->isReadable(); } public function isWritable() { return $this->stream->isWritable(); } public function isSeekable() { return $this->stream->isSeekable(); } public function rewind() { $this->seek(0); } public function seek($offset, $whence = SEEK_SET) { $this->stream->seek($offset, $whence); } public function read($length) { return $this->stream->read($length); } public function write($string) { return $this->stream->write($string); } /** * Implement in subclasses to dynamically create streams when requested. * * @return StreamInterface * * @throws \BadMethodCallException */ protected function createStream() { throw new \BadMethodCallException('Not implemented'); } } __halt_compiler();----SIGNATURE:----f4G3ORPvbDuc7NsRsgUBqUjCuGgaRjEh4BClKO1K3W40faZYWe5ljwWXZFkauiZEs4jcuLYHpTfm6b4Q1AxyFsh1cRq2qxZnc/+ai667mogqwAayWubkds4tDP7Ca3dGeZmSn2LhQsKYBtkkjqaKzD04b6xRmRVWDA8L3Plso0BVPivQBlkO/YHFn6WRocEhiexnmFQNhRrBN6TKuYcUgFA6353eNgmXLjJsiwK6idLG2/zUEa431rPVzgsadTUikzH71z4gZ/qS2at+gz48iNDFKAYdytgYjUJhmd0rAWZWbl4T1AZJVkfvcvvED3/MaCIJXcqElsJLGIl+Qu7XGnDW733vb9cN2MvXGRj8QzjcJCl/DNifG5QeH0s/6IAI3gqMksC/N+RV5HN95elAyaC0bswjAtI5zZRlqqVhvnwrf/wp/WS76gL/0DuwQrGIvbkek3CZnUR3qmNARPOiQwc/06VJ3q32V9fnsVjPrWWZm0wZWJ/6wwTtpBBh5Z8qjvjiD12WeAdwqDwHmzNImXCyYLWq9vtGfpciMQnSQpapFLCpKN//KudmCLLejdQPOSKwDD1szTv0zLgKkhRhlJ6wpm2bmKjGlyBp24S18P2Hd2F9hu3WzYaWyC54WjjcKJbrxjc9YgcBI+lLlSFnQZ6RbPhmQNee3rMkoIqi+LE=----ATTACHMENT:----NjQ2NzEwNTYzMjQ4Mjk1OCAzOTA0NDM1Njg5OTAxMTU1IDMxNjI4MDUyNTM5NzE5ODA=