src/Templating/TwigServiceProvider.php
public function getEnvironment(ContainerInterface $container)
    {
        $twig = new Twig_Environment($container->get(Twig_LoaderInterface::class), $this->options);
        foreach ($this->extensions as $extension) {
            $twig->addExtension(is_string($extension) ? $container->get($extension) : $extension);
        }

        return $twig;
    }
public function getEnvironment(ContainerInterface $container)
    {
        $twig = new Twig_Environment($container->get(Twig_LoaderInterface::class), $this->options);
        foreach ($this->extensions as $extension) {
            $twig->addExtension(is_string($extension) ? $container->get($extension) : $extension);
        }

        return $twig;
    }
@param ContainerInterface $container

@return Twig_Environment