public static function normalizeType(string $type): string
    {
        switch ($type) {
            case self::DATA_TYPE_INT:
            case self::DATA_TYPE_BIGINT:
            case self::DATA_TYPE_TINYINT:
            case self::DATA_TYPE_SMALLINT:
            case self::DATA_TYPE_MEDIUMINT:
            case self::DATA_TYPE_INTEGER:
            case self::DATA_TYPE_SERIAL:
            case self::DATA_TYPE_BIGSERIAL:
                return 'int';
            case self::DATA_TYPE_FLOAT:
            case self::DATA_TYPE_DECIMAL:
            case self::DATA_TYPE_DOUBLE:
            case self::DATA_TYPE_DOUBLEP:
            case self::DATA_TYPE_REAL:
            case self::DATA_TYPE_NUMERIC:
                return 'float';
            case self::DATA_TYPE_BOOLEAN:
                return 'bool';
            case self::DATA_TYPE_BIT:
                return 'bit';
        }

        // all others
        return 'string';
    }
public static function normalizeType(string $type): string
    {
        switch ($type) {
            case self::DATA_TYPE_INT:
            case self::DATA_TYPE_BIGINT:
            case self::DATA_TYPE_TINYINT:
            case self::DATA_TYPE_SMALLINT:
            case self::DATA_TYPE_MEDIUMINT:
            case self::DATA_TYPE_INTEGER:
            case self::DATA_TYPE_SERIAL:
            case self::DATA_TYPE_BIGSERIAL:
                return 'int';
            case self::DATA_TYPE_FLOAT:
            case self::DATA_TYPE_DECIMAL:
            case self::DATA_TYPE_DOUBLE:
            case self::DATA_TYPE_DOUBLEP:
            case self::DATA_TYPE_REAL:
            case self::DATA_TYPE_NUMERIC:
                return 'float';
            case self::DATA_TYPE_BOOLEAN:
                return 'bool';
            case self::DATA_TYPE_BIT:
                return 'bit';
        }

        // all others
        return 'string';
    }
public static function normalizeType ( string $ type ) : string { switch ( $ type ) { case self :: DATA_TYPE_INT : case self :: DATA_TYPE_BIGINT : case self :: DATA_TYPE_TINYINT : case self :: DATA_TYPE_SMALLINT : case self :: DATA_TYPE_MEDIUMINT : case self :: DATA_TYPE_INTEGER : case self :: DATA_TYPE_SERIAL : case self :: DATA_TYPE_BIGSERIAL : return 'int' ; case self :: DATA_TYPE_FLOAT : case self :: DATA_TYPE_DECIMAL : case self :: DATA_TYPE_DOUBLE : case self :: DATA_TYPE_DOUBLEP : case self :: DATA_TYPE_REAL : case self :: DATA_TYPE_NUMERIC : return 'float' ; case self :: DATA_TYPE_BOOLEAN : return 'bool' ; case self :: DATA_TYPE_BIT : return 'bit' ; } // all others return 'string' ; }
Normalize type.
@param  string $type
@return string
Normalize type .