获取执行参数
@param callable $callable
@param string $tool
@param string $operation
@return array
773217
private static function getCallToolArgs($callable, $tool, $operation)
    {
        $className = get_parent_class($callable[0]);
        $methodRef = new \ReflectionMethod($className, $callable[1]);
        $annotations = ToolParser::getInstance()->getData()['class'][$className]['Methods'][$methodRef->name]['Args'] ?? [];
        $args = [];
        foreach($methodRef->getParameters() as $param)
        {
            $annotation = $annotations[$param->name] ?? null;
            if(null === $annotation)
            {
                $value = $param->isOptional() ? $param->getDefaultValue() : null;
            }
            else if(Args::exists($annotation->name))
            {
                $value = static::parseArgValue(Args::get($annotation->name), $annotation);
            }
            else if($annotation->required)
            {
                throw new \InvalidArgumentException(sprintf('tool %s/%s param %s is required', $tool, $operation, $annotation->name));
            }
            else
            {
                $value = $annotation->default;
            }
            $args[] = $value;
        }
        return $args;
    }
1107644
public static function executeCallableRoute(callable $call, $route = '')
    {
        call_user_func($call);
        Cml::$debug && Debug::addTipInfo(Lang::get('_CML_EXECUTION_ROUTE_IS_', "callable route:{{$route}}", Config::get('url_model')));
        Cml::cmlStop();
    }
974754
protected function loop($data, Closure $callable)
    {
        if (!is_array($data) && !is_object($data)) {
            return;
        }

        foreach ($data as $key => $value) {
            call_user_func_array($callable, [$key, $value]);
        }
    }
1117271
private function listParameters(callable $callable): array
    {
        $parameters = [];
        foreach ($this->getReflection($callable)->getParameters() as $parameter) {
            $parameters[$parameter->getName()] = $parameter;
        }

        return $parameters;
    }
896874
public function invoke(Callable $callable)
	{
		$reflection = $this->reflectCallable($callable);

		$args = [];

		foreach($reflection->getParameters() as $param) {
			$type = $param->getClass()->getName();

			if (in_array($type, $this->resolving)) {
				throw new \LogicException("Recursive dependency: $type is currently instatiating.");
			}

			$args[] = ($param->allowsNull() && !isset($this[$type])) ? null : $this[$type];
		}

		return call_user_func_array($callable, $args);
	}
677332
public static function methodCall(string $method, string $message, $_ = null) : InvalidOperationException
    {
        return self::formatArray('Invalid call to %s: ' . $message, array_merge([$method], array_slice(func_get_args(), 2)));
    }
762743
private function _method($name, callable $callable)
    {
        $lastPattern = array_pop($this->_patterns);
        if ($lastPattern) {
            $methods = $lastPattern[6];//路由方法
            $methods[$name] = $callable;
            $lastPattern[6] = $methods;
            $this->_patterns[] = $lastPattern;
        }
        return $this;
    }
513303
public function leftJoin($table, callable $callable = null)
    {
        $table = $this->getPrefix().$table;

        if (is_null($this->join)) {
            $this->join = 'left join `'.$table.'`';

            if (is_callable($callable)) {
                $callable($this);
            }

            return $this;
        }

        if (!preg_match('/^(inner|right)\sjoin\s.*/', $this->join)) {
            $this->join .= ', `'.$table.'`';

            if (is_callable($callable)) {
                $callable($this);
            }

            return $this;
        }

        throw new QueryBuilderException(
            'The inner join clause is already in effect.',
            E_ERROR
        );
    }
1251996
public function runWithBeforeAfterEvents(callable $callable)
    {
        $results = false;

        // Fire the task if the before event passes
        if ($this->fireEvent('before')) {
            $results = $this->timer->time($this, $callable);
            if ($results && !$this->wasHalted()) {
                $this->fireEvent('after');
            }
        }

        return $results;
    }
420063
public function delete($table, callable $callable = null)
    {
        $this->connect($table);
        $delete = new Delete($this);

        return $callable($delete);
    }
975105
private function getParametersInOrder(callable $callable): array
    {
        if (null === $this->parametersCache) {
            $this->parametersCache = $this->listParameters($callable);
        }

        return $this->parametersCache;
    }
67583
public function invoke($callable, $arguments = []): self
    {
        // If one argument given for each iteration, create an array for it.
        if (!\is_array($arguments)) {
            $arguments = \array_fill(
                0,
                \count($this->getArray(), \COUNT_NORMAL),
                $arguments
            );
        }

        // If the callable has arguments, pass them.
        if ($arguments) {
            $array = \array_map($callable, $this->getArray(), $arguments);
        } else {
            $array = $this->map($callable);
        }

        return static::create(
            $array,
            $this->iteratorClass,
            false
        );
    }
1069905
public static function fromCallable(callable $callable)
    {
        $reflection = Reflection::fromCallable($callable);

        return new self(
                $callable,
                $reflection,
                FunctionSignature::fromReflection($reflection),
                FunctionLocation::fromReflection($reflection),
                FunctionScope::fromReflection($reflection, $callable));
    }
707453
public function removeHook($command, $callable)
    {
        if (isset($this->hooks[$command]) &&
            array_search($callable, $this->hooks[$command]) !== false
        ) {
            $hook = array_search($callable, $this->hooks[$command]);
            unset($this->hooks[$command][$hook]);
            unset($hook);
        }
    }
685889
public function setCallable($callable)
    {
        $matches = array();
        if (is_string($callable) && preg_match('!^([^\:]+)\:([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)$!', $callable, $matches)) {
            $class = $matches[1];
            $method = $matches[2];
            $callable = function() use ($class, $method) {
                static $obj = null;
                if ($obj === null) {
                    $obj = new $class;
                }
                return call_user_func_array(array($obj, $method), func_get_args());
            };
        }

        if (!is_callable($callable)) {
            throw new \InvalidArgumentException('Route callable must be callable');
        }

        $this->callable = $callable;
    }
76617
public function defineInlineOperator(string $operator, callable $transformer)
    {
        unset($this->operators[$operator]);
        $this->inlineOperators[$operator] = $transformer;
    }
919333
public static function call(callable $callable, $args=[])
    {
        if (!is_array($args)) {
            $args = [$args];
        }

        switch (count($args)) {
            case 0:
                return call_user_func($callable);
            case 1:
                return call_user_func($callable, $args[0]);
            case 2:
                return call_user_func($callable, $args[0], $args[1]);
            case 3:
                return call_user_func($callable, $args[0], $args[1], $args[2]);
            case 4:
                return call_user_func($callable, $args[0], $args[1], $args[2], $args[3]);
        }

        return call_user_func_array($callable, $args);
    }