console.php 1.0 KB

123456789101112131415161718192021222324252627282930313233
  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\Bridge\Twig\Command\DebugCommand;
  12. use Symfony\Bundle\TwigBundle\Command\LintCommand;
  13. return static function (ContainerConfigurator $container) {
  14. $container->services()
  15. ->set('twig.command.debug', DebugCommand::class)
  16. ->args([
  17. service('twig'),
  18. param('kernel.project_dir'),
  19. param('kernel.bundles_metadata'),
  20. param('twig.default_path'),
  21. service('debug.file_link_formatter')->nullOnInvalid(),
  22. ])
  23. ->tag('console.command', ['command' => 'debug:twig'])
  24. ->set('twig.command.lint', LintCommand::class)
  25. ->args([service('twig')])
  26. ->tag('console.command', ['command' => 'lint:twig'])
  27. ;
  28. };