Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/wp-conte.../plugins/sitepres.../lib/twig/src/Node
File: WithNode.php
<?php
[0] Fix | Delete
[1] Fix | Delete
/*
[2] Fix | Delete
* This file is part of Twig.
[3] Fix | Delete
*
[4] Fix | Delete
* (c) Fabien Potencier
[5] Fix | Delete
*
[6] Fix | Delete
* For the full copyright and license information, please view the LICENSE
[7] Fix | Delete
* file that was distributed with this source code.
[8] Fix | Delete
*/
[9] Fix | Delete
namespace WPML\Core\Twig\Node;
[10] Fix | Delete
[11] Fix | Delete
use WPML\Core\Twig\Compiler;
[12] Fix | Delete
/**
[13] Fix | Delete
* Represents a nested "with" scope.
[14] Fix | Delete
*
[15] Fix | Delete
* @author Fabien Potencier <fabien@symfony.com>
[16] Fix | Delete
*/
[17] Fix | Delete
class WithNode extends \WPML\Core\Twig\Node\Node
[18] Fix | Delete
{
[19] Fix | Delete
public function __construct(\WPML\Core\Twig\Node\Node $body, \WPML\Core\Twig\Node\Node $variables = null, $only = \false, $lineno, $tag = null)
[20] Fix | Delete
{
[21] Fix | Delete
$nodes = ['body' => $body];
[22] Fix | Delete
if (null !== $variables) {
[23] Fix | Delete
$nodes['variables'] = $variables;
[24] Fix | Delete
}
[25] Fix | Delete
parent::__construct($nodes, ['only' => (bool) $only], $lineno, $tag);
[26] Fix | Delete
}
[27] Fix | Delete
public function compile(\WPML\Core\Twig\Compiler $compiler)
[28] Fix | Delete
{
[29] Fix | Delete
$compiler->addDebugInfo($this);
[30] Fix | Delete
if ($this->hasNode('variables')) {
[31] Fix | Delete
$node = $this->getNode('variables');
[32] Fix | Delete
$varsName = $compiler->getVarName();
[33] Fix | Delete
$compiler->write(\sprintf('$%s = ', $varsName))->subcompile($node)->raw(";\n")->write(\sprintf("if (!twig_test_iterable(\$%s)) {\n", $varsName))->indent()->write("throw new RuntimeError('Variables passed to the \"with\" tag must be a hash.', ")->repr($node->getTemplateLine())->raw(", \$this->getSourceContext());\n")->outdent()->write("}\n")->write(\sprintf("\$%s = twig_to_array(\$%s);\n", $varsName, $varsName));
[34] Fix | Delete
if ($this->getAttribute('only')) {
[35] Fix | Delete
$compiler->write("\$context = ['_parent' => \$context];\n");
[36] Fix | Delete
} else {
[37] Fix | Delete
$compiler->write("\$context['_parent'] = \$context;\n");
[38] Fix | Delete
}
[39] Fix | Delete
$compiler->write(\sprintf("\$context = \$this->env->mergeGlobals(array_merge(\$context, \$%s));\n", $varsName));
[40] Fix | Delete
} else {
[41] Fix | Delete
$compiler->write("\$context['_parent'] = \$context;\n");
[42] Fix | Delete
}
[43] Fix | Delete
$compiler->subcompile($this->getNode('body'))->write("\$context = \$context['_parent'];\n");
[44] Fix | Delete
}
[45] Fix | Delete
}
[46] Fix | Delete
\class_alias('WPML\\Core\\Twig\\Node\\WithNode', 'WPML\\Core\\Twig_Node_With');
[47] Fix | Delete
[48] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function