public static function symlink(string $target, string $link, string $rootDir): void
    {
        static::validateSymlink($target, $link, $rootDir);

        $fs = new Filesystem();

        if (!$fs->isAbsolutePath($target)) {
            $target = $rootDir.'/'.$target;
        }

        if (!$fs->isAbsolutePath($link)) {
            $link = $rootDir.'/'.$link;
        }

        if ('\\' === \DIRECTORY_SEPARATOR) {
            $fs->symlink($target, $link);
        } else {
            $fs->symlink(rtrim($fs->makePathRelative($target, \dirname($link)), '/'), $link);
        }
    }