public function getType($name)
    {
        if (false === $this->hasType($name)) {
            throw new InvalidArgumentException(sprintf('The type "%s" was not found.', $name));
        }
        if (isset($this->loaded[$name])) {
            return $this->loaded[$name];
        }
        $fqcn = $this->types[$name];
        $type = new $fqcn;

        if (!$type instanceof TypeInterface) {
            throw new InvalidArgumentException(sprintf('The class "%s" must implement the "%s\\Types\TypeInterface"', $fqcn, __NAMESPACE__));
        }

        return $this->loaded[$name] = new $fqcn;
    }
public function getType($name)
    {
        if (false === $this->hasType($name)) {
            throw new InvalidArgumentException(sprintf('The type "%s" was not found.', $name));
        }
        if (isset($this->loaded[$name])) {
            return $this->loaded[$name];
        }
        $fqcn = $this->types[$name];
        $type = new $fqcn;

        if (!$type instanceof TypeInterface) {
            throw new InvalidArgumentException(sprintf('The class "%s" must implement the "%s\\Types\TypeInterface"', $fqcn, __NAMESPACE__));
        }

        return $this->loaded[$name] = new $fqcn;
    }
public function getType ( $ name ) { if ( false === $ this -> hasType ( $ name ) ) { throw new InvalidArgumentException ( sprintf ( 'The type "%s" was not found.' , $ name ) ) ; } if ( isset ( $ this -> loaded [ $ name ] ) ) { return $ this -> loaded [ $ name ] ; } $ fqcn = $ this -> types [ $ name ] ; $ type = new $ fqcn ; if ( ! $ type instanceof TypeInterface ) { throw new InvalidArgumentException ( sprintf ( 'The class "%s" must implement the "%s\\Types\TypeInterface"' , $ fqcn , __NAMESPACE__ ) ) ; } return $ this -> loaded [ $ name ] = new $ fqcn ; }
Gets a type object.

@param   string      $name
@return  DataTypes\Types\Type
@throws  InvalidArgumentException    If the type wasn't found.
Gets a type object .