Skip to content

Commit

Permalink
OXDEV-8216: Move getting of current shop id out of try/catch block
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcelOxid committed Aug 12, 2024
1 parent f48ea1f commit 6d7dc0a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Module/Service/ModuleActivationService.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ public function __construct(
*/
public function activateModule(string $moduleId): bool
{
$shopId = $this->context->getCurrentShopId();

try {
$shopId = $this->context->getCurrentShopId();
$this->moduleActivationBridge->activate(moduleId: $moduleId, shopId: $shopId);
} catch (\Exception $exception) {
throw new ModuleActivationException();
Expand All @@ -42,8 +43,9 @@ public function activateModule(string $moduleId): bool
*/
public function deactivateModule(string $moduleId): bool
{
$shopId = $this->context->getCurrentShopId();

try {
$shopId = $this->context->getCurrentShopId();
$this->moduleActivationBridge->deactivate(moduleId: $moduleId, shopId: $shopId);
} catch (\Exception $exception) {
throw new ModuleDeactivationException();
Expand Down

0 comments on commit 6d7dc0a

Please sign in to comment.