public static function getType($type)
    {
        if (!isset(self::$typesMap[$type])) {
            throw new \InvalidArgumentException(sprintf('Invalid type specified "%s".', $type));
        }
        if (!isset(self::$typeObjects[$type])) {
            $className                = self::$typesMap[$type];
            self::$typeObjects[$type] = new $className;
        }

        return self::$typeObjects[$type];
    }
public static function getType($type)
    {
        if (!isset(self::$typesMap[$type])) {
            throw new \InvalidArgumentException(sprintf('Invalid type specified "%s".', $type));
        }
        if (!isset(self::$typeObjects[$type])) {
            $className                = self::$typesMap[$type];
            self::$typeObjects[$type] = new $className;
        }

        return self::$typeObjects[$type];
    }
public static function getType ( $ type ) { if ( ! isset ( self :: $ typesMap [ $ type ] ) ) { throw new \ InvalidArgumentException ( sprintf ( 'Invalid type specified "%s".' , $ type ) ) ; } if ( ! isset ( self :: $ typeObjects [ $ type ] ) ) { $ className = self :: $ typesMap [ $ type ] ; self :: $ typeObjects [ $ type ] = new $ className ; } return self :: $ typeObjects [ $ type ] ; }
Get a Type instance.

@param string $type The type name.

@return Type $type

@throws \InvalidArgumentException
Get a Type instance .