src/Sylius/Bundle/ShopBundle/EventListener/OrderCompleteListener.php line 31

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of the Sylius package.
  4.  *
  5.  * (c) Paweł Jędrzejewski
  6.  *
  7.  * For the full copyright and license information, please view the LICENSE
  8.  * file that was distributed with this source code.
  9.  */
  10. declare(strict_types=1);
  11. namespace Sylius\Bundle\ShopBundle\EventListener;
  12. use Sylius\Bundle\ShopBundle\EmailManager\OrderEmailManagerInterface;
  13. use Sylius\Component\Core\Model\OrderInterface;
  14. use Symfony\Component\EventDispatcher\GenericEvent;
  15. use Webmozart\Assert\Assert;
  16. final class OrderCompleteListener
  17. {
  18.     /** @var OrderEmailManagerInterface */
  19.     private $orderEmailManager;
  20.     public function __construct(OrderEmailManagerInterface $orderEmailManager)
  21.     {
  22.         $this->orderEmailManager $orderEmailManager;
  23.     }
  24.     public function sendConfirmationEmail(GenericEvent $event): void
  25.     {
  26.         $order $event->getSubject();
  27.         Assert::isInstanceOf($orderOrderInterface::class);
  28.         $this->orderEmailManager->sendConfirmationEmail($order);
  29.     }
  30. }