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: IfNode.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
/**
[14] Fix | Delete
* Represents an if node.
[15] Fix | Delete
*
[16] Fix | Delete
* @author Fabien Potencier <fabien@symfony.com>
[17] Fix | Delete
*/
[18] Fix | Delete
class IfNode extends \WPML\Core\Twig\Node\Node
[19] Fix | Delete
{
[20] Fix | Delete
public function __construct(\WPML\Core\Twig_NodeInterface $tests, \WPML\Core\Twig_NodeInterface $else = null, $lineno, $tag = null)
[21] Fix | Delete
{
[22] Fix | Delete
$nodes = ['tests' => $tests];
[23] Fix | Delete
if (null !== $else) {
[24] Fix | Delete
$nodes['else'] = $else;
[25] Fix | Delete
}
[26] Fix | Delete
parent::__construct($nodes, [], $lineno, $tag);
[27] Fix | Delete
}
[28] Fix | Delete
public function compile(\WPML\Core\Twig\Compiler $compiler)
[29] Fix | Delete
{
[30] Fix | Delete
$compiler->addDebugInfo($this);
[31] Fix | Delete
for ($i = 0, $count = \count($this->getNode('tests')); $i < $count; $i += 2) {
[32] Fix | Delete
if ($i > 0) {
[33] Fix | Delete
$compiler->outdent()->write('} elseif (');
[34] Fix | Delete
} else {
[35] Fix | Delete
$compiler->write('if (');
[36] Fix | Delete
}
[37] Fix | Delete
$compiler->subcompile($this->getNode('tests')->getNode($i))->raw(") {\n")->indent()->subcompile($this->getNode('tests')->getNode($i + 1));
[38] Fix | Delete
}
[39] Fix | Delete
if ($this->hasNode('else')) {
[40] Fix | Delete
$compiler->outdent()->write("} else {\n")->indent()->subcompile($this->getNode('else'));
[41] Fix | Delete
}
[42] Fix | Delete
$compiler->outdent()->write("}\n");
[43] Fix | Delete
}
[44] Fix | Delete
}
[45] Fix | Delete
\class_alias('WPML\\Core\\Twig\\Node\\IfNode', 'WPML\\Core\\Twig_Node_If');
[46] Fix | Delete
[47] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function