private function parseNamespaces(array $config, string $root): Generator
    {
        foreach ($config as $name => $paths) {
            $paths = is_array($paths) ? $paths : [$paths];
            foreach ($paths as $path) {
                $path = realpath($root . '/' . $path);
                if (!$path) {
                    continue;
                }
                yield new Psr4Namespace($name, $path);
            }
        }
    }