src/fs/entity/DirEntity.php
public function remove(): bool
    {
        if ($this->test(\sndsgd\Fs::EXISTS | \sndsgd\Fs::READABLE | \sndsgd\Fs::WRITABLE) === false) {
            $this->error = "failed to remove directory; {$this->error}";
            return false;
        }

        foreach ($this->getList() as $entity) {
            if ($entity->remove() === false) {
                $this->error = $entity->getError();
                return false;
            }
        }

        if (@rmdir($this->path) === false) {
            $this->setError("failed to remove directory '{$this->path}'");
            return false;
        }

        return true;
    }
public function remove(): bool
    {
        if ($this->test(\sndsgd\Fs::EXISTS | \sndsgd\Fs::READABLE | \sndsgd\Fs::WRITABLE) === false) {
            $this->error = "failed to remove directory; {$this->error}";
            return false;
        }

        foreach ($this->getList() as $entity) {
            if ($entity->remove() === false) {
                $this->error = $entity->getError();
                return false;
            }
        }

        if (@rmdir($this->path) === false) {
            $this->setError("failed to remove directory '{$this->path}'");
            return false;
        }

        return true;
    }
Recursively remove the directory

@return bool