コード例 #1
0
ファイル: Sender.php プロジェクト: appsco/component-jwt-api
 /**
  * @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()));
     }
 }