/**
  * @param MessageContext $context
  *
  * @return \LightSaml\Model\Protocol\LogoutResponse
  */
 public static function asLogoutResponse(MessageContext $context)
 {
     $message = $context->getMessage();
     if ($message instanceof LogoutResponse) {
         return $message;
     }
     throw new LightSamlContextException($context, 'Expected LogoutResponse');
 }
 /**
  * @param MessageContext $context
  * @param null|string    $destination
  *
  * @return \Symfony\Component\HttpFoundation\Response
  */
 public function send(MessageContext $context, $destination = null)
 {
     $destination = $context->getMessage()->getDestination() ? $context->getMessage()->getDestination() : $destination;
     $url = $this->getRedirectURL($context, $destination);
     return new RedirectResponse($url);
 }