Skip to content

Commit

Permalink
Tidying CreateNewWishlistSubscriber class
Browse files Browse the repository at this point in the history
  • Loading branch information
senghe committed Oct 23, 2023
1 parent 5264e9b commit 31d9918
Showing 1 changed file with 0 additions and 30 deletions.
30 changes: 0 additions & 30 deletions src/EventSubscriber/CreateNewWishlistSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,64 +11,34 @@
namespace BitBag\SyliusWishlistPlugin\EventSubscriber;

use BitBag\SyliusWishlistPlugin\Entity\WishlistInterface;
use BitBag\SyliusWishlistPlugin\Entity\WishlistToken;
use BitBag\SyliusWishlistPlugin\Factory\WishlistFactoryInterface;
use BitBag\SyliusWishlistPlugin\Repository\WishlistRepositoryInterface;
use BitBag\SyliusWishlistPlugin\Resolver\TokenUserResolverInterface;
use BitBag\SyliusWishlistPlugin\Resolver\WishlistCookieTokenResolverInterface;
use BitBag\SyliusWishlistPlugin\Resolver\WishlistsResolverInterface;
use Sylius\Component\Channel\Context\ChannelContextInterface;
use Sylius\Component\Channel\Context\ChannelNotFoundException;
use Sylius\Component\Core\Model\ChannelInterface;
use Sylius\Component\Core\Model\ShopUserInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpFoundation\Cookie;
use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Event\RequestEvent;
use Symfony\Component\HttpKernel\Event\ResponseEvent;
use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;

final class CreateNewWishlistSubscriber implements EventSubscriberInterface
{
private string $wishlistCookieToken;

private WishlistsResolverInterface $wishlistsResolver;

private WishlistFactoryInterface $wishlistFactory;

private WishlistRepositoryInterface $wishlistRepository;

private TokenStorageInterface $tokenStorage;

private ChannelContextInterface $channelContext;

private WishlistCookieTokenResolverInterface $wishlistCookieTokenResolver;

private TokenUserResolverInterface $tokenUserResolver;

private RequestStack $requestStack;

public function __construct(
string $wishlistCookieToken,
WishlistsResolverInterface $wishlistsResolver,
WishlistFactoryInterface $wishlistFactory,
WishlistRepositoryInterface $wishlistRepository,
TokenStorageInterface $tokenStorage,
ChannelContextInterface $channelContext,
WishlistCookieTokenResolverInterface $wishlistCookieTokenResolver,
TokenUserResolverInterface $tokenUserResolver,
RequestStack $requestStack,
) {
$this->wishlistCookieToken = $wishlistCookieToken;
$this->wishlistsResolver = $wishlistsResolver;
$this->wishlistFactory = $wishlistFactory;
$this->wishlistRepository = $wishlistRepository;
$this->tokenStorage = $tokenStorage;
$this->channelContext = $channelContext;
$this->wishlistCookieTokenResolver = $wishlistCookieTokenResolver;
$this->tokenUserResolver = $tokenUserResolver;
$this->requestStack = $requestStack;
}

Expand Down

0 comments on commit 31d9918

Please sign in to comment.