| 1 | <?php |
||
| 13 | class WritableStream extends BaseStream implements WritableStreamInterface |
||
| 14 | { |
||
| 15 | 30 | public function __construct() |
|
| 19 | |||
| 20 | /** |
||
| 21 | * {@inheritDoc} |
||
| 22 | */ |
||
| 23 | 2 | public function write($data) |
|
| 26 | |||
| 27 | /** |
||
| 28 | * {@inheritDoc} |
||
| 29 | */ |
||
| 30 | 9 | public function end($data = null) : self |
|
| 31 | { |
||
| 32 | 9 | if (null !== $data) { |
|
| 33 | 3 | $this->write($data); |
|
| 34 | } |
||
| 35 | |||
| 36 | 9 | $this->close(); |
|
| 37 | |||
| 38 | 9 | return $this; |
|
| 39 | } |
||
| 40 | |||
| 41 | /** |
||
| 42 | * {@inheritDoc} |
||
| 43 | */ |
||
| 44 | 10 | public function isWritable() : bool |
|
| 48 | } |
||
| 49 |