public static function overrideType($type, $class)
    {
        if (!static::hasType($type)) {
            throw TypeException::typeDoesNotExist($type);
        }

        if (!class_exists($class)) {
            throw TypeException::classNotFound($class);
        }

        if (!in_array('Fridge\DBAL\Type\TypeInterface', class_implements($class))) {
            throw TypeException::typeMustImplementTypeInterface($class);
        }

        if (isset(static::$mappedTypeInstances[$type])) {
            unset(static::$mappedTypeInstances[$type]);
        }

        static::$mappedTypeClasses[$type] = $class;
    }