/**
  * @param string $id
  * @return void
  */
 public function remove($id)
 {
     if (!is_string($id)) {
         throw InvalidArgumentException::invalidType('string', 'uuid', $id);
     }
     return $this->session->remove(sprintf('%s:%s', $this->namespace, $id));
 }
 /**
  * @param $identityId
  * @return null|\Surfnet\StepupMiddlewareClientBundle\Identity\Dto\RaCandidate
  */
 public function getRaCandidateByIdentityId($identityId)
 {
     if (!is_string($identityId)) {
         throw InvalidArgumentException::invalidType('string', 'identityId', $identityId);
     }
     return $this->apiRaCandidateService->getByIdentityId($identityId);
 }
 public function forProcedure($procedure)
 {
     if (!is_string($procedure)) {
         throw InvalidArgumentException::invalidType('string', 'procedure', $procedure);
     }
     $logger = new self($this->logger);
     $logger->procedure = $procedure;
     return $logger;
 }
 /**
  * @param string $procedureId
  * @return VerificationResult
  */
 public static function verificationFailed($procedureId)
 {
     if (!is_string($procedureId)) {
         throw InvalidArgumentException::invalidType('string', 'procedureId', $procedureId);
     }
     $result = new self();
     $result->verificationSucceeded = false;
     $result->procedureId = $procedureId;
     return $result;
 }
 /**
  * @param string $documentNumber
  * @param bool $identityVerified
  * @return void
  * @throws DomainException
  */
 public function verifyIdentity($documentNumber, $identityVerified)
 {
     if (!$this->isReadyForIdentityVerification()) {
         throw new DomainException('Second factor is not yet ready for verification of its Identity; ' . 'verify the registrant has the same second factor as used during the registration process.');
     }
     if (!is_string($documentNumber)) {
         throw InvalidArgumentException::invalidType('string', 'documentNumber', $documentNumber);
     }
     if (empty($documentNumber)) {
         throw new InvalidArgumentException('Document number may not be empty.');
     }
     if ($identityVerified !== true) {
         throw new DomainException("The registrant's identity must have been confirmed by the RA.");
     }
     $this->documentNumber = $documentNumber;
     $this->identityVerified = true;
 }
 /**
  * @param string $procedureId
  * @return bool
  */
 public function hasProcedure($procedureId)
 {
     if (!is_string($procedureId)) {
         throw InvalidArgumentException::invalidType('string', 'procedureId', $procedureId);
     }
     return $this->vettingProcedureRepository->retrieve($procedureId) !== null;
 }