コード例 #1
0
 /**
  * @param string $urlSuffixString
  * @return string
  * @throws GetRedirectUrlException
  */
 public function get($urlSuffixString)
 {
     $shortenedUrlSuffix = $this->shortenedUrlSuffixRepo->findBySuffix($urlSuffixString);
     if (null === $shortenedUrlSuffix) {
         throw new GetRedirectUrlException("Url does not exist");
     }
     $this->registerUrlCallService->register($shortenedUrlSuffix);
     return $this->urlEncoder->decode($shortenedUrlSuffix->getOriginalUrlEncodedLink());
 }
コード例 #2
0
 /**
  * @param string $shortened
  * @return bool
  */
 private function isShortenedUnavailable($shortened)
 {
     $entity = $this->shortenedUrlSuffixRepo->findBySuffix($shortened);
     return null === $entity ? false : true;
 }