You are here

protected function Twig_NodeVisitor_SafeAnalysis::intersectSafe in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/twig/twig/lib/Twig/NodeVisitor/SafeAnalysis.php \Twig_NodeVisitor_SafeAnalysis::intersectSafe()
1 call to Twig_NodeVisitor_SafeAnalysis::intersectSafe()
Twig_NodeVisitor_SafeAnalysis::doLeaveNode in vendor/twig/twig/lib/Twig/NodeVisitor/SafeAnalysis.php
Called after child nodes are visited.

File

vendor/twig/twig/lib/Twig/NodeVisitor/SafeAnalysis.php, line 130

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);
}