Open Journal Systems  3.3.0
StreamDecorator.php
1 <?php
2 
3 namespace Http\Message\Decorator;
4 
6 
12 trait StreamDecorator
13 {
17  protected $stream;
18 
22  public function __toString()
23  {
24  return $this->stream->__toString();
25  }
26 
30  public function close()
31  {
32  $this->stream->close();
33  }
34 
38  public function detach()
39  {
40  return $this->stream->detach();
41  }
42 
46  public function getSize()
47  {
48  return $this->stream->getSize();
49  }
50 
54  public function tell()
55  {
56  return $this->stream->tell();
57  }
58 
62  public function eof()
63  {
64  return $this->stream->eof();
65  }
66 
70  public function isSeekable()
71  {
72  return $this->stream->isSeekable();
73  }
74 
78  public function seek($offset, $whence = SEEK_SET)
79  {
80  $this->stream->seek($offset, $whence);
81  }
82 
86  public function rewind()
87  {
88  $this->stream->rewind();
89  }
90 
94  public function isWritable()
95  {
96  return $this->stream->isWritable();
97  }
98 
102  public function write($string)
103  {
104  return $this->stream->write($string);
105  }
106 
110  public function isReadable()
111  {
112  return $this->stream->isReadable();
113  }
114 
118  public function read($length)
119  {
120  return $this->stream->read($length);
121  }
122 
126  public function getContents()
127  {
128  return $this->stream->getContents();
129  }
130 
134  public function getMetadata($key = null)
135  {
136  return $this->stream->getMetadata($key);
137  }
138 }
Http\Message\Decorator\isWritable
isWritable()
Definition: StreamDecorator.php:97
Http\Message\Decorator\isReadable
isReadable()
Definition: StreamDecorator.php:113
Http\Message\Decorator\close
close()
Definition: StreamDecorator.php:33
Psr\Http\Message\StreamInterface
Definition: vendor/psr/http-message/src/StreamInterface.php:12
Http\Message\Decorator\tell
tell()
Definition: StreamDecorator.php:57
Http\Message\Decorator
Definition: MessageDecorator.php:3
Http\Message\Decorator\getMetadata
getMetadata($key=null)
Definition: StreamDecorator.php:137
Http\Message\Decorator\write
write($string)
Definition: StreamDecorator.php:105
Http\Message\Decorator\rewind
rewind()
Definition: StreamDecorator.php:89
Http\Message\Decorator\getContents
getContents()
Definition: StreamDecorator.php:129
Http\Message\Decorator\seek
seek($offset, $whence=SEEK_SET)
Definition: StreamDecorator.php:81
Http\Message\Decorator\StreamDecorator
trait StreamDecorator
Definition: StreamDecorator.php:13
Http\Message\Decorator\read
read($length)
Definition: StreamDecorator.php:121
Http\Message\Decorator\getSize
getSize()
Definition: StreamDecorator.php:49
Http\Message\Decorator\eof
eof()
Definition: StreamDecorator.php:65
Http\Message\Decorator\detach
detach()
Definition: StreamDecorator.php:41
Http\Message\Decorator\__toString
__toString()
Definition: StreamDecorator.php:25
Http\Message\Decorator\isSeekable
isSeekable()
Definition: StreamDecorator.php:73