diff --git a/src/AppLifecycle.php b/src/AppLifecycle.php index 9864b29..51b21f1 100644 --- a/src/AppLifecycle.php +++ b/src/AppLifecycle.php @@ -113,7 +113,7 @@ private function handleShopStatus(RequestInterface $request, bool $status): Resp $this->eventDispatcher?->dispatch(new BeforeShopDeactivatedEvent($request, $shop)); } - $this->shopRepository->updateShop($shop->withShopActive($status)); + $this->shopRepository->updateShop($shop->setShopActive($status)); if ($status) { $this->eventDispatcher?->dispatch(new ShopActivatedEvent($request, $shop)); diff --git a/src/Registration/RegistrationService.php b/src/Registration/RegistrationService.php index 7d3500b..740aa6a 100644 --- a/src/Registration/RegistrationService.php +++ b/src/Registration/RegistrationService.php @@ -63,7 +63,7 @@ public function register(RequestInterface $request): ResponseInterface $this->shopRepository->createShop($shop); } else { - $this->shopRepository->updateShop($shop->withShopUrl($queries['shop-url'])); + $this->shopRepository->updateShop($shop->setShopUrl($queries['shop-url'])); } $this->logger->info('Shop registration request received', [ @@ -115,7 +115,7 @@ public function registerConfirm(RequestInterface $request): ResponseInterface $this->eventDispatcher?->dispatch(new BeforeRegistrationCompletedEvent($shop, $request, $requestContent)); $this->shopRepository->updateShop( - $shop->withShopApiCredentials($requestContent['apiKey'], $requestContent['secretKey']) + $shop->setShopApiCredentials($requestContent['apiKey'], $requestContent['secretKey']) ); $this->logger->info('Shop registration confirmed', [ diff --git a/src/Shop/ShopInterface.php b/src/Shop/ShopInterface.php index 5508f22..958f466 100644 --- a/src/Shop/ShopInterface.php +++ b/src/Shop/ShopInterface.php @@ -21,9 +21,9 @@ public function getShopClientId(): ?string; public function getShopClientSecret(): ?string; - public function withShopApiCredentials(string $clientId, string $clientSecret): ShopInterface; + public function setShopApiCredentials(string $clientId, string $clientSecret): ShopInterface; - public function withShopUrl(string $url): ShopInterface; + public function setShopUrl(string $url): ShopInterface; - public function withShopActive(bool $active): ShopInterface; + public function setShopActive(bool $active): ShopInterface; } diff --git a/src/Test/MockShop.php b/src/Test/MockShop.php index 25a5df0..960f075 100644 --- a/src/Test/MockShop.php +++ b/src/Test/MockShop.php @@ -48,7 +48,7 @@ public function isShopActive(): bool return $this->shopActive; } - public function withShopApiCredentials(string $clientId, string $clientSecret): ShopInterface + public function setShopApiCredentials(string $clientId, string $clientSecret): ShopInterface { $this->clientId = $clientId; $this->clientSecret = $clientSecret; @@ -56,14 +56,14 @@ public function withShopApiCredentials(string $clientId, string $clientSecret): return $this; } - public function withShopUrl(string $url): ShopInterface + public function setShopUrl(string $url): ShopInterface { $this->shopUrl = $url; return $this; } - public function withShopActive(bool $active): ShopInterface + public function setShopActive(bool $active): ShopInterface { $this->shopActive = $active;