[ Index ]

PHP Cross Reference of phpBB-3.3.14-deutsch

title

Body

[close]

/vendor/twig/twig/src/Node/Expression/ -> FilterExpression.php (source)

   1  <?php
   2  
   3  /*
   4   * This file is part of Twig.
   5   *
   6   * (c) Fabien Potencier
   7   * (c) Armin Ronacher
   8   *
   9   * For the full copyright and license information, please view the LICENSE
  10   * file that was distributed with this source code.
  11   */
  12  
  13  namespace Twig\Node\Expression;
  14  
  15  use Twig\Compiler;
  16  use Twig\Node\Node;
  17  
  18  class FilterExpression extends CallExpression
  19  {
  20      public function __construct(Node $node, ConstantExpression $filterName, Node $arguments, int $lineno, string $tag = null)
  21      {
  22          parent::__construct(['node' => $node, 'filter' => $filterName, 'arguments' => $arguments], [], $lineno, $tag);
  23      }
  24  
  25      public function compile(Compiler $compiler)
  26      {
  27          $name = $this->getNode('filter')->getAttribute('value');
  28          $filter = $compiler->getEnvironment()->getFilter($name);
  29  
  30          $this->setAttribute('name', $name);
  31          $this->setAttribute('type', 'filter');
  32          $this->setAttribute('needs_environment', $filter->needsEnvironment());
  33          $this->setAttribute('needs_context', $filter->needsContext());
  34          $this->setAttribute('arguments', $filter->getArguments());
  35          $this->setAttribute('callable', $filter->getCallable());
  36          $this->setAttribute('is_variadic', $filter->isVariadic());
  37  
  38          $this->compileCallable($compiler);
  39      }
  40  }
  41  
  42  class_alias('Twig\Node\Expression\FilterExpression', 'Twig_Node_Expression_Filter');


Generated: Mon Nov 25 19:05:08 2024 Cross-referenced by PHPXref 0.7.1