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: MacroTokenParser.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\BodyNode;
[13] Fix | Delete
use WPML\Core\Twig\Node\MacroNode;
[14] Fix | Delete
use WPML\Core\Twig\Node\Node;
[15] Fix | Delete
use WPML\Core\Twig\Token;
[16] Fix | Delete
/**
[17] Fix | Delete
* Defines a macro.
[18] Fix | Delete
*
[19] Fix | Delete
* {% macro input(name, value, type, size) %}
[20] Fix | Delete
* <input type="{{ type|default('text') }}" name="{{ name }}" value="{{ value|e }}" size="{{ size|default(20) }}" />
[21] Fix | Delete
* {% endmacro %}
[22] Fix | Delete
*
[23] Fix | Delete
* @final
[24] Fix | Delete
*/
[25] Fix | Delete
class MacroTokenParser extends \WPML\Core\Twig\TokenParser\AbstractTokenParser
[26] Fix | Delete
{
[27] Fix | Delete
public function parse(\WPML\Core\Twig\Token $token)
[28] Fix | Delete
{
[29] Fix | Delete
$lineno = $token->getLine();
[30] Fix | Delete
$stream = $this->parser->getStream();
[31] Fix | Delete
$name = $stream->expect(\WPML\Core\Twig\Token::NAME_TYPE)->getValue();
[32] Fix | Delete
$arguments = $this->parser->getExpressionParser()->parseArguments(\true, \true);
[33] Fix | Delete
$stream->expect(\WPML\Core\Twig\Token::BLOCK_END_TYPE);
[34] Fix | Delete
$this->parser->pushLocalScope();
[35] Fix | Delete
$body = $this->parser->subparse([$this, 'decideBlockEnd'], \true);
[36] Fix | Delete
if ($token = $stream->nextIf(\WPML\Core\Twig\Token::NAME_TYPE)) {
[37] Fix | Delete
$value = $token->getValue();
[38] Fix | Delete
if ($value != $name) {
[39] Fix | Delete
throw new \WPML\Core\Twig\Error\SyntaxError(\sprintf('Expected endmacro for macro "%s" (but "%s" given).', $name, $value), $stream->getCurrent()->getLine(), $stream->getSourceContext());
[40] Fix | Delete
}
[41] Fix | Delete
}
[42] Fix | Delete
$this->parser->popLocalScope();
[43] Fix | Delete
$stream->expect(\WPML\Core\Twig\Token::BLOCK_END_TYPE);
[44] Fix | Delete
$this->parser->setMacro($name, new \WPML\Core\Twig\Node\MacroNode($name, new \WPML\Core\Twig\Node\BodyNode([$body]), $arguments, $lineno, $this->getTag()));
[45] Fix | Delete
return new \WPML\Core\Twig\Node\Node();
[46] Fix | Delete
}
[47] Fix | Delete
public function decideBlockEnd(\WPML\Core\Twig\Token $token)
[48] Fix | Delete
{
[49] Fix | Delete
return $token->test('endmacro');
[50] Fix | Delete
}
[51] Fix | Delete
public function getTag()
[52] Fix | Delete
{
[53] Fix | Delete
return 'macro';
[54] Fix | Delete
}
[55] Fix | Delete
}
[56] Fix | Delete
\class_alias('WPML\\Core\\Twig\\TokenParser\\MacroTokenParser', 'WPML\\Core\\Twig_TokenParser_Macro');
[57] Fix | Delete
[58] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function