debug.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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\Component\DependencyInjection\Loader\Configurator;
  11. use Symfony\Component\HttpKernel\Controller\ArgumentResolver\NotTaggedControllerValueResolver;
  12. use Symfony\Component\HttpKernel\Controller\TraceableArgumentResolver;
  13. use Symfony\Component\HttpKernel\Controller\TraceableControllerResolver;
  14. use Symfony\Component\HttpKernel\Debug\TraceableEventDispatcher;
  15. return static function (ContainerConfigurator $container) {
  16. $container->services()
  17. ->set('debug.event_dispatcher', TraceableEventDispatcher::class)
  18. ->decorate('event_dispatcher')
  19. ->args([
  20. service('debug.event_dispatcher.inner'),
  21. service('debug.stopwatch'),
  22. service('logger')->nullOnInvalid(),
  23. service('request_stack')->nullOnInvalid(),
  24. ])
  25. ->tag('monolog.logger', ['channel' => 'event'])
  26. ->tag('kernel.reset', ['method' => 'reset'])
  27. ->set('debug.controller_resolver', TraceableControllerResolver::class)
  28. ->decorate('controller_resolver')
  29. ->args([
  30. service('debug.controller_resolver.inner'),
  31. service('debug.stopwatch'),
  32. ])
  33. ->set('debug.argument_resolver', TraceableArgumentResolver::class)
  34. ->decorate('argument_resolver')
  35. ->args([
  36. service('debug.argument_resolver.inner'),
  37. service('debug.stopwatch'),
  38. ])
  39. ->set('argument_resolver.not_tagged_controller', NotTaggedControllerValueResolver::class)
  40. ->args([abstract_arg('Controller argument, set in FrameworkExtension')])
  41. ->tag('controller.argument_value_resolver', ['priority' => -200])
  42. ;
  43. };