public function dispatch($method, $uri)
{
$match = parent::dispatch($method, $uri);
switch ($match[0]) {
case FastRoute\Dispatcher::NOT_FOUND:
$response = $this->handleNotFound();
break;
case FastRoute\Dispatcher::METHOD_NOT_ALLOWED:
$allowed = (array) $match[1];
$response = $this->handleNotAllowed($allowed);
break;
case FastRoute\Dispatcher::FOUND:
default:
$handler = isset($this->routes[$match[1]]['callback']) ? $this->routes[$match[1]]['callback'] : $match[1];
$strategy = $this->routes[$match[1]]['strategy'];
$vars = (array) $match[2];
$response = $this->handleFound($handler, $strategy, $vars);
break;
}
return $response;
}