vendor/symfony/ux-live-component/src/LiveComponentBundle.php line 23

Open in your IDE?
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\UX\LiveComponent;
  11. use Symfony\Component\DependencyInjection\Compiler\PassConfig;
  12. use Symfony\Component\DependencyInjection\ContainerBuilder;
  13. use Symfony\Component\HttpKernel\Bundle\Bundle;
  14. use Symfony\UX\LiveComponent\DependencyInjection\Compiler\ComponentDefaultActionPass;
  15. use Symfony\UX\LiveComponent\DependencyInjection\Compiler\OptionalDependencyPass;
  16. /**
  17. * @author Kevin Bond <kevinbond@gmail.com>
  18. */
  19. final class LiveComponentBundle extends Bundle
  20. {
  21. public const HYDRATION_EXTENSION_TAG = 'live_component.hydration_extension';
  22. public function build(ContainerBuilder $container): void
  23. {
  24. // must run before Symfony\Component\Serializer\DependencyInjection\SerializerPass
  25. $container->addCompilerPass(new OptionalDependencyPass(), PassConfig::TYPE_BEFORE_OPTIMIZATION, 100);
  26. $container->addCompilerPass(new ComponentDefaultActionPass());
  27. }
  28. public function getPath(): string
  29. {
  30. return \dirname(__DIR__);
  31. }
  32. }