Skip to content

Commit

Permalink
[framework] fixed incorrect usage of frontend-api class in framework …
Browse files Browse the repository at this point in the history
…package (#3453)
  • Loading branch information
grossmannmartin authored Sep 23, 2024
1 parent e008749 commit 1ca026a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/Component/EntityLog/Detection/DetectionFacade.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
namespace Shopsys\FrameworkBundle\Component\EntityLog\Detection;

use Shopsys\FrameworkBundle\Component\EntityLog\Enum\EntityLogSourceEnum;
use Shopsys\FrontendApiBundle\Model\User\FrontendApiUser;
use Symfony\Component\Security\Core\Security;

class DetectionFacade
Expand All @@ -29,7 +28,7 @@ public function setFrontendApiSourceAndUserIdentifier(): void

$user = $this->security->getUser();

if ($user instanceof FrontendApiUser) {
if ($user !== null) {
$this->userIdentifier = $user->getUserIdentifier();
}
}
Expand Down
5 changes: 3 additions & 2 deletions src/Twig/HiddenPriceExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@

use Shopsys\FrameworkBundle\Model\Customer\User\CustomerUser;
use Shopsys\FrameworkBundle\Model\Customer\User\Role\CustomerUserRoleResolver;
use Shopsys\FrontendApiBundle\Component\Price\MoneyFormatterHelper;
use Twig\Extension\AbstractExtension;
use Twig\TwigFilter;

class HiddenPriceExtension extends AbstractExtension
{
protected const string HIDDEN_FORMAT = '***';

/**
* @param \Shopsys\FrameworkBundle\Model\Customer\User\Role\CustomerUserRoleResolver $customerUserRoleResolver
*/
Expand Down Expand Up @@ -41,7 +42,7 @@ public function getFilters(): array
public function hidePriceFilter(string $price, ?CustomerUser $customerUser): string
{
if (!$this->customerUserRoleResolver->canCustomerUserSeePrices($customerUser)) {
return MoneyFormatterHelper::HIDDEN_FORMAT;
return static::HIDDEN_FORMAT;
}

return $price;
Expand Down

0 comments on commit 1ca026a

Please sign in to comment.