Server IP : 15.235.198.142 / Your IP : 216.73.216.14 Web Server : Apache/2.4.58 (Ubuntu) System : Linux ballsack 6.8.0-45-generic #45-Ubuntu SMP PREEMPT_DYNAMIC Fri Aug 30 12:02:04 UTC 2024 x86_64 User : www-data ( 33) PHP Version : 8.3.6 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/rhodeworks/wp-content/plugins/elementor/vendor_prefixed/twig/src/Node/ |
Upload File : |
<?php /* * This file is part of Twig. * * (c) Fabien Potencier * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace ElementorDeps\Twig\Node; use ElementorDeps\Twig\Attribute\YieldReady; use ElementorDeps\Twig\Compiler; use ElementorDeps\Twig\Node\Expression\ConstantExpression; /** * Represents a set node. * * @author Fabien Potencier <fabien@symfony.com> */ #[\Twig\Attribute\YieldReady] class SetNode extends Node implements NodeCaptureInterface { public function __construct(bool $capture, Node $names, Node $values, int $lineno, ?string $tag = null) { /* * Optimizes the node when capture is used for a large block of text. * * {% set foo %}foo{% endset %} is compiled to $context['foo'] = new Twig\Markup("foo"); */ $safe = \false; if ($capture) { $safe = \true; if ($values instanceof TextNode) { $values = new ConstantExpression($values->getAttribute('data'), $values->getTemplateLine()); $capture = \false; } else { $values = new CaptureNode($values, $values->getTemplateLine()); } } parent::__construct(['names' => $names, 'values' => $values], ['capture' => $capture, 'safe' => $safe], $lineno, $tag); } public function compile(Compiler $compiler) : void { $compiler->addDebugInfo($this); if (\count($this->getNode('names')) > 1) { $compiler->write('['); foreach ($this->getNode('names') as $idx => $node) { if ($idx) { $compiler->raw(', '); } $compiler->subcompile($node); } $compiler->raw(']'); } else { $compiler->subcompile($this->getNode('names'), \false); } $compiler->raw(' = '); if ($this->getAttribute('capture')) { $compiler->subcompile($this->getNode('values')); } else { if (\count($this->getNode('names')) > 1) { $compiler->write('['); foreach ($this->getNode('values') as $idx => $value) { if ($idx) { $compiler->raw(', '); } $compiler->subcompile($value); } $compiler->raw(']'); } else { if ($this->getAttribute('safe')) { $compiler->raw("('' === \$tmp = ")->subcompile($this->getNode('values'))->raw(") ? '' : new Markup(\$tmp, \$this->env->getCharset())"); } else { $compiler->subcompile($this->getNode('values')); } } $compiler->raw(';'); } $compiler->raw("\n"); } }