/** * @return Dispatcher */ protected function dispatcher() { return FastRoute\simpleDispatcher(function (RouteCollector $collector) { foreach ($this->directory as $request => $action) { list($method, $path) = explode(' ', $request, 2); $collector->addRoute($method, $this->directory->prefix($path), $action); } }); }