public function confirmMediaType($uriRetriever, $uri)
    {
        $contentType = $uriRetriever->getContentType();

        if (is_null($contentType)) {
            // Well, we didn't get an invalid one
            return;
        }

        if (in_array($contentType, array(Validator::SCHEMA_MEDIA_TYPE, 'application/json'))) {
            return;
        }

        foreach ($this->allowedInvalidContentTypeEndpoints as $endpoint) {
            if (strpos($uri, $endpoint) === 0) {
                return true;
            }
        }

        throw new InvalidSchemaMediaTypeException(sprintf('Media type %s expected', Validator::SCHEMA_MEDIA_TYPE));
    }
public function confirmMediaType($uriRetriever, $uri)
    {
        $contentType = $uriRetriever->getContentType();

        if (is_null($contentType)) {
            // Well, we didn't get an invalid one
            return;
        }

        if (in_array($contentType, array(Validator::SCHEMA_MEDIA_TYPE, 'application/json'))) {
            return;
        }

        foreach ($this->allowedInvalidContentTypeEndpoints as $endpoint) {
            if (strpos($uri, $endpoint) === 0) {
                return true;
            }
        }

        throw new InvalidSchemaMediaTypeException(sprintf('Media type %s expected', Validator::SCHEMA_MEDIA_TYPE));
    }
public function confirmMediaType ( $ uriRetriever , $ uri ) { $ contentType = $ uriRetriever -> getContentType ( ) ; if ( is_null ( $ contentType ) ) { // Well, we didn't get an invalid one return ; } if ( in_array ( $ contentType , array ( Validator :: SCHEMA_MEDIA_TYPE , 'application/json' ) ) ) { return ; } foreach ( $ this -> allowedInvalidContentTypeEndpoints as $ endpoint ) { if ( strpos ( $ uri , $ endpoint ) === 0 ) { return true ; } } throw new InvalidSchemaMediaTypeException ( sprintf ( 'Media type %s expected' , Validator :: SCHEMA_MEDIA_TYPE ) ) ; }
Guarantee the correct media type was encountered

@param UriRetrieverInterface $uriRetriever
@param string                $uri

@return bool|void
Guarantee the correct media type was encountered