public function generate()
 {
     $uid = $this->uidGenerator->generate();
     if ($this->isUsedUid($uid)) {
         return $this->generate();
     }
     return $uid;
 }
Example #2
0
 /**
  * @param string $url
  * @return Url
  */
 public function createUrl($url)
 {
     $uid = $this->uidGenerator->generate();
     $deleteToken = $this->deleteTokenGenerator->generate();
     return new Url($url, $uid, $deleteToken);
 }