Returns a fluent iterator returning elements of this fluent iterator that satisfy a predicate.
@param Closure $predicate
@return $this
556881
public function filter($predicate)
    {
        $this->iterator = Iterators::filter($this->iterator, $predicate);
        return $this;
    }
997403
public function rule(\Closure $closure = null)
    {
        if (null !== $closure) {
            $this->rules[] = $closure;

            return $this;
        }

        return $this->rules[] = new ExprBuilder($this->node);
    }
1015185
public function filter(callable $predicate): ArrayCollection
    {
        $items = [];

        foreach ($this->items as $key => $value) {
            if ($predicate($value, $key)) {
                $items[$key] = $value;
            }
        }

        return new static($items);
    }
662017
public function also( $subject, $predicate = null, $object = null ) {
		if ( $predicate === null ) {
			$this->where( $this->currentSubject, $this->currentPredicate, $subject );
		} else if ( $object === null ) {
			$this->where( $this->currentSubject, $subject, $predicate );
		} else {
			$this->where( $subject, $predicate, $object );
		}

		return $this;
	}
852403
public function orWhere(\Closure $closure = null) {
        $this->query->push(['OR']);
        if($closure !== null) $closure($this);

        return $this;
    }
701771
@CheckReturnValue
  public final FluentIterable<E> filter(Predicate<? super E> predicate) {
    return from(Iterables.filter(iterable, predicate));
  }
867969
public function select(callable $predicate)
    {
        return new Enumerator(
            function () use($predicate) {
                foreach ($this->each() as $k => $v) {
                    if (call_user_func($predicate, $v, $k)) {
                        yield $k => $v;
                    }
                }
            }
        );
    }
1276542
protected static function strictPredicate(
        callable $predicate,
        string $error
    ) : callable {
        return function ($value) use ($predicate, $error) : Result {
            return $predicate($value)
                ? Result::success()
                : Result::fatal($error);
        };
    }
797435
public static function captureQueries(\Closure $closure)
    {
        DB::enableQueryLog();
        $closure();
        $logs = DB::getQueryLog();
        return array_map(function ($log) {
            return static::inlineBindings($log['query'], $log['bindings']);
        }, $logs);
    }
98236
function getPredicateFunction(predicate) {
    let fn = predicate;
    if (_.isString(predicate)) {
        fn = node => (_.isFunction(node[predicate]) ? node[predicate]() : node[predicate]);
    }

    return fn;
}
415062
public function filter(Closure $closure): self
    {
        $filter = new Iterator\CustomFilterIterator($this->getIterator(), [$closure]);

        return new self(iterator_to_array($filter));
    }
748412
public function filter(callable $predicate): self
    {
        if ($this->isPresent() && $predicate($this->value)) {
            return $this;
        }

        return self::$null;
    }
150771
public function newNestedInstance(Closure $closure = null)
    {
        $query = $this->newInstance()->nested();

        if ($closure) {
            call_user_func($closure, $query);
        }

        return $query;
    }
1044496
public function formatPredicate(Predicate $predicate) {
        $output = [];

        foreach ($predicate->getParams() as $param) {
            if ($param instanceof Predicate) {
                $output[] = sprintf($this->getClause(self::GROUP), $this->formatPredicate($param));

            } else if ($param instanceof Expr) {
                $output[] = $this->formatExpression($param);
            }
        }

        return implode(' ' . $this->getKeyword($predicate->getType()) . ' ', $output);
    }
652767
public function apply($closure)
    {
        foreach ($this->_data as $key => $val) {
            $this->_data[$key] = $closure($val, $key, $this);
        }
        return $this;
    }
687429
public function apply($closure)
    {
        foreach ($this as $key => $val) {
            $this->offsetSet($key, $closure($val, $key, $this));
        }
        return $this;
    }
1362228
public function either(Closure $callback) {
        $predicate = new Predicate(self::EITHER);
        $predicate->bindCallback($callback);

        $this->_params[] = $predicate;

        $this->addBinding(null, $predicate);

        return $this;
    }