public static function walkDir(string $path, callable $callback): void
    {
        $realPath = realpath($path);
        if (!is_string($realPath) || !is_dir($realPath)) {
            throw new InvalidArgumentException(sprintf(
                "Passed path \"%s\" (%s) isn't a directory",
                $path,
                var_export($realPath, true)
            ));
        }
        $dir = new RecursiveDirectoryIterator(
            $realPath,
            RecursiveDirectoryIterator::SKIP_DOTS
        );
        $files = iterator_to_array(new RecursiveIteratorIterator(
            $dir,
            RecursiveIteratorIterator::CHILD_FIRST
        ));
        array_walk($files, $callback, ["path" => $path]);
    }