composer package updates
[openemr.git] / vendor / twig / twig / lib / Twig / Node / SetTemp.php
blob996fdcde75001244f3d29f9bf273ac2587517715
1 <?php
3 /*
4 * This file is part of Twig.
6 * (c) Fabien Potencier
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 /**
13 * @internal
15 class Twig_Node_SetTemp extends Twig_Node
17 public function __construct($name, $lineno)
19 parent::__construct(array(), array('name' => $name), $lineno);
22 public function compile(Twig_Compiler $compiler)
24 $name = $this->getAttribute('name');
25 $compiler
26 ->addDebugInfo($this)
27 ->write('if (isset($context[')
28 ->string($name)
29 ->raw('])) { $_')
30 ->raw($name)
31 ->raw('_ = $context[')
32 ->repr($name)
33 ->raw(']; } else { $_')
34 ->raw($name)
35 ->raw("_ = null; }\n")
40 class_alias('Twig_Node_SetTemp', 'Twig\Node\SetTempNode', false);