Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. AbstractUnary.php

class AbstractUnary

Hierarchy

  • class \Twig\Node\Node implements \Twig\Node\Countable, \Twig\Node\IteratorAggregate
    • class \Twig\Node\Expression\AbstractExpression extends \Twig\Node\Node
      • class \Twig\Node\Expression\Unary\AbstractUnary extends \Twig\Node\Expression\AbstractExpression

Expanded class hierarchy of AbstractUnary

2 files declare their use of AbstractUnary
Environment.php in vendor/twig/twig/src/Environment.php
ExpressionParser.php in vendor/twig/twig/src/ExpressionParser.php

File

vendor/twig/twig/src/Node/Expression/Unary/AbstractUnary.php, line 19

Namespace

Twig\Node\Expression\Unary
View source
abstract class AbstractUnary extends AbstractExpression {
    
    /**
     * @param AbstractExpression $node
     */
    public function __construct(Node $node, int $lineno) {
        if (!$node instanceof AbstractExpression) {
            trigger_deprecation('twig/twig', '3.15', 'Not passing a "%s" instance argument to "%s" is deprecated ("%s" given).', AbstractExpression::class, static::class, get_class($node));
        }
        parent::__construct([
            'node' => $node,
        ], [
            'with_parentheses' => false,
        ], $lineno);
    }
    public function compile(Compiler $compiler) : void {
        if ($this->hasExplicitParentheses()) {
            $compiler->raw('(');
        }
        else {
            $compiler->raw(' ');
        }
        $this->operator($compiler);
        $compiler->subcompile($this->getNode('node'));
        if ($this->hasExplicitParentheses()) {
            $compiler->raw(')');
        }
    }
    public abstract function operator(Compiler $compiler) : Compiler;

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title Overrides
AbstractExpression::hasExplicitParentheses public function
AbstractExpression::isGenerator public function
AbstractExpression::setExplicitParentheses public function
AbstractUnary::compile public function Overrides Node::compile
AbstractUnary::operator abstract public function 5
AbstractUnary::__construct public function Overrides Node::__construct
Node::$attributeNameDeprecations private property @var array<string, NameDeprecation>
Node::$attributes protected property
Node::$lineno protected property
Node::$nodeNameDeprecations private property @var array<string, NameDeprecation>
Node::$nodes protected property
Node::$sourceContext private property
Node::$tag protected property
Node::count public function
Node::deprecateAttribute public function
Node::deprecateNode public function
Node::getAttribute public function
Node::getIterator public function
Node::getNode public function
Node::getNodeTag public function
Node::getSourceContext public function
Node::getTemplateLine public function
Node::getTemplateName public function
Node::hasAttribute public function
Node::hasNode public function
Node::removeAttribute public function
Node::removeNode public function
Node::setAttribute public function
Node::setNode public function 1
Node::setNodeTag public function @internal
Node::setSourceContext public function
Node::__toString public function

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal