public function getDescriptorByName(string $bundleName): ?Descriptor
    {
        if (!$this->isEmpty()) {
            /** @var Descriptor $descriptor */
            foreach ($this as $rootNamespace => $descriptor) {
                $name = $descriptor->getName();

                if ($bundleName === $name) {
                    return $descriptor;
                }
            }
        }

        return null;
    }