Пример #1
0
 /**
  * Implements chain of responsibility logic, if current handler could
  * manage the current message then do it, if not, then pass msg to next sibling
  * @param OpenIdMessage $message
  * @return mixed
  * @throws InvalidOpenIdMessageException
  */
 public function handleMessage(OpenIdMessage $message)
 {
     if ($this->canHandle($message)) {
         //handle request
         return $this->internalHandle($message);
     } else {
         if (isset($this->successor) && !is_null($this->successor)) {
             return $this->successor->handleMessage($message);
         }
     }
     $this->log_service->warning_msg(sprintf(OpenIdErrorMessages::UnhandledMessage, $message->toString()));
     $ex = new InvalidOpenIdMessageException(sprintf(OpenIdErrorMessages::UnhandledMessage, $message->toString()));
     $this->checkpoint_service->trackException($ex);
     throw $ex;
 }