src/Phapi/Serializer/Deserializer.php
protected function getContentType(ServerRequestInterface $request)
    {
        // Check for an attribute
        if (null !== $accept = $request->getAttribute('Content-Type', null)) {
            return $accept;
        }

        // Check for an accept header
        if ($request->hasHeader('Content-Type')) {
            return $request->getHeaderLine('Content-Type');
        }

        return null;
    }
protected function getContentType(ServerRequestInterface $request)
    {
        // Check for an attribute
        if (null !== $accept = $request->getAttribute('Content-Type', null)) {
            return $accept;
        }

        // Check for an accept header
        if ($request->hasHeader('Content-Type')) {
            return $request->getHeaderLine('Content-Type');
        }

        return null;
    }
protected function getContentType ( ServerRequestInterface $ request ) { // Check for an attribute if ( null !== $ accept = $ request -> getAttribute ( 'Content-Type' , null ) ) { return $ accept ; } // Check for an accept header if ( $ request -> hasHeader ( 'Content-Type' ) ) { return $ request -> getHeaderLine ( 'Content-Type' ) ; } return null ; }
Get content type from request. First check for an attribute. An attribute
is usually set if content negotiation are done.

If no attribute can be found, use the content type header.

@param ServerRequestInterface $request
@return mixed|null|string
Get content type from request . First check for an attribute . An attribute is usually set if content negotiation are done .