protected function getDispatcher()
{
if ($this->dispatchData !== null) {
$dispatchData = $this->dispatchData;
} else {
if ($this->routeCollector !== null) {
$dispatchData = $this->generateDispatchData();
} else {
throw new \RuntimeException('No dispatch data or route collector set');
}
}
return new Dispatcher($dispatchData);
}