vendor/twig/twig/src/Node/DoNode.php line 24

Open in your IDE?
  1. <?php
  2. /*
  3. * This file is part of Twig.
  4. *
  5. * (c) Fabien Potencier
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Twig\Node;
  11. use Twig\Compiler;
  12. use Twig\Node\Expression\AbstractExpression;
  13. /**
  14. * Represents a do node.
  15. *
  16. * @author Fabien Potencier <fabien@symfony.com>
  17. */
  18. class DoNode extends Node
  19. {
  20. public function __construct(AbstractExpression $expr, int $lineno, string $tag = null)
  21. {
  22. parent::__construct(['expr' => $expr], [], $lineno, $tag);
  23. }
  24. public function compile(Compiler $compiler)
  25. {
  26. $compiler
  27. ->addDebugInfo($this)
  28. ->write('')
  29. ->subcompile($this->getNode('expr'))
  30. ->raw(";\n")
  31. ;
  32. }
  33. }
  34. class_alias('Twig\Node\DoNode', 'Twig_Node_Do');