You are here

public function Twig_Tests_NodeVisitor_OptimizerTest::checkForConfiguration in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/twig/twig/test/Twig/Tests/NodeVisitor/OptimizerTest.php \Twig_Tests_NodeVisitor_OptimizerTest::checkForConfiguration()
1 call to Twig_Tests_NodeVisitor_OptimizerTest::checkForConfiguration()
Twig_Tests_NodeVisitor_OptimizerTest::testForOptimizer in vendor/twig/twig/test/Twig/Tests/NodeVisitor/OptimizerTest.php
@dataProvider getTestsForForOptimizer

File

vendor/twig/twig/test/Twig/Tests/NodeVisitor/OptimizerTest.php, line 105

Class

Twig_Tests_NodeVisitor_OptimizerTest

Code

public function checkForConfiguration(Twig_NodeInterface $node = null, $target, $withLoop) {
  if (null === $node) {
    return;
  }
  foreach ($node as $n) {
    if ($n instanceof Twig_Node_For) {
      if ($target === $n
        ->getNode('value_target')
        ->getAttribute('name')) {
        return $withLoop == $n
          ->getAttribute('with_loop');
      }
    }
    $ret = $this
      ->checkForConfiguration($n, $target, $withLoop);
    if (null !== $ret) {
      return $ret;
    }
  }
}