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

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

namespace TwigNodeExpressionBinary;

use 
TwigCompiler;
use 
TwigNodeExpressionAbstractExpression;
use 
TwigNodeNode;

abstract class 
AbstractBinary extends AbstractExpression implements BinaryInterface
{
    
/**
     * @param AbstractExpression $left
     * @param AbstractExpression $right
     */
    
public function __construct(Node $leftNode $rightint $lineno)
    {
        if (!
$left instanceof AbstractExpression) {
            
trigger_deprecation('twig/twig''3.15''Not passing a "%s" instance to the "left" argument of "%s" is deprecated ("%s" given).'AbstractExpression::class, static::class, $left::class);
        }
        if (!
$right instanceof AbstractExpression) {
            
trigger_deprecation('twig/twig''3.15''Not passing a "%s" instance to the "right" argument of "%s" is deprecated ("%s" given).'AbstractExpression::class, static::class, $right::class);
        }

        
parent::__construct(['left' => $left'right' => $right], [], $lineno);
    }

    public function 
compile(Compiler $compiler): void
    
{
        
$compiler
            
->raw('(')
            ->
subcompile($this->getNode('left'))
            ->
raw(' ')
        ;
        
$this->operator($compiler);
        
$compiler
            
->raw(' ')
            ->
subcompile($this->getNode('right'))
            ->
raw(')')
        ;
    }

    abstract public function 
operator(Compiler $compiler): Compiler;
}
Онлайн: 0
Реклама