Skip to content

Commit

Permalink
fix: naming of setter in ShopInterface
Browse files Browse the repository at this point in the history
  • Loading branch information
shyim committed May 9, 2023
1 parent 8e2e9b8 commit 3197619
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/AppLifecycle.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
4 changes: 2 additions & 2 deletions src/Registration/RegistrationService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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', [
Expand Down Expand Up @@ -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', [
Expand Down
6 changes: 3 additions & 3 deletions src/Shop/ShopInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
6 changes: 3 additions & 3 deletions src/Test/MockShop.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,22 +48,22 @@ 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;

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;

Expand Down

0 comments on commit 3197619

Please sign in to comment.