validator_debug.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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\Validator\DataCollector\ValidatorDataCollector;
  12. use Symfony\Component\Validator\Validator\TraceableValidator;
  13. return static function (ContainerConfigurator $container) {
  14. $container->services()
  15. ->set('debug.validator', TraceableValidator::class)
  16. ->decorate('validator', null, 255)
  17. ->args([
  18. service('debug.validator.inner'),
  19. ])
  20. ->tag('kernel.reset', [
  21. 'method' => 'reset',
  22. ])
  23. ->set('data_collector.validator', ValidatorDataCollector::class)
  24. ->args([
  25. service('debug.validator'),
  26. ])
  27. ->tag('data_collector', [
  28. 'template' => '@WebProfiler/Collector/validator.html.twig',
  29. 'id' => 'validator',
  30. 'priority' => 320,
  31. ])
  32. ;
  33. };