自动补全的结果集.

@param callable $callable

@return $this
167151
public function match($callable)
    {
        $this->remote = lego_register(
            AutoCompleteMatchHandler::class,
            $callable,
            md5(__CLASS__ . $this->name())
        )->remote();

        return $this;
    }
1305250
public function _or(callable $callable = null)
    {
        $history = $this->opIsAnd;
        $this->opIsAnd = false;

        if (is_callable($callable)) {
            $this->lBrackets();
            $callable();
            $this->rBrackets();
            $this->opIsAnd = $history;
        }

        return $this;
    }
901453
protected function reflectCallable($callable)
	{
		if (is_string($callable) && strpos($callable, '::')) {
			$callable = explode('::', $callable, 2);
		}

		if (is_a($callable, 'Closure')) {
			$reflection = new \ReflectionFunction($callable);
		} else if (is_object($callable)) {
			$reflection = new \ReflectionMethod(get_class($callable), '__invoke');
		} else if (is_array($callable) && count($callable) == 2) {
			$reflection = new \ReflectionMethod((is_object($callable[0]) ? get_class($callable[0]) : $callable[0]), $callable[1]);
		} else if (is_string($callable) && function_exists($callable)) {
			$reflection = new \ReflectionFunction($callable);
		}

		return $reflection;
	}
510591
public function each(callable $function): self {
        foreach ($this->nodes as $index => $node) {
            $result = $function($node, $index);

            if ($result === false) {
                break;
            }
        }

        return $this;
    }
164671
public function insert($table, callable $callable = null)
    {

        $this->connect($table);
        $insert = new Insert($this);

        return $callable($insert);
    }
1098887
public function extend($name, callable $callable)
    {
        $name = $name == '*' ? '*.*.*' : $name;
        $this->checkSegmentCount($name);
        $this->_extensions[$name] = $callable;

        return $this;
    }
1232404
public function traverseFilters(callable $callable)
    {
        foreach ($this->filters() as $expr) {
            /**
             * @param  FilterInterface           $expr The iterated filter expression object.
             * @param  FilterCollectionInterface $this The context of the traversal.
             * @return void
             */
            $callable($expr, $this);
            if ($expr instanceof FilterCollectionInterface) {
                $expr->traverseFilters($callable);
            }
        }

        return $this;
    }
1073567
public function resolve($callable)
    {
        if (is_string($callable) && strpos($callable, '::') !== false) {
            $callable = explode('::', $callable, 2);
        }

        $callable = $this->resolveFromContainer($callable);

        if (! is_callable($callable)) {
            throw NotCallableException::fromInvalidCallable($callable, true);
        }

        return $callable;
    }
779374
public static function getReflectionCallable($callable)
    {
        if (is_callable($callable, true)) {
            try {
                if (is_object($callable)) {
                    return new ReflectionFunction($callable);
                }
                if (is_array($callable)) {
                    return new ReflectionMethod($callable[0], $callable[1]);
                }
                if (strpos($callable, '::') === false) {
                    return new ReflectionFunction($callable);
                }
                return new ReflectionMethod($callable);
            } catch (ReflectionException $exception) {
            }
        }
        return false;
    }
305138
public function callable(callable $callable): BaseQueryRelateContract
    {
        $query = call_user_func($callable, $this->query);
        if ($query instanceof Builder) {
            $this->query = $query;
        }

        return $this;
    }
127270
static function prototype(callable $callable) {
        /** @var \ReflectionMethod|\ReflectionFunction  $prototype */
        
        if(\is_array($callable)) {
            $prototype = new \ReflectionMethod($callable[0], $callable[1]);
        } else {
            $prototype = new \ReflectionFunction($callable);
        }
        
        $signature = '';
        
        /** @var \ReflectionParameter  $param */
        foreach($prototype->getParameters() as $param) {
            $type = $param->getType();
            $signature .= ($type->allowsNull() ? '?' : '').$type->getName().($param->isOptional() ? '?' : '').',';
        }
        
        $signature = \substr($signature, 0, -1);
        
        $return = $prototype->getReturnType();
        if($return !== null) {
            $signature .= '='.($return->allowsNull() ? '?' : '').$return->getName();
        }
        
        if(empty($signature)) {
            throw new \InvalidArgumentException('Given callable has no signature to build');
        }
        
        return $signature;
    }
801689
public function setActiveFromCallable(callable $callable)
    {
        $this->applyToAll(function (Menu $menu) use ($callable) {
            $menu->setActiveFromCallable($callable);
        });

        $type = Reflection::firstParameterType($callable);

        $this->applyToAll(function (Activatable $item) use ($callable, $type) {
            if (! Reflection::itemMatchesType($item, $type)) {
                return;
            }

            if ($callable($item)) {
                $item->setActive();
                $item->setExactActive();
            }
        });

        return $this;
    }
1036459
public function each(callable $callback)
    {
        foreach ($this->all() as $key => $value) {
            $callback($key, $value);
        }

        return $this;
    }
228913
protected function callableOptions($callable)
    {
        // resolve closure
        if (is_callable($callable)) {
            return $callable;
        }

        // resolve callable "Class@method" style
        if (is_string($callable) && list($class, $method) = explode('@', $callable)) {
            return [app()->make($class), $method];
        }

        // resolve callable [$object, "method"]
        if (2 === count($callable) && array_key_exists(0, $callable) && array_key_exists(1, $callable)) {
            if (is_object($class = $callable[0]) && is_string($method = $callable[1]) && method_exists($class, $method)) {
                return [$class, $method];
            }
        }

        return false;
    }
798431
public function withTransaction(callable $callable)
    {
        try {
            $nested = $this->transactionStarted;
            if (!$nested) {
                $this->startTransaction();
            }
            $this->transactionStarted = true;
            $result = $callable();
            if (!$nested) {
                $this->commit();
            }
            $this->transactionStarted = $nested;
            return $result;
        } catch (Throwable $e) {
            if ($this->transactionStarted) {
                $this->rollback();
                $this->transactionStarted = false;
            }
            throw $e;
        }
    }
514349
public function filter($callable = '')
    {
        if ($callable != '' && !$this->isCallable($callable)) {
            throw new ArrayObjectException(ArrayObjectException::MSG_INVALID_PARAM, [
                '$callable',
                'a callable function or method'
            ]);
        }

        if ($callable == '') {
            // Filter all values equal to FALSE
            $this->val(array_filter($this->val()));
        } else {
            // Filter values using a callback
            $this->val(array_filter($this->val(), $callable));
        }

        return $this;
    }
489335
public function dynamic($callable)
    {
        return $this->attributes[$this->attribute] = new self::$classMap['dynamic']($this->attribute, $this->entity, $callable);
    }