function Debug::getFunctions

File

src/Twig/Extension/Debug.php, line 39

Class

Debug
Provides the Devel debugging function within Twig templates.

Namespace

Drupal\devel\Twig\Extension

Code

public function getFunctions() {
  $options = [
    'is_safe' => [
      'html',
    ],
    'needs_environment' => TRUE,
    'needs_context' => TRUE,
    'is_variadic' => TRUE,
  ];
  return [
    new TwigFunction('devel_dump', [
      $this,
      'dump',
    ], $options),
    new TwigFunction('devel_message', [
      $this,
      'message',
    ], $options),
    new TwigFunction('dpm', [
      $this,
      'message',
    ], $options),
    new TwigFunction('dsm', [
      $this,
      'message',
    ], $options),
    new TwigFunction('devel_breakpoint', [
      $this,
      'breakpoint',
    ], [
      'needs_environment' => TRUE,
      'needs_context' => TRUE,
      'is_variadic' => TRUE,
    ]),
  ];
}