Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / vendor / twig / twig / lib / Twig / Node / SetTemp.php
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
12 /**
13  * @internal
14  */
15 class Twig_Node_SetTemp extends Twig_Node
16 {
17     public function __construct($name, $lineno)
18     {
19         parent::__construct(array(), array('name' => $name), $lineno);
20     }
21
22     public function compile(Twig_Compiler $compiler)
23     {
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")
36         ;
37     }
38 }
39
40 class_alias('Twig_Node_SetTemp', 'Twig\Node\SetTempNode', false);