protected function getStream($path, $mode)
    {
        switch ($mode[0]) {
            case 'r':
                $this->needsCowCheck = true;

                return $this->getFilesystem()->readStream($path);

            case 'w':
                $this->needsFlush = true;

                return fopen('php://temp', 'w+b');

            case 'a':
                return $this->getAppendStream($path);

            case 'x':
                return $this->getXStream($path);

            case 'c':
                return $this->getWritableStream($path);
        }

        return false;
    }
protected function getStream($path, $mode)
    {
        switch ($mode[0]) {
            case 'r':
                $this->needsCowCheck = true;

                return $this->getFilesystem()->readStream($path);

            case 'w':
                $this->needsFlush = true;

                return fopen('php://temp', 'w+b');

            case 'a':
                return $this->getAppendStream($path);

            case 'x':
                return $this->getXStream($path);

            case 'c':
                return $this->getWritableStream($path);
        }

        return false;
    }
protected function getStream ( $ path , $ mode ) { switch ( $ mode [ 0 ] ) { case 'r' : $ this -> needsCowCheck = true ; return $ this -> getFilesystem ( ) -> readStream ( $ path ) ; case 'w' : $ this -> needsFlush = true ; return fopen ( 'php://temp' , 'w+b' ) ; case 'a' : return $ this -> getAppendStream ( $ path ) ; case 'x' : return $ this -> getXStream ( $ path ) ; case 'c' : return $ this -> getWritableStream ( $ path ) ; } return false ; }
Returns a stream for a given path and mode.

@param string $path The path to open.
@param string $mode The mode to open the stream in.

@return resource|bool The file handle, or false.

@throws \League\Flysystem\FileNotFoundException
Returns a stream for a given path and mode .