public function getFormatClass($format = '')
    {
        if ( ! empty($format)) {
            return $this->processContentType($format);
        }

        if (isset($_SERVER['CONTENT_TYPE'])) {
            $type = $this->processContentType($_SERVER['CONTENT_TYPE']);
            if ($type !== false) {
                return $type;
            }
        }

        if (isset($_SERVER['HTTP_CONTENT_TYPE'])) {
            $type = $this->processContentType($_SERVER['HTTP_CONTENT_TYPE']);
            if ($type !== false) {
                return $type;
            }
        }

        return 'Nathanmac\Utilities\Parser\Formats\JSON';
    }
public function getFormatClass($format = '')
    {
        if ( ! empty($format)) {
            return $this->processContentType($format);
        }

        if (isset($_SERVER['CONTENT_TYPE'])) {
            $type = $this->processContentType($_SERVER['CONTENT_TYPE']);
            if ($type !== false) {
                return $type;
            }
        }

        if (isset($_SERVER['HTTP_CONTENT_TYPE'])) {
            $type = $this->processContentType($_SERVER['HTTP_CONTENT_TYPE']);
            if ($type !== false) {
                return $type;
            }
        }

        return 'Nathanmac\Utilities\Parser\Formats\JSON';
    }
public function getFormatClass ( $ format = '' ) { if ( ! empty ( $ format ) ) { return $ this -> processContentType ( $ format ) ; } if ( isset ( $ _SERVER [ 'CONTENT_TYPE' ] ) ) { $ type = $ this -> processContentType ( $ _SERVER [ 'CONTENT_TYPE' ] ) ; if ( $ type !== false ) { return $ type ; } } if ( isset ( $ _SERVER [ 'HTTP_CONTENT_TYPE' ] ) ) { $ type = $ this -> processContentType ( $ _SERVER [ 'HTTP_CONTENT_TYPE' ] ) ; if ( $ type !== false ) { return $ type ; } } return 'Nathanmac\Utilities\Parser\Formats\JSON' ; }
Autodetect the payload data type using content-type value.

@return string Return the name of the formatter class.
Autodetect the payload data type using content - type value .