protected function createDispatcher() { return $this->dispatcher ?: \FastRoute\simpleDispatcher(function ($r) { foreach ($this->routes as $route) { $r->addRoute($route['method'], $route['uri'], $route['action']); } }); }