You are here

private function ClosureExpressionVisitor::andExpressions in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/doctrine/collections/lib/Doctrine/Common/Collections/Expr/ClosureExpressionVisitor.php \Doctrine\Common\Collections\Expr\ClosureExpressionVisitor::andExpressions()

Parameters

array $expressions:

Return value

callable

1 call to ClosureExpressionVisitor::andExpressions()
ClosureExpressionVisitor::walkCompositeExpression in vendor/doctrine/collections/lib/Doctrine/Common/Collections/Expr/ClosureExpressionVisitor.php
Converts a composite expression into the target query language output.

File

vendor/doctrine/collections/lib/Doctrine/Common/Collections/Expr/ClosureExpressionVisitor.php, line 199

Class

ClosureExpressionVisitor
Walks an expression graph and turns it into a PHP closure.

Namespace

Doctrine\Common\Collections\Expr

Code

private function andExpressions($expressions) {
  return function ($object) use ($expressions) {
    foreach ($expressions as $expression) {
      if (!$expression($object)) {
        return false;
      }
    }
    return true;
  };
}