You are here

public function Twig_Extension_Debug::getFunctions in Translation template extractor 7.3

Same name and namespace in other branches
  1. 6.3 vendor/Twig/Extension/Debug.php \Twig_Extension_Debug::getFunctions()

Returns a list of functions to add to the existing list.

Return value

Twig_SimpleFunction[]

Overrides Twig_Extension::getFunctions

File

vendor/Twig/Extension/Debug.php, line 13

Class

Twig_Extension_Debug

Code

public function getFunctions() {

  // dump is safe if var_dump is overridden by xdebug
  $isDumpOutputHtmlSafe = extension_loaded('xdebug') && (false === ini_get('xdebug.overload_var_dump') || ini_get('xdebug.overload_var_dump')) && (false === ini_get('html_errors') || ini_get('html_errors')) || 'cli' === php_sapi_name();
  return array(
    new Twig_SimpleFunction('dump', 'twig_var_dump', array(
      'is_safe' => $isDumpOutputHtmlSafe ? array(
        'html',
      ) : array(),
      'needs_context' => true,
      'needs_environment' => true,
    )),
  );
}