Вход Регистрация
Файл: upload/core/vendor/twig/twig/src/Node/Expression/MethodCallExpression.php
Строк: 63
<?php

/*
 * This file is part of Twig.
 *
 * (c) Fabien Potencier
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace TwigNodeExpression;

use 
TwigCompiler;
use 
TwigNodeExpressionVariableContextVariable;

class 
MethodCallExpression extends AbstractExpression implements SupportDefinedTestInterface
{
    use 
SupportDefinedTestDeprecationTrait;
    use 
SupportDefinedTestTrait;

    public function 
__construct(AbstractExpression $nodestring $methodArrayExpression $argumentsint $lineno)
    {
        
trigger_deprecation('twig/twig''3.15''The "%s" class is deprecated, use "%s" instead.'__CLASS__MacroReferenceExpression::class);

        
parent::__construct(['node' => $node'arguments' => $arguments], ['method' => $method'safe' => false], $lineno);

        if (
$node instanceof ContextVariable) {
            
$node->setAttribute('always_defined'true);
        }
    }

    public function 
compile(Compiler $compiler): void
    
{
        if (
$this->definedTest) {
            
$compiler
                
->raw('method_exists($macros[')
                ->
repr($this->getNode('node')->getAttribute('name'))
                ->
raw('], ')
                ->
repr($this->getAttribute('method'))
                ->
raw(')')
            ;

            return;
        }

        
$compiler
            
->raw('CoreExtension::callMacro($macros[')
            ->
repr($this->getNode('node')->getAttribute('name'))
            ->
raw('], ')
            ->
repr($this->getAttribute('method'))
            ->
raw(', ')
            ->
subcompile($this->getNode('arguments'))
            ->
raw(', ')
            ->
repr($this->getTemplateLine())
            ->
raw(', $context, $this->getSourceContext())');
    }
}
Онлайн: 0
Реклама