Example #1
0
 public function open(AccessMode $mode)
 {
     if ($mode->allowsRead()) {
         throw new \LogicException(sprintf('The stream "%s" is not readable.', 'php://output'));
     }
     return parent::open($mode);
 }
Example #2
0
 public function getMetadata($key = null)
 {
     $this->assertOpen();
     $meta = ['timed_out' => false, 'blocked' => false, 'eof' => $this->isEof(), 'unread_bytes' => 0, 'stream_type' => 'MEMORY', 'wrapper_type' => '', 'wrapper_data' => null, 'mode' => $this->mode->getMode(), 'seekable' => false, 'uri' => 'binsoul://null'];
     if ($key === null) {
         return $meta;
     }
     if (!array_key_exists($key, $meta)) {
         return;
     }
     return $meta[$key];
 }
Example #3
0
 public function isWritable()
 {
     $this->assertOpen();
     return $this->mode->allowsWrite();
 }