protected function Twig_NodeVisitor_SafeAnalysis::intersectSafe

1 call to Twig_NodeVisitor_SafeAnalysis::intersectSafe()
Twig_NodeVisitor_SafeAnalysis::leaveNode in drupal/core/vendor/twig/twig/lib/Twig/NodeVisitor/SafeAnalysis.php
Called after child nodes are visited.

File

drupal/core/vendor/twig/twig/lib/Twig/NodeVisitor/SafeAnalysis.php, line 95

Class

Twig_NodeVisitor_SafeAnalysis

Code

protected function intersectSafe(array $a = null, array $b = null) {
  if (null === $a || null === $b) {
    return array();
  }
  if (in_array('all', $a)) {
    return $b;
  }
  if (in_array('all', $b)) {
    return $a;
  }
  return array_intersect($a, $b);
}