From d85f347b279c484bc91abd73cf25ae72fe199abe Mon Sep 17 00:00:00 2001 From: Ramzi Arfaoui Date: Tue, 11 Jun 2024 21:42:56 +0200 Subject: [PATCH] Fix return method type --- bundle/Core/Helper/ImportUrlsHelper.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/bundle/Core/Helper/ImportUrlsHelper.php b/bundle/Core/Helper/ImportUrlsHelper.php index e67760f..8ee93c1 100644 --- a/bundle/Core/Helper/ImportUrlsHelper.php +++ b/bundle/Core/Helper/ImportUrlsHelper.php @@ -161,15 +161,16 @@ public function importUrlRedirection(string $filePath): array public function checkUrlDestinationExist(string $destination): bool { - $urlExists = false; - try { - $urlExists = $this->urlWildCardService->translate($destination); + if($$this->urlWildCardService->translate($destination) instanceof URLWildcardTranslationResult) { + return true; + } + } catch (\Exception $e) { $this->logger->log(LogLevel::ERROR, $e->getMessage()); } - return $urlExists; + return false; } public function saveUrls(string $filePath, string $source, string $destination): array