public function getRootNamespace()
    {
        if (($psr4 = $this->get('autoload.psr-4')) === null) {
            return null;
        }

        foreach ($psr4 as $namespace => $namespacePaths) {
            foreach ((array)$namespacePaths as $namespacePath) {
                // The namespace path should be a subdirectory of the "src" directory
                if (mb_strpos(realpath($this->rootPath . '/' . $namespacePath), realpath($this->psr4RootPath)) === 0) {
                    return rtrim($namespace, '\\');
                }
            }
        }

        return null;
    }