You are here

protected function Twig_Extension_Core::getTestNodeClass in Translation template extractor 6.3

Same name and namespace in other branches
  1. 7.3 vendor/Twig/Extension/Core.php \Twig_Extension_Core::getTestNodeClass()
1 call to Twig_Extension_Core::getTestNodeClass()
Twig_Extension_Core::parseTestExpression in vendor/Twig/Extension/Core.php

File

vendor/Twig/Extension/Core.php, line 341

Class

Twig_Extension_Core

Code

protected function getTestNodeClass(Twig_Parser $parser, $name) {
  $env = $parser
    ->getEnvironment();
  $testMap = $env
    ->getTests();
  if ($testMap[$name] instanceof Twig_SimpleTest) {
    return $testMap[$name]
      ->getNodeClass();
  }
  return $testMap[$name] instanceof Twig_Test_Node ? $testMap[$name]
    ->getClass() : 'Twig_Node_Expression_Test';
}