public function apply(EndpointInvoker $endpointInvoker, $result)
    {
        $contentType = $endpointInvoker->getRoute()->getContentType();

        foreach ($this->converters as $converter) {

            if ($converter->canHandle($contentType)) {
                return $converter->apply($endpointInvoker, $result);
            }
        }

        throw new \RuntimeException("Cannot handle contentType '{$contentType}'");
    }
public function apply(EndpointInvoker $endpointInvoker, $result)
    {
        $contentType = $endpointInvoker->getRoute()->getContentType();

        foreach ($this->converters as $converter) {

            if ($converter->canHandle($contentType)) {
                return $converter->apply($endpointInvoker, $result);
            }
        }

        throw new \RuntimeException("Cannot handle contentType '{$contentType}'");
    }
@param EndpointInvoker $endpointInvoker
@param                 $result

@return mixed