/**
  * @param Request $request
  * @return LogoutResponse
  * @throws \InvalidArgumentException
  */
 protected function getLogoutResponse(Request $request)
 {
     /** @var  $logoutResponse LogoutResponse */
     $logoutResponse = $this->bindingManager->receive($request);
     if (!$logoutResponse || !$logoutResponse instanceof LogoutResponse) {
         throw new \InvalidArgumentException('Did not receive logout response');
     }
     return $logoutResponse;
 }
 protected function getSamlResponse(Request $request)
 {
     $bindingType = null;
     /** @var Response $response */
     $response = $this->bindingManager->receive($request, $bindingType);
     if ($bindingType == Bindings::SAML2_HTTP_REDIRECT) {
         throw new \RuntimeException('SAML protocol response cannot be sent via binding HTTP REDIRECT');
     }
     if (!$response instanceof Response) {
         throw new \RuntimeException('Expected Protocol/Response type but got ' . ($response ? get_class($response) : 'nothing'));
     }
     return $response;
 }
 /**
  * @param Request $request
  * @return LogoutRequest
  * @throws \InvalidArgumentException
  */
 protected function receiveRequest(Request $request)
 {
     /** @var  $logoutRequest LogoutRequest */
     $logoutRequest = $this->bindingManager->receive($request);
     if (!$logoutRequest || !$logoutRequest instanceof LogoutRequest) {
         throw new \InvalidArgumentException('Did not receive logout request');
     }
     return $logoutRequest;
 }