src/fs/entity/DirEntity.php
public function isEmpty()
    {
        if ($this->test(\sndsgd\Fs::EXISTS | \sndsgd\Fs::READABLE) === false) {
            throw new \RuntimeException(
                "failed to determine if a directory is empty; ".$this->getError()
            );
        }

        return count(scandir($this->path)) === 2;
    }
public function isEmpty()
    {
        if ($this->test(\sndsgd\Fs::EXISTS | \sndsgd\Fs::READABLE) === false) {
            throw new \RuntimeException(
                "failed to determine if a directory is empty; ".$this->getError()
            );
        }

        return count(scandir($this->path)) === 2;
    }
Determine if a directory is empty

@return bool
@throws \RuntimeException If the directory does not exist or is not readable