private function namespaces(): \Generator
    {
        foreach ($this->map() as $namespace => $directories) {
            if ($this->isValidNamespace($namespace, $directories)) {
                yield new Psr4Namespace($namespace, ...$directories);
            }
        }
    }