/** * Parse request body * * @param Request $request * @param EnvironmentInterface $environment * @return mixed|null */ private function parseBody(Request $request, EnvironmentInterface $environment) { if (null === $environment->getBodyType()) { return null; } $decoder = $environment->getDecoder(); if ($decoder instanceof DecoderInterface) { $decoder->setContentType($environment->getBodyType()); } return $decoder->decode($request->getContent()); }
/** * @inheritdoc */ protected function getMediaType() { return $this->environment->getEncoderMediaType(); }