From c69c93c738a9f06a2df6e8d27c54ce194578b9fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Kukli=C5=84ski?= Date: Tue, 1 Oct 2024 21:28:16 +0200 Subject: [PATCH] Fix issue with using tests/Application interface in src/ class --- src/EventSubscriber/UserRegistrationAgreementSubscriber.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/EventSubscriber/UserRegistrationAgreementSubscriber.php b/src/EventSubscriber/UserRegistrationAgreementSubscriber.php index 628f73f..e497603 100644 --- a/src/EventSubscriber/UserRegistrationAgreementSubscriber.php +++ b/src/EventSubscriber/UserRegistrationAgreementSubscriber.php @@ -11,12 +11,13 @@ namespace BitBag\SyliusAgreementPlugin\EventSubscriber; +use BitBag\SyliusAgreementPlugin\Entity\Agreement\AgreementsRequiredInterface; use BitBag\SyliusAgreementPlugin\Handler\AgreementHandler; use Doctrine\Common\Collections\Collection; use Sylius\Bundle\ResourceBundle\Event\ResourceControllerEvent; +use Sylius\Component\Core\Model\CustomerInterface; use Sylius\Component\Core\Model\ShopUserInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface; -use Tests\BitBag\SyliusAgreementPlugin\Entity\Customer\CustomerInterface; use Webmozart\Assert\Assert; class UserRegistrationAgreementSubscriber implements EventSubscriberInterface @@ -42,6 +43,7 @@ public function processAgreementsFromUserRegister(ResourceControllerEvent $resou /** @var ?CustomerInterface $customer */ $customer = $resourceControllerEvent->getSubject(); Assert::isInstanceOf($customer, CustomerInterface::class); + Assert::isInstanceOf($customer, AgreementsRequiredInterface::class); /** @var ?ShopUserInterface $shopUser */ $shopUser = $customer->getUser();