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: EmbedTokenParser.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\EmbedNode;
[12] Fix | Delete
use WPML\Core\Twig\Node\Expression\ConstantExpression;
[13] Fix | Delete
use WPML\Core\Twig\Node\Expression\NameExpression;
[14] Fix | Delete
use WPML\Core\Twig\Token;
[15] Fix | Delete
/**
[16] Fix | Delete
* Embeds a template.
[17] Fix | Delete
*
[18] Fix | Delete
* @final
[19] Fix | Delete
*/
[20] Fix | Delete
class EmbedTokenParser extends \WPML\Core\Twig\TokenParser\IncludeTokenParser
[21] Fix | Delete
{
[22] Fix | Delete
public function parse(\WPML\Core\Twig\Token $token)
[23] Fix | Delete
{
[24] Fix | Delete
$stream = $this->parser->getStream();
[25] Fix | Delete
$parent = $this->parser->getExpressionParser()->parseExpression();
[26] Fix | Delete
list($variables, $only, $ignoreMissing) = $this->parseArguments();
[27] Fix | Delete
$parentToken = $fakeParentToken = new \WPML\Core\Twig\Token(\WPML\Core\Twig\Token::STRING_TYPE, '__parent__', $token->getLine());
[28] Fix | Delete
if ($parent instanceof \WPML\Core\Twig\Node\Expression\ConstantExpression) {
[29] Fix | Delete
$parentToken = new \WPML\Core\Twig\Token(\WPML\Core\Twig\Token::STRING_TYPE, $parent->getAttribute('value'), $token->getLine());
[30] Fix | Delete
} elseif ($parent instanceof \WPML\Core\Twig\Node\Expression\NameExpression) {
[31] Fix | Delete
$parentToken = new \WPML\Core\Twig\Token(\WPML\Core\Twig\Token::NAME_TYPE, $parent->getAttribute('name'), $token->getLine());
[32] Fix | Delete
}
[33] Fix | Delete
// inject a fake parent to make the parent() function work
[34] Fix | Delete
$stream->injectTokens([new \WPML\Core\Twig\Token(\WPML\Core\Twig\Token::BLOCK_START_TYPE, '', $token->getLine()), new \WPML\Core\Twig\Token(\WPML\Core\Twig\Token::NAME_TYPE, 'extends', $token->getLine()), $parentToken, new \WPML\Core\Twig\Token(\WPML\Core\Twig\Token::BLOCK_END_TYPE, '', $token->getLine())]);
[35] Fix | Delete
$module = $this->parser->parse($stream, [$this, 'decideBlockEnd'], \true);
[36] Fix | Delete
// override the parent with the correct one
[37] Fix | Delete
if ($fakeParentToken === $parentToken) {
[38] Fix | Delete
$module->setNode('parent', $parent);
[39] Fix | Delete
}
[40] Fix | Delete
$this->parser->embedTemplate($module);
[41] Fix | Delete
$stream->expect(\WPML\Core\Twig\Token::BLOCK_END_TYPE);
[42] Fix | Delete
return new \WPML\Core\Twig\Node\EmbedNode($module->getTemplateName(), $module->getAttribute('index'), $variables, $only, $ignoreMissing, $token->getLine(), $this->getTag());
[43] Fix | Delete
}
[44] Fix | Delete
public function decideBlockEnd(\WPML\Core\Twig\Token $token)
[45] Fix | Delete
{
[46] Fix | Delete
return $token->test('endembed');
[47] Fix | Delete
}
[48] Fix | Delete
public function getTag()
[49] Fix | Delete
{
[50] Fix | Delete
return 'embed';
[51] Fix | Delete
}
[52] Fix | Delete
}
[53] Fix | Delete
\class_alias('WPML\\Core\\Twig\\TokenParser\\EmbedTokenParser', 'WPML\\Core\\Twig_TokenParser_Embed');
[54] Fix | Delete
[55] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function