handler = $handler; if ($handler instanceof Closure) { $class->bind(); } return $class; } /** * @return mixed * 执行函数 * @throws \Exception */ public function dispatch(): mixed { $dispatchParam = Context::getContext('dispatch-param'); if (empty($dispatchParam)) { $dispatchParam = [\request()]; } return \aop($this->handler, $dispatchParam); } /** * */ protected function bind() { $this->handler = Closure::bind($this->handler, new Controller()); } }