public function getFlattenedRequiredPackages()
    {
        $result = [];
        foreach ($this->getRequiredPackages() as $dependency) {
            $name          = $dependency->getPackage()->getName();
            $result[$name] = $dependency;
            $result        = array_merge($result, $dependency->getFlattenedRequiredPackages());
        }
        return $result;
    }