src/Core/Checkout/Checkout.php line 17

  1. <?php declare(strict_types=1);
  2. namespace Shopware\Core\Checkout;
  3. use Shopware\Core\Checkout\DependencyInjection\CompilerPass\CartRedisCompilerPass;
  4. use Shopware\Core\Framework\Bundle;
  5. use Shopware\Core\Framework\Log\Package;
  6. use Symfony\Component\Config\FileLocator;
  7. use Symfony\Component\DependencyInjection\Compiler\PassConfig;
  8. use Symfony\Component\DependencyInjection\ContainerBuilder;
  9. use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
  10. /**
  11.  * @internal
  12.  */
  13. #[Package('core')]
  14. class Checkout extends Bundle
  15. {
  16.     /**
  17.      * {@inheritdoc}
  18.      */
  19.     public function build(ContainerBuilder $container): void
  20.     {
  21.         parent::build($container);
  22.         $container->addCompilerPass(new CartRedisCompilerPass(), PassConfig::TYPE_BEFORE_OPTIMIZATION0);
  23.         $loader = new XmlFileLoader($container, new FileLocator(__DIR__ '/DependencyInjection/'));
  24.         $loader->load('cart.xml');
  25.         $loader->load('customer.xml');
  26.         $loader->load('document.xml');
  27.         $loader->load('order.xml');
  28.         $loader->load('payment.xml');
  29.         $loader->load('rule.xml');
  30.         $loader->load('promotion.xml');
  31.         $loader->load('shipping.xml');
  32.         // test classes are only loaded in autoload dev, so they are not available when other projects run platform in test mode
  33.         if ($container->getParameter('kernel.environment') === 'test' && class_exists('Shopware\Tests\Unit\Core\Checkout\Cart\TaxProvider\_fixtures\TestConstantTaxRateProvider')) {
  34.             $loader->load('services_test.xml');
  35.         }
  36.     }
  37. }