TestProfilerExtension.php

Same filename and directory in other branches
  1. 11.x core/modules/system/tests/modules/sdc_other_node_visitor/src/Twig/Extension/TestProfilerExtension.php
  2. 10 core/modules/system/tests/modules/sdc_other_node_visitor/src/Twig/Extension/TestProfilerExtension.php

Namespace

Drupal\sdc_other_node_visitor\Twig\Extension

File

core/modules/system/tests/modules/sdc_other_node_visitor/src/Twig/Extension/TestProfilerExtension.php

View source
<?php

declare (strict_types=1);
namespace Drupal\sdc_other_node_visitor\Twig\Extension;

use Drupal\sdc_other_node_visitor\Twig\NodeVisitor\TestNodeVisitor;
use Twig\Extension\AbstractExtension;

/**
 * Twig extension to add a test node visitor.
 */
class TestProfilerExtension extends AbstractExtension {
  
  /**
   * {@inheritdoc}
   */
  public function getNodeVisitors() : array {
    return [
      new TestNodeVisitor(static::class),
    ];
  }
  
  /**
   * Dummy function called when a Twig template is entered.
   */
  public function enter() {
    // NOOP.
  }
  
  /**
   * Dummy function called when a Twig template is left.
   */
  public function leave() {
    // NOOP.
  }

}

Classes

Title Deprecated Summary
TestProfilerExtension Twig extension to add a test node visitor.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.