vendor/sylius/theme-bundle/src/SyliusThemeBundle.php line 25

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\ThemeBundle;
  12. use Sylius\Bundle\ThemeBundle\Configuration\Filesystem\FilesystemConfigurationSourceFactory;
  13. use Sylius\Bundle\ThemeBundle\Configuration\Test\TestConfigurationSourceFactory;
  14. use Sylius\Bundle\ThemeBundle\DependencyInjection\SyliusThemeExtension;
  15. use Sylius\Bundle\ThemeBundle\Translation\DependencyInjection\Compiler\TranslatorFallbackLocalesPass;
  16. use Sylius\Bundle\ThemeBundle\Translation\DependencyInjection\Compiler\TranslatorLoaderProviderPass;
  17. use Sylius\Bundle\ThemeBundle\Translation\DependencyInjection\Compiler\TranslatorResourceProviderPass;
  18. use Symfony\Component\DependencyInjection\ContainerBuilder;
  19. use Symfony\Component\HttpKernel\Bundle\Bundle;
  20. final class SyliusThemeBundle extends Bundle
  21. {
  22. public function build(ContainerBuilder $container): void
  23. {
  24. /** @var SyliusThemeExtension $themeExtension */
  25. $themeExtension = $container->getExtension('sylius_theme');
  26. $themeExtension->addConfigurationSourceFactory(new FilesystemConfigurationSourceFactory());
  27. $themeExtension->addConfigurationSourceFactory(new TestConfigurationSourceFactory());
  28. $container->addCompilerPass(new TranslatorFallbackLocalesPass());
  29. $container->addCompilerPass(new TranslatorLoaderProviderPass());
  30. $container->addCompilerPass(new TranslatorResourceProviderPass());
  31. }
  32. }