[ Index ]

PHP Cross Reference of phpBB-3.3.14-deutsch

title

Body

[close]

/vendor/symfony/twig-bridge/Node/ -> StopwatchNode.php (source)

   1  <?php
   2  
   3  /*
   4   * This file is part of the Symfony package.
   5   *
   6   * (c) Fabien Potencier <fabien@symfony.com>
   7   *
   8   * For the full copyright and license information, please view the LICENSE
   9   * file that was distributed with this source code.
  10   */
  11  
  12  namespace Symfony\Bridge\Twig\Node;
  13  
  14  use Twig\Compiler;
  15  use Twig\Node\Expression\AssignNameExpression;
  16  use Twig\Node\Node;
  17  
  18  /**
  19   * Represents a stopwatch node.
  20   *
  21   * @author Wouter J <wouter@wouterj.nl>
  22   */
  23  class StopwatchNode extends Node
  24  {
  25      public function __construct(Node $name, Node $body, AssignNameExpression $var, $lineno = 0, $tag = null)
  26      {
  27          parent::__construct(['body' => $body, 'name' => $name, 'var' => $var], [], $lineno, $tag);
  28      }
  29  
  30      public function compile(Compiler $compiler)
  31      {
  32          $compiler
  33              ->addDebugInfo($this)
  34              ->write('')
  35              ->subcompile($this->getNode('var'))
  36              ->raw(' = ')
  37              ->subcompile($this->getNode('name'))
  38              ->write(";\n")
  39              ->write("\$this->env->getExtension('Symfony\Bridge\Twig\Extension\StopwatchExtension')->getStopwatch()->start(")
  40              ->subcompile($this->getNode('var'))
  41              ->raw(", 'template');\n")
  42              ->subcompile($this->getNode('body'))
  43              ->write("\$this->env->getExtension('Symfony\Bridge\Twig\Extension\StopwatchExtension')->getStopwatch()->stop(")
  44              ->subcompile($this->getNode('var'))
  45              ->raw(");\n")
  46          ;
  47      }
  48  }


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