public function getReader($contentType, $readerType = null, array $supportedReader = null)
    {
        if ($readerType === null) {
            $reader = $this->config->getReaderFactory()->getReaderByContentType($contentType, $supportedReader);
        } else {
            $reader = $this->config->getReaderFactory()->getReaderByInstance($readerType);
        }

        if ($reader === null) {
            $reader = $this->config->getReaderFactory()->getDefaultReader($supportedReader);
        }

        if (!$reader instanceof ReaderInterface) {
            throw new StatusCode\UnsupportedMediaTypeException('Could not find fitting data reader');
        }

        return $reader;
    }
public function getReader($contentType, $readerType = null, array $supportedReader = null)
    {
        if ($readerType === null) {
            $reader = $this->config->getReaderFactory()->getReaderByContentType($contentType, $supportedReader);
        } else {
            $reader = $this->config->getReaderFactory()->getReaderByInstance($readerType);
        }

        if ($reader === null) {
            $reader = $this->config->getReaderFactory()->getDefaultReader($supportedReader);
        }

        if (!$reader instanceof ReaderInterface) {
            throw new StatusCode\UnsupportedMediaTypeException('Could not find fitting data reader');
        }

        return $reader;
    }
public function getReader ( $ contentType , $ readerType = null , array $ supportedReader = null ) { if ( $ readerType === null ) { $ reader = $ this -> config -> getReaderFactory ( ) -> getReaderByContentType ( $ contentType , $ supportedReader ) ; } else { $ reader = $ this -> config -> getReaderFactory ( ) -> getReaderByInstance ( $ readerType ) ; } if ( $ reader === null ) { $ reader = $ this -> config -> getReaderFactory ( ) -> getDefaultReader ( $ supportedReader ) ; } if ( ! $ reader instanceof ReaderInterface ) { throw new StatusCode \ UnsupportedMediaTypeException ( 'Could not find fitting data reader' ) ; } return $ reader ; }
Returns a fitting reader for the given content type or throws an
unsupported media exception. It is also possible to explicit select a
reader by providing the class name as reader type.

@param string $contentType
@param string $readerType
@param array $supportedReader
@return \PSX\Data\ReaderInterface
Returns a fitting reader for the given content type or throws an unsupported media exception . It is also possible to explicit select a reader by providing the class name as reader type .