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: ApplyTokenParser.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\Node\Expression\TempNameExpression;
[12] Fix | Delete
use WPML\Core\Twig\Node\Node;
[13] Fix | Delete
use WPML\Core\Twig\Node\PrintNode;
[14] Fix | Delete
use WPML\Core\Twig\Node\SetNode;
[15] Fix | Delete
use WPML\Core\Twig\Token;
[16] Fix | Delete
/**
[17] Fix | Delete
* Applies filters on a section of a template.
[18] Fix | Delete
*
[19] Fix | Delete
* {% apply upper %}
[20] Fix | Delete
* This text becomes uppercase
[21] Fix | Delete
* {% endapplys %}
[22] Fix | Delete
*/
[23] Fix | Delete
final class ApplyTokenParser extends \WPML\Core\Twig\TokenParser\AbstractTokenParser
[24] Fix | Delete
{
[25] Fix | Delete
public function parse(\WPML\Core\Twig\Token $token)
[26] Fix | Delete
{
[27] Fix | Delete
$lineno = $token->getLine();
[28] Fix | Delete
$name = $this->parser->getVarName();
[29] Fix | Delete
$ref = new \WPML\Core\Twig\Node\Expression\TempNameExpression($name, $lineno);
[30] Fix | Delete
$ref->setAttribute('always_defined', \true);
[31] Fix | Delete
$filter = $this->parser->getExpressionParser()->parseFilterExpressionRaw($ref, $this->getTag());
[32] Fix | Delete
$this->parser->getStream()->expect(\WPML\Core\Twig\Token::BLOCK_END_TYPE);
[33] Fix | Delete
$body = $this->parser->subparse([$this, 'decideApplyEnd'], \true);
[34] Fix | Delete
$this->parser->getStream()->expect(\WPML\Core\Twig\Token::BLOCK_END_TYPE);
[35] Fix | Delete
return new \WPML\Core\Twig\Node\Node([new \WPML\Core\Twig\Node\SetNode(\true, $ref, $body, $lineno, $this->getTag()), new \WPML\Core\Twig\Node\PrintNode($filter, $lineno, $this->getTag())]);
[36] Fix | Delete
}
[37] Fix | Delete
public function decideApplyEnd(\WPML\Core\Twig\Token $token)
[38] Fix | Delete
{
[39] Fix | Delete
return $token->test('endapply');
[40] Fix | Delete
}
[41] Fix | Delete
public function getTag()
[42] Fix | Delete
{
[43] Fix | Delete
return 'apply';
[44] Fix | Delete
}
[45] Fix | Delete
}
[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