protected function negotiateVCard($input, &$mimeType = null)
    {
        $result = HTTP\negotiateContentType(
            $input,
            [
                // Most often used mime-type. Version 3
                'text/x-vcard',
                // The correct standard mime-type. Defaults to version 3 as
                // well.
                'text/vcard',
                // vCard 4
                'text/vcard; version=4.0',
                // vCard 3
                'text/vcard; version=3.0',
                // jCard
                'application/vcard+json',
            ]
        );

        $mimeType = $result;
        switch ($result) {
            default:
            case 'text/x-vcard':
            case 'text/vcard':
            case 'text/vcard; version=3.0':
                $mimeType = 'text/vcard';

                return 'vcard3';
            case 'text/vcard; version=4.0':
                return 'vcard4';
            case 'application/vcard+json':
                return 'jcard';

        // @codeCoverageIgnoreStart
        }
        // @codeCoverageIgnoreEnd
    }
protected function negotiateVCard($input, &$mimeType = null)
    {
        $result = HTTP\negotiateContentType(
            $input,
            [
                // Most often used mime-type. Version 3
                'text/x-vcard',
                // The correct standard mime-type. Defaults to version 3 as
                // well.
                'text/vcard',
                // vCard 4
                'text/vcard; version=4.0',
                // vCard 3
                'text/vcard; version=3.0',
                // jCard
                'application/vcard+json',
            ]
        );

        $mimeType = $result;
        switch ($result) {
            default:
            case 'text/x-vcard':
            case 'text/vcard':
            case 'text/vcard; version=3.0':
                $mimeType = 'text/vcard';

                return 'vcard3';
            case 'text/vcard; version=4.0':
                return 'vcard4';
            case 'application/vcard+json':
                return 'jcard';

        // @codeCoverageIgnoreStart
        }
        // @codeCoverageIgnoreEnd
    }
protected function negotiateVCard ( $ input , & $ mimeType = null ) { $ result = HTTP \ negotiateContentType ( $ input , [ // Most often used mime-type. Version 3 'text/x-vcard' , // The correct standard mime-type. Defaults to version 3 as // well. 'text/vcard' , // vCard 4 'text/vcard; version=4.0' , // vCard 3 'text/vcard; version=3.0' , // jCard 'application/vcard+json' , ] ) ; $ mimeType = $ result ; switch ( $ result ) { default : case 'text/x-vcard' : case 'text/vcard' : case 'text/vcard; version=3.0' : $ mimeType = 'text/vcard' ; return 'vcard3' ; case 'text/vcard; version=4.0' : return 'vcard4' ; case 'application/vcard+json' : return 'jcard' ; // @codeCoverageIgnoreStart } // @codeCoverageIgnoreEnd }
This helper function performs the content-type negotiation for vcards.

It will return one of the following strings:
1. vcard3
2. vcard4
3. jcard

It defaults to vcard3.

@param string $input
@param string $mimeType

@return string
This helper function performs the content - type negotiation for vcards .