PHP 8.2.31
Preview: MacroNode.php Size: 2.15 KB
/home/nshryvcy/himaltourism.com/wp-content/plugins/mailpoet/vendor-prefixed/twig/twig/src/Node/MacroNode.php

<?php
namespace MailPoetVendor\Twig\Node;
if (!defined('ABSPATH')) exit;
use MailPoetVendor\Twig\Compiler;
use MailPoetVendor\Twig\Error\SyntaxError;
class MacroNode extends Node
{
 public const VARARGS_NAME = 'varargs';
 public function __construct(string $name, Node $body, Node $arguments, int $lineno, string $tag = null)
 {
 foreach ($arguments as $argumentName => $argument) {
 if (self::VARARGS_NAME === $argumentName) {
 throw new SyntaxError(\sprintf('The argument "%s" in macro "%s" cannot be defined because the variable "%s" is reserved for arbitrary arguments.', self::VARARGS_NAME, $name, self::VARARGS_NAME), $argument->getTemplateLine(), $argument->getSourceContext());
 }
 }
 parent::__construct(['body' => $body, 'arguments' => $arguments], ['name' => $name], $lineno, $tag);
 }
 public function compile(Compiler $compiler) : void
 {
 $compiler->addDebugInfo($this)->write(\sprintf('public function macro_%s(', $this->getAttribute('name')));
 $count = \count($this->getNode('arguments'));
 $pos = 0;
 foreach ($this->getNode('arguments') as $name => $default) {
 $compiler->raw('$__' . $name . '__ = ')->subcompile($default);
 if (++$pos < $count) {
 $compiler->raw(', ');
 }
 }
 if ($count) {
 $compiler->raw(', ');
 }
 $compiler->raw('...$__varargs__')->raw(")\n")->write("{\n")->indent()->write("\$macros = \$this->macros;\n")->write("\$context = \$this->env->mergeGlobals([\n")->indent();
 foreach ($this->getNode('arguments') as $name => $default) {
 $compiler->write('')->string($name)->raw(' => $__' . $name . '__')->raw(",\n");
 }
 $compiler->write('')->string(self::VARARGS_NAME)->raw(' => ');
 $compiler->raw("\$__varargs__,\n")->outdent()->write("]);\n\n")->write("\$blocks = [];\n\n");
 if ($compiler->getEnvironment()->isDebug()) {
 $compiler->write("ob_start();\n");
 } else {
 $compiler->write("ob_start(function () { return ''; });\n");
 }
 $compiler->write("try {\n")->indent()->subcompile($this->getNode('body'))->raw("\n")->write("return ('' === \$tmp = ob_get_contents()) ? '' : new Markup(\$tmp, \$this->env->getCharset());\n")->outdent()->write("} finally {\n")->indent()->write("ob_end_clean();\n")->outdent()->write("}\n")->outdent()->write("}\n\n");
 }
}

Directory Contents

Dirs: 1 × Files: 27

Name Size Perms Modified Actions
- drwxr-xr-x 2023-04-04 05:35:39
Edit Download
424 B lrw-r--r-- 2023-04-04 05:35:39
Edit Download
639 B lrw-r--r-- 2023-04-04 05:35:39
Edit Download
513 B lrw-r--r-- 2023-04-04 05:35:39
Edit Download
105 B lrw-r--r-- 2023-04-04 05:35:39
Edit Download
364 B lrw-r--r-- 2023-04-04 05:35:39
Edit Download
2.19 KB lrw-r--r-- 2023-04-04 05:35:39
Edit Download
612 B lrw-r--r-- 2023-04-04 05:35:39
Edit Download
970 B lrw-r--r-- 2023-04-04 05:35:39
Edit Download
501 B lrw-r--r-- 2023-04-04 05:35:39
Edit Download
1.01 KB lrw-r--r-- 2023-04-04 05:35:39
Edit Download
358 B lrw-r--r-- 2023-04-04 05:35:39
Edit Download
913 B lrw-r--r-- 2023-04-04 05:35:39
Edit Download
2.83 KB lrw-r--r-- 2023-04-04 05:35:39
Edit Download
936 B lrw-r--r-- 2023-04-04 05:35:39
Edit Download
1.14 KB lrw-r--r-- 2023-04-04 05:35:39
Edit Download
2.08 KB lrw-r--r-- 2023-04-04 05:35:39
Edit Download
0 B lrw-r--r-- 2023-04-04 05:35:39
Edit Download
2.15 KB lrw-r--r-- 2023-04-04 05:35:39
Edit Download
9.60 KB lrw-r--r-- 2023-04-04 05:35:39
Edit Download
3.29 KB lrw-r--r-- 2023-04-04 05:35:39
Edit Download
108 B lrw-r--r-- 2023-04-04 05:35:39
Edit Download
107 B lrw-r--r-- 2023-04-04 05:35:39
Edit Download
540 B lrw-r--r-- 2023-04-04 05:35:39
Edit Download
781 B lrw-r--r-- 2023-04-04 05:35:39
Edit Download
2.06 KB lrw-r--r-- 2023-04-04 05:35:39
Edit Download
442 B lrw-r--r-- 2023-04-04 05:35:39
Edit Download
1.45 KB lrw-r--r-- 2023-04-04 05:35:39
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).