/** * @param JwtContext $context * @throws \BWC\Component\JwtApiBundle\Error\JwtException * @return Response */ public function send(JwtContext $context) { if (!$context->getResponseBindingType()) { $this->setResponseBindingType($context); } switch ($context->getResponseBindingType()) { case JwtBindingTypes::HTTP_REDIRECT: return $this->sendRedirect($context); case JwtBindingTypes::HTTP_POST: return $this->sendPost($context); case JwtBindingTypes::CONTENT: return $this->sendContent($context); default: throw new JwtException(sprintf("Unknown binding '%s'", $context->getResponseBindingType())); } }