1<?php
2
3/*
4 * This file is part of Twig.
5 *
6 * (c) Fabien Potencier
7 *
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
10 */
11
12use Twig\Compiler;
13use Twig\Node\Expression\AbstractExpression;
14
15@trigger_error('The Twig_Node_Expression_ExtensionReference class is deprecated since version 1.23 and will be removed in 2.0.', E_USER_DEPRECATED);
16
17/**
18 * Represents an extension call node.
19 *
20 * @author Fabien Potencier <fabien@symfony.com>
21 *
22 * @deprecated since 1.23 and will be removed in 2.0.
23 */
24class Twig_Node_Expression_ExtensionReference extends AbstractExpression
25{
26    public function __construct($name, $lineno, $tag = null)
27    {
28        parent::__construct([], ['name' => $name], $lineno, $tag);
29    }
30
31    public function compile(Compiler $compiler)
32    {
33        $compiler->raw(sprintf("\$this->env->getExtension('%s')", $this->getAttribute('name')));
34    }
35}
36