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/TokenPar...
File: UseTokenParser.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\TokenParser;
[10] Fix | Delete
[11] Fix | Delete
use WPML\Core\Twig\Error\SyntaxError;
[12] Fix | Delete
use WPML\Core\Twig\Node\Expression\ConstantExpression;
[13] Fix | Delete
use WPML\Core\Twig\Node\Node;
[14] Fix | Delete
use WPML\Core\Twig\Token;
[15] Fix | Delete
/**
[16] Fix | Delete
* Imports blocks defined in another template into the current template.
[17] Fix | Delete
*
[18] Fix | Delete
* {% extends "base.html" %}
[19] Fix | Delete
*
[20] Fix | Delete
* {% use "blocks.html" %}
[21] Fix | Delete
*
[22] Fix | Delete
* {% block title %}{% endblock %}
[23] Fix | Delete
* {% block content %}{% endblock %}
[24] Fix | Delete
*
[25] Fix | Delete
* @see https://twig.symfony.com/doc/templates.html#horizontal-reuse for details.
[26] Fix | Delete
*
[27] Fix | Delete
* @final
[28] Fix | Delete
*/
[29] Fix | Delete
class UseTokenParser extends \WPML\Core\Twig\TokenParser\AbstractTokenParser
[30] Fix | Delete
{
[31] Fix | Delete
public function parse(\WPML\Core\Twig\Token $token)
[32] Fix | Delete
{
[33] Fix | Delete
$template = $this->parser->getExpressionParser()->parseExpression();
[34] Fix | Delete
$stream = $this->parser->getStream();
[35] Fix | Delete
if (!$template instanceof \WPML\Core\Twig\Node\Expression\ConstantExpression) {
[36] Fix | Delete
throw new \WPML\Core\Twig\Error\SyntaxError('The template references in a "use" statement must be a string.', $stream->getCurrent()->getLine(), $stream->getSourceContext());
[37] Fix | Delete
}
[38] Fix | Delete
$targets = [];
[39] Fix | Delete
if ($stream->nextIf('with')) {
[40] Fix | Delete
do {
[41] Fix | Delete
$name = $stream->expect(\WPML\Core\Twig\Token::NAME_TYPE)->getValue();
[42] Fix | Delete
$alias = $name;
[43] Fix | Delete
if ($stream->nextIf('as')) {
[44] Fix | Delete
$alias = $stream->expect(\WPML\Core\Twig\Token::NAME_TYPE)->getValue();
[45] Fix | Delete
}
[46] Fix | Delete
$targets[$name] = new \WPML\Core\Twig\Node\Expression\ConstantExpression($alias, -1);
[47] Fix | Delete
if (!$stream->nextIf(\WPML\Core\Twig\Token::PUNCTUATION_TYPE, ',')) {
[48] Fix | Delete
break;
[49] Fix | Delete
}
[50] Fix | Delete
} while (\true);
[51] Fix | Delete
}
[52] Fix | Delete
$stream->expect(\WPML\Core\Twig\Token::BLOCK_END_TYPE);
[53] Fix | Delete
$this->parser->addTrait(new \WPML\Core\Twig\Node\Node(['template' => $template, 'targets' => new \WPML\Core\Twig\Node\Node($targets)]));
[54] Fix | Delete
return new \WPML\Core\Twig\Node\Node();
[55] Fix | Delete
}
[56] Fix | Delete
public function getTag()
[57] Fix | Delete
{
[58] Fix | Delete
return 'use';
[59] Fix | Delete
}
[60] Fix | Delete
}
[61] Fix | Delete
\class_alias('WPML\\Core\\Twig\\TokenParser\\UseTokenParser', 'WPML\\Core\\Twig_TokenParser_Use');
[62] Fix | Delete
[63] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function