public static function isDirEmpty(string $path) : bool
    {
        //che if no such dir, not a dir, not readable
        if (!self::isReadable($path)) {
            return false;
        }

        $result = true;
        $handle = opendir($path);
        while (false !== ($entry = readdir($handle))) {
            if (!self::isDotDir($entry)) {
                $result = false;
                break;
            }
        }
        closedir($handle);
        return $result;
    }