From 4b228b1ae2c648894b9b53c5c6caeef0e56c6450 Mon Sep 17 00:00:00 2001 From: CoreShop Date: Mon, 23 Dec 2024 02:47:38 +0000 Subject: [PATCH] [CS] Refactor --- .../RequestBased/PimcoreAdminSiteBasedRequestResolver.php | 6 ++---- .../Context/RequestBased/PimcoreAreaBrickRenderResolver.php | 2 -- src/CoreShop/Component/Store/Context/SiteBasedResolver.php | 2 +- .../Component/Store/Context/SiteBasedResolverInterface.php | 2 +- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/CoreShop/Component/Store/Context/RequestBased/PimcoreAdminSiteBasedRequestResolver.php b/src/CoreShop/Component/Store/Context/RequestBased/PimcoreAdminSiteBasedRequestResolver.php index f2a7852794..bd154c167f 100644 --- a/src/CoreShop/Component/Store/Context/RequestBased/PimcoreAdminSiteBasedRequestResolver.php +++ b/src/CoreShop/Component/Store/Context/RequestBased/PimcoreAdminSiteBasedRequestResolver.php @@ -46,12 +46,10 @@ public function findStore(Request $request): ?StoreInterface if ($id) { $document = Document::getById((int) $id); } - } - else if ($this->requestHelper->isFrontendRequestByAdmin($request)) { + } elseif ($this->requestHelper->isFrontendRequestByAdmin($request)) { /** @psalm-suppress InternalMethod */ $document = $this->documentService->getNearestDocumentByPath($request->getPathInfo()); - } - else { + } else { throw new StoreNotFoundException(); } diff --git a/src/CoreShop/Component/Store/Context/RequestBased/PimcoreAreaBrickRenderResolver.php b/src/CoreShop/Component/Store/Context/RequestBased/PimcoreAreaBrickRenderResolver.php index 5f68462104..a0d59fee26 100644 --- a/src/CoreShop/Component/Store/Context/RequestBased/PimcoreAreaBrickRenderResolver.php +++ b/src/CoreShop/Component/Store/Context/RequestBased/PimcoreAreaBrickRenderResolver.php @@ -21,9 +21,7 @@ use CoreShop\Component\Store\Context\SiteBasedResolverInterface; use CoreShop\Component\Store\Context\StoreNotFoundException; use CoreShop\Component\Store\Model\StoreInterface; -use CoreShop\Component\Store\Repository\StoreRepositoryInterface; use Pimcore\Model\Document; -use Pimcore\Model\Site; use Pimcore\Tool\Frontend; use Symfony\Component\HttpFoundation\Request; diff --git a/src/CoreShop/Component/Store/Context/SiteBasedResolver.php b/src/CoreShop/Component/Store/Context/SiteBasedResolver.php index 52668eb3fe..43c0fe8ee5 100644 --- a/src/CoreShop/Component/Store/Context/SiteBasedResolver.php +++ b/src/CoreShop/Component/Store/Context/SiteBasedResolver.php @@ -47,4 +47,4 @@ public function resolveSiteWithDefaultForStore(?Site $site): ?StoreInterface return null; } -} \ No newline at end of file +} diff --git a/src/CoreShop/Component/Store/Context/SiteBasedResolverInterface.php b/src/CoreShop/Component/Store/Context/SiteBasedResolverInterface.php index 80b49267bd..4ae3c81fb4 100644 --- a/src/CoreShop/Component/Store/Context/SiteBasedResolverInterface.php +++ b/src/CoreShop/Component/Store/Context/SiteBasedResolverInterface.php @@ -24,4 +24,4 @@ interface SiteBasedResolverInterface { public function resolveSiteWithDefaultForStore(?Site $site): ?StoreInterface; -} \ No newline at end of file +}