Skip to content

Commit

Permalink
[Task]: Apply native parameter and return type hints - make Ecommerce…
Browse files Browse the repository at this point in the history
…FrameworkBundle\Environment::$useGuestCart nullable
  • Loading branch information
dvesh3 committed Nov 18, 2022
1 parent b1b259a commit 3df0381
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions bundles/EcommerceFrameworkBundle/src/Environment.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class Environment implements EnvironmentInterface

protected int $userId = self::USER_ID_NOT_SET;

protected bool $useGuestCart = false;
protected ?bool $useGuestCart = null;

protected ?string $currentAssortmentTenant = null;

Expand Down Expand Up @@ -162,7 +162,9 @@ public function getDefaultCurrency(): Currency

public function getUseGuestCart(): bool
{
$this->load();
if (null === $this->useGuestCart) {
return !$this->hasCurrentUserId();
}

return $this->useGuestCart;
}
Expand Down

0 comments on commit 3df0381

Please sign in to comment.