public function registerEncoder(MediaTypeInterface $mediaType, Closure $encoderClosure);
/** * @param string $mediaType * @return $this */ private function withMediaType($mediaType = MediaTypeInterface::JSON_API_MEDIA_TYPE) { $mediaType = MediaType::parse(0, $mediaType); $this->codecMatcher->registerEncoder($mediaType, function () { return Encoder::instance(); }); $this->codecMatcher->registerDecoder($mediaType, function () { return new DocumentDecoder(); }); return $this; }