middlewares) || !isset($this->middlewares[$this->offset])) { [$controller, $action] = $this->handler->callback; $controller = Kiri::getDi()->get($controller); return call_user_func([$controller, $action], ...$this->handler->params); } $middleware = $this->middlewares[$this->offset]; if (!($middleware instanceof MiddlewareInterface)) { throw new \Exception('get_implements_class($middleware) not found method process.'); } ++$this->offset; return $middleware->process($request, $this); } }