Skip to content

Commit

Permalink
Fixed code as per given instrunction in codacy
Browse files Browse the repository at this point in the history
  • Loading branch information
Janak committed Feb 12, 2019
1 parent bd1e538 commit a886103
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions app/code/Magento/UrlRewrite/Model/StoreSwitcher/RewriteUrl.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,14 @@ public function switch(StoreInterface $fromStore, StoreInterface $targetStore, s
UrlRewrite::TARGET_PATH => $oldRewrite->getTargetPath(),
UrlRewrite::STORE_ID => $targetStore->getId(),
]);

if (null === $currentRewrites || empty($currentRewrites)) {
/** @var \Magento\Framework\App\Response\Http $response */
$targetUrl = $targetStore->getBaseUrl();
} else {
foreach($currentRewrites as $rewrite) {
$targetUrl = $targetStore->getBaseUrl() . $rewrite->getRequestPath();
break;
}
return $targetUrl;
}
foreach ($currentRewrites as $rewrite) {
$targetUrl = $targetStore->getBaseUrl() . $rewrite->getRequestPath();
break;
}
}

Expand Down

0 comments on commit a886103

Please sign in to comment.