private function assertMode($stream, $mode): bool
    {
        $meta = stream_get_meta_data($stream);

        return strpos($meta['mode'], $mode) !== false;
    }
private function assertMode($stream, $mode): bool
    {
        $meta = stream_get_meta_data($stream);

        return strpos($meta['mode'], $mode) !== false;
    }
private function assertMode ( $ stream , $ mode ) : bool { $ meta = stream_get_meta_data ( $ stream ) ; return strpos ( $ meta [ 'mode' ] , $ mode ) !== false ; }
Checks if stream is writable or readable.

@param resource $stream
@param string   $mode

@return bool
Checks if stream is writable or readable .