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: IncludeNode.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
* (c) Armin Ronacher
[6] Fix | Delete
*
[7] Fix | Delete
* For the full copyright and license information, please view the LICENSE
[8] Fix | Delete
* file that was distributed with this source code.
[9] Fix | Delete
*/
[10] Fix | Delete
namespace WPML\Core\Twig\Node;
[11] Fix | Delete
[12] Fix | Delete
use WPML\Core\Twig\Compiler;
[13] Fix | Delete
use WPML\Core\Twig\Node\Expression\AbstractExpression;
[14] Fix | Delete
/**
[15] Fix | Delete
* Represents an include node.
[16] Fix | Delete
*
[17] Fix | Delete
* @author Fabien Potencier <fabien@symfony.com>
[18] Fix | Delete
*/
[19] Fix | Delete
class IncludeNode extends \WPML\Core\Twig\Node\Node implements \WPML\Core\Twig\Node\NodeOutputInterface
[20] Fix | Delete
{
[21] Fix | Delete
public function __construct(\WPML\Core\Twig\Node\Expression\AbstractExpression $expr, \WPML\Core\Twig\Node\Expression\AbstractExpression $variables = null, $only = \false, $ignoreMissing = \false, $lineno, $tag = null)
[22] Fix | Delete
{
[23] Fix | Delete
$nodes = ['expr' => $expr];
[24] Fix | Delete
if (null !== $variables) {
[25] Fix | Delete
$nodes['variables'] = $variables;
[26] Fix | Delete
}
[27] Fix | Delete
parent::__construct($nodes, ['only' => (bool) $only, 'ignore_missing' => (bool) $ignoreMissing], $lineno, $tag);
[28] Fix | Delete
}
[29] Fix | Delete
public function compile(\WPML\Core\Twig\Compiler $compiler)
[30] Fix | Delete
{
[31] Fix | Delete
$compiler->addDebugInfo($this);
[32] Fix | Delete
if ($this->getAttribute('ignore_missing')) {
[33] Fix | Delete
$template = $compiler->getVarName();
[34] Fix | Delete
$compiler->write(\sprintf("\$%s = null;\n", $template))->write("try {\n")->indent()->write(\sprintf('$%s = ', $template));
[35] Fix | Delete
$this->addGetTemplate($compiler);
[36] Fix | Delete
$compiler->raw(";\n")->outdent()->write("} catch (LoaderError \$e) {\n")->indent()->write("// ignore missing template\n")->outdent()->write("}\n")->write(\sprintf("if (\$%s) {\n", $template))->indent()->write(\sprintf('$%s->display(', $template));
[37] Fix | Delete
$this->addTemplateArguments($compiler);
[38] Fix | Delete
$compiler->raw(");\n")->outdent()->write("}\n");
[39] Fix | Delete
} else {
[40] Fix | Delete
$this->addGetTemplate($compiler);
[41] Fix | Delete
$compiler->raw('->display(');
[42] Fix | Delete
$this->addTemplateArguments($compiler);
[43] Fix | Delete
$compiler->raw(");\n");
[44] Fix | Delete
}
[45] Fix | Delete
}
[46] Fix | Delete
protected function addGetTemplate(\WPML\Core\Twig\Compiler $compiler)
[47] Fix | Delete
{
[48] Fix | Delete
$compiler->write('$this->loadTemplate(')->subcompile($this->getNode('expr'))->raw(', ')->repr($this->getTemplateName())->raw(', ')->repr($this->getTemplateLine())->raw(')');
[49] Fix | Delete
}
[50] Fix | Delete
protected function addTemplateArguments(\WPML\Core\Twig\Compiler $compiler)
[51] Fix | Delete
{
[52] Fix | Delete
if (!$this->hasNode('variables')) {
[53] Fix | Delete
$compiler->raw(\false === $this->getAttribute('only') ? '$context' : '[]');
[54] Fix | Delete
} elseif (\false === $this->getAttribute('only')) {
[55] Fix | Delete
$compiler->raw('twig_array_merge($context, ')->subcompile($this->getNode('variables'))->raw(')');
[56] Fix | Delete
} else {
[57] Fix | Delete
$compiler->raw('twig_to_array(');
[58] Fix | Delete
$compiler->subcompile($this->getNode('variables'));
[59] Fix | Delete
$compiler->raw(')');
[60] Fix | Delete
}
[61] Fix | Delete
}
[62] Fix | Delete
}
[63] Fix | Delete
\class_alias('WPML\\Core\\Twig\\Node\\IncludeNode', 'WPML\\Core\\Twig_Node_Include');
[64] Fix | Delete
[65] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function