public function rmdir(string $path, int $options): bool
    {
        $path = $this->resolvePath(vfsStream::path($path));

        /** @var vfsStreamDirectory|null $child */
        $child = $this->getContentOfType($path, vfsStreamContent::TYPE_DIR);
        if (null === $child) {
            return false;
        }

        // can only remove empty directories
        if (count($child->getChildren()) > 0) {
            return false;
        }

        if (self::$root->getName() === $path) {
            // delete root? very brave. :)
            self::$root = null;
            clearstatcache();
            return true;
        }

        $names = $this->splitPath($path);

        /** @var vfsStreamDirectory $dir */
        $dir = $this->getContentOfType($names['dirname'], vfsStreamContent::TYPE_DIR);
        if ($dir->isWritable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup()) === false) {
            return false;
        }

        clearstatcache();
        return $dir->removeChild($child->getName());
    }
public function rmdir(string $path, int $options): bool
    {
        $path = $this->resolvePath(vfsStream::path($path));

        /** @var vfsStreamDirectory|null $child */
        $child = $this->getContentOfType($path, vfsStreamContent::TYPE_DIR);
        if (null === $child) {
            return false;
        }

        // can only remove empty directories
        if (count($child->getChildren()) > 0) {
            return false;
        }

        if (self::$root->getName() === $path) {
            // delete root? very brave. :)
            self::$root = null;
            clearstatcache();
            return true;
        }

        $names = $this->splitPath($path);

        /** @var vfsStreamDirectory $dir */
        $dir = $this->getContentOfType($names['dirname'], vfsStreamContent::TYPE_DIR);
        if ($dir->isWritable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup()) === false) {
            return false;
        }

        clearstatcache();
        return $dir->removeChild($child->getName());
    }
public function rmdir ( string $ path , int $ options ) : bool { $ path = $ this -> resolvePath ( vfsStream :: path ( $ path ) ) ; /** @var vfsStreamDirectory|null $child */ $ child = $ this -> getContentOfType ( $ path , vfsStreamContent :: TYPE_DIR ) ; if ( null === $ child ) { return false ; } // can only remove empty directories if ( count ( $ child -> getChildren ( ) ) > 0 ) { return false ; } if ( self :: $ root -> getName ( ) === $ path ) { // delete root? very brave. :) self :: $ root = null ; clearstatcache ( ) ; return true ; } $ names = $ this -> splitPath ( $ path ) ; /** @var vfsStreamDirectory $dir */ $ dir = $ this -> getContentOfType ( $ names [ 'dirname' ] , vfsStreamContent :: TYPE_DIR ) ; if ( $ dir -> isWritable ( vfsStream :: getCurrentUser ( ) , vfsStream :: getCurrentGroup ( ) ) === false ) { return false ; } clearstatcache ( ) ; return $ dir -> removeChild ( $ child -> getName ( ) ) ; }
removes a directory

@param   string  $path
@param   int     $options
@return  bool
@todo    consider $options with STREAM_MKDIR_RECURSIVE
removes a directory