src/Stream.php
protected function _ensureWritable()
    {
        if (!$this->valid()) {
            throw new RuntimeException('Cannot write on a closed stream.');
        }
        if (!$this->isWritable()) {
            $mode = $this->meta('mode');
            throw new RuntimeException("Cannot write on a non-writable stream (mode is `'{$mode}'`).");
        }
    }
protected function _ensureWritable()
    {
        if (!$this->valid()) {
            throw new RuntimeException('Cannot write on a closed stream.');
        }
        if (!$this->isWritable()) {
            $mode = $this->meta('mode');
            throw new RuntimeException("Cannot write on a non-writable stream (mode is `'{$mode}'`).");
        }
    }
protected function _ensureWritable ( ) { if ( ! $ this -> valid ( ) ) { throw new RuntimeException ( 'Cannot write on a closed stream.' ) ; } if ( ! $ this -> isWritable ( ) ) { $ mode = $ this -> meta ( 'mode' ) ; throw new RuntimeException ( "Cannot write on a non-writable stream (mode is `'{$mode}'`)." ) ; } }
Throw an exception if a stream is not writable.
Throw an exception if a stream is not writable .