public function getTypeByName($name)
    {
        foreach ($this->collection as $type) {
            /** @var $type TypeInterface */
            if ($type->getName() === $name) {
                return $type;
            }
        }

        throw new \RuntimeException(\sprintf('No type found for name %s, list: %s', \var_export($name, true), \var_export($this->collection, true)));
    }
public function getTypeByName($name)
    {
        foreach ($this->collection as $type) {
            /** @var $type TypeInterface */
            if ($type->getName() === $name) {
                return $type;
            }
        }

        throw new \RuntimeException(\sprintf('No type found for name %s, list: %s', \var_export($name, true), \var_export($this->collection, true)));
    }
public function getTypeByName ( $ name ) { foreach ( $ this -> collection as $ type ) { /** @var $type TypeInterface */ if ( $ type -> getName ( ) === $ name ) { return $ type ; } } throw new \ RuntimeException ( \ sprintf ( 'No type found for name %s, list: %s' , \ var_export ( $ name , true ) , \ var_export ( $ this -> collection , true ) ) ) ; }
Retrieves a type by name

@param string $name Name of the Type to retrieve.
@return TypeInterface Returns Type matching given name if found.

@throws \RuntimeException When no type is found.
Retrieves a type by name