Deprecated: Constant E_STRICT is deprecated in /home/pastorz/old-espace-client/vendor/symfony/error-handler/ErrorHandler.php on line 58

Deprecated: Constant E_STRICT is deprecated in /home/pastorz/old-espace-client/vendor/symfony/error-handler/ErrorHandler.php on line 76
Symfony Profiler

vendor/twig/extra-bundle/DependencyInjection/Compiler/MissingExtensionSuggestorPass.php line 32

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 Twig\Extra\TwigExtraBundle\DependencyInjection\Compiler;
  11. use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
  12. use Symfony\Component\DependencyInjection\ContainerBuilder;
  13. use Symfony\Component\DependencyInjection\Reference;
  14. use Twig\Environment;
  15. class MissingExtensionSuggestorPass implements CompilerPassInterface
  16. {
  17.     /** @return void */
  18.     public function process(ContainerBuilder $container)
  19.     {
  20.         if ($container->getParameter('kernel.debug')) {
  21.             $twigDefinition $container->getDefinition('twig');
  22.             $twigDefinition
  23.                 ->addMethodCall('registerUndefinedFilterCallback', [[new Reference('twig.missing_extension_suggestor'), 'suggestFilter']])
  24.                 ->addMethodCall('registerUndefinedFunctionCallback', [[new Reference('twig.missing_extension_suggestor'), 'suggestFunction']])
  25.             ;
  26.             // this method was added in Twig 3.2
  27.             if (method_exists(Environment::class, 'registerUndefinedTokenParserCallback')) {
  28.                 $twigDefinition->addMethodCall('registerUndefinedTokenParserCallback', [[new Reference('twig.missing_extension_suggestor'), 'suggestTag']]);
  29.             }
  30.         }
  31.     }
  32. }