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;
    }
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;
    }
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 ; }
Returns descriptor of bundle with given name

@param string $bundleName Name of bundle who descriptor should be returned
@return null|Descriptor
Returns descriptor of bundle with given name