Skip to content

Commit

Permalink
Fix ecs and php stan
Browse files Browse the repository at this point in the history
  • Loading branch information
marekrzytki committed May 21, 2024
1 parent da2d3a7 commit 00f3e1e
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 8 deletions.
17 changes: 12 additions & 5 deletions spec/EventSubscriber/LoggedUserWishlistSubscriberSpec.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
<?php

/*
* This file has been created by developers from BitBag.
* Feel free to contact us once you face any issues or want to start
* You can find more information about us on https://bitbag.io and write us
* an email on [email protected].
*/

declare(strict_types=1);

namespace spec\BitBag\SyliusWishlistPlugin\EventSubscriber;
Expand All @@ -22,12 +29,12 @@ final class LoggedUserWishlistSubscriberSpec extends ObjectBehavior
public function let(
SectionProviderInterface $uriBasedSectionContext,
WishlistsResolverInterface $wishlistsResolver,
EntityManagerInterface $entityManager
EntityManagerInterface $entityManager,
): void {
$this->beConstructedWith(
$uriBasedSectionContext,
$wishlistsResolver,
$entityManager
$entityManager,
);
}

Expand All @@ -40,7 +47,7 @@ public function it_is_initializable(): void
public function it_returns_if_invalid_section_on_implicit_login(
SectionProviderInterface $uriBasedSectionContext,
UserEvent $event,
AdminSection $adminSection
AdminSection $adminSection,
): void {
$uriBasedSectionContext->getSection()->willReturn($adminSection)->shouldBeCalledOnce();

Expand All @@ -54,7 +61,7 @@ public function it_returns_if_invalid_user_on_implicit_login(
UserEvent $event,
ShopSection $shopSection,
AdminUserInterface $adminUser,
WishlistsResolverInterface $wishlistsResolver
WishlistsResolverInterface $wishlistsResolver,
): void {
$uriBasedSectionContext->getSection()->willReturn($shopSection)->shouldBeCalledOnce();
$event->getUser()->willReturn($adminUser)->shouldBeCalledOnce();
Expand All @@ -73,7 +80,7 @@ public function it_assign_shop_user_to_wishlists_without_shop_user_on_login(
WishlistInterface $wishlist,
WishlistInterface $wishlist2,
ShopUserInterface $shopUser2,
EntityManagerInterface $entityManager
EntityManagerInterface $entityManager,
): void {
$wishlists = [
$wishlist->getWrappedObject(),
Expand Down
9 changes: 8 additions & 1 deletion src/EventSubscriber/LoggedUserWishlistSubscriber.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
<?php

/*
* This file has been created by developers from BitBag.
* Feel free to contact us once you face any issues or want to start
* You can find more information about us on https://bitbag.io and write us
* an email on [email protected].
*/

declare(strict_types=1);

namespace BitBag\SyliusWishlistPlugin\EventSubscriber;
Expand All @@ -21,7 +28,7 @@ final class LoggedUserWishlistSubscriber implements EventSubscriberInterface
public function __construct(
private SectionProviderInterface $uriBasedSectionContext,
private WishlistsResolverInterface $wishlistsResolver,
private EntityManagerInterface $entityManager
private EntityManagerInterface $entityManager,
) {
}

Expand Down
3 changes: 1 addition & 2 deletions tests/Behat/Context/Ui/WishlistContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
use Sylius\Component\Core\Repository\ProductRepositoryInterface;
use Sylius\Component\Product\Resolver\ProductVariantResolverInterface;
use Symfony\Component\Routing\Exception\ResourceNotFoundException;
use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Symfony\Component\Routing\RouterInterface;
use Tests\BitBag\SyliusWishlistPlugin\Behat\Page\Shop\ProductIndexPageInterface;
Expand Down Expand Up @@ -140,7 +139,7 @@ public function theStoreHasAWishlist(string $name): void
public function iRemoveWishlistCookieToken(): void
{
$this->getSession()->setCookie($this->wishlistCookieToken);
$this->cookieSetter->setCookie($this->wishlistCookieToken, null);
$this->cookieSetter->setCookie($this->wishlistCookieToken, '');
}

/**
Expand Down

0 comments on commit 00f3e1e

Please sign in to comment.