src/php/main/Eix/Core/Requests/Http.php
public static function getContentTypeToken($contentType)
    {
        $token = null;
        switch ($contentType) {
            case 'text/html':
                $token = 'Html';
                break;
            /*
            case 'application/xhtml+xml':
                $token = 'Xhtml';
                break;
                */
            case 'application/json':
            case 'text/json':
                $token = 'Json';
                break;
            case 'application/xml':
            case 'text/xml':
                $token = 'Xml';
                break;
            case 'image/png':
            case 'image/jpeg':
            case 'image/*':
                $token = 'Image';
                break;
            case '*/*':
                $token = 'All';
                break;
            default:
                throw new \InvalidArgumentException("Content type '{$contentType}' is not supported.");
        }

        return $token;
    }
public static function getContentTypeToken($contentType)
    {
        $token = null;
        switch ($contentType) {
            case 'text/html':
                $token = 'Html';
                break;
            /*
            case 'application/xhtml+xml':
                $token = 'Xhtml';
                break;
                */
            case 'application/json':
            case 'text/json':
                $token = 'Json';
                break;
            case 'application/xml':
            case 'text/xml':
                $token = 'Xml';
                break;
            case 'image/png':
            case 'image/jpeg':
            case 'image/*':
                $token = 'Image';
                break;
            case '*/*':
                $token = 'All';
                break;
            default:
                throw new \InvalidArgumentException("Content type '{$contentType}' is not supported.");
        }

        return $token;
    }
public static function getContentTypeToken ( $ contentType ) { $ token = null ; switch ( $ contentType ) { case 'text/html' : $ token = 'Html' ; break ; /*
            case 'application/xhtml+xml':
                $token = 'Xhtml';
                break;
                */ case 'application/json' : case 'text/json' : $ token = 'Json' ; break ; case 'application/xml' : case 'text/xml' : $ token = 'Xml' ; break ; case 'image/png' : case 'image/jpeg' : case 'image/*' : $ token = 'Image' ; break ; case '*/*' : $ token = 'All' ; break ; default : throw new \ InvalidArgumentException ( "Content type '{$contentType}' is not supported." ) ; } return $ token ; }
Produces a token that uniquely identifies a content type and can be used
as part of a method name.

@param string $contentType the content type to get a token for.
@param string $default     a default content type
Produces a token that uniquely identifies a content type and can be used as part of a method name .