src/Sylius/Bundle/PromotionBundle/SyliusPromotionBundle.php line 26

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\PromotionBundle;
  12. use Sylius\Bundle\PromotionBundle\DependencyInjection\Compiler\CompositePromotionCouponEligibilityCheckerPass;
  13. use Sylius\Bundle\PromotionBundle\DependencyInjection\Compiler\CompositePromotionEligibilityCheckerPass;
  14. use Sylius\Bundle\PromotionBundle\DependencyInjection\Compiler\RegisterPromotionActionsPass;
  15. use Sylius\Bundle\PromotionBundle\DependencyInjection\Compiler\RegisterRuleCheckersPass;
  16. use Sylius\Bundle\PromotionBundle\DependencyInjection\Compiler\SetCatalogPromotionActionTypesPass;
  17. use Sylius\Bundle\PromotionBundle\DependencyInjection\Compiler\SetCatalogPromotionScopeTypesPass;
  18. use Sylius\Bundle\ResourceBundle\AbstractResourceBundle;
  19. use Sylius\Bundle\ResourceBundle\SyliusResourceBundle;
  20. use Symfony\Component\DependencyInjection\ContainerBuilder;
  21. final class SyliusPromotionBundle extends AbstractResourceBundle
  22. {
  23.     public function getSupportedDrivers(): array
  24.     {
  25.         return [
  26.             SyliusResourceBundle::DRIVER_DOCTRINE_ORM,
  27.         ];
  28.     }
  29.     public function build(ContainerBuilder $container): void
  30.     {
  31.         parent::build($container);
  32.         $container->addCompilerPass(new CompositePromotionEligibilityCheckerPass());
  33.         $container->addCompilerPass(new CompositePromotionCouponEligibilityCheckerPass());
  34.         $container->addCompilerPass(new RegisterRuleCheckersPass());
  35.         $container->addCompilerPass(new RegisterPromotionActionsPass());
  36.         $container->addCompilerPass(new SetCatalogPromotionActionTypesPass());
  37.         $container->addCompilerPass(new SetCatalogPromotionScopeTypesPass());
  38.     }
  39.     /**
  40.      * @psalm-suppress MismatchingDocblockReturnType https://github.com/vimeo/psalm/issues/2345
  41.      */
  42.     protected function getModelNamespace(): string
  43.     {
  44.         return 'Sylius\Component\Promotion\Model';
  45.     }
  46. }