public static function getType($value)
    {
        if ($value === null) {
            return null;
        }

        $type = gettype($value);
        if (is_array($value) && !empty($value)) {
            $arrayType = null;
            foreach ($value as $entry) {
                if ($arrayType == null) {
                    $arrayType = self::getType($entry);
                } else {
                    return "mixed[]";
                }
            }
            return $arrayType . "[]";
        } elseif ($type == 'object') {
            return get_class($value);
        }

        return self::mapToBuiltInType($type);
    }