src/Routing/Dispatcher.php
protected function retrieve(array $routes, $uri)
    {
        $routes = array_values(array_filter($routes));

        if (empty($routes)) {
            $message = 'Route "' . $uri . '" not found';

            throw new \UnexpectedValueException($message);
        }

        $route = current($routes);

        $route[1] = (count($route[1]) > 0) ? array_combine($route[3], $route[1]) : $route[1];

        return $route;
    }
protected function retrieve(array $routes, $uri)
    {
        $routes = array_values(array_filter($routes));

        if (empty($routes)) {
            $message = 'Route "' . $uri . '" not found';

            throw new \UnexpectedValueException($message);
        }

        $route = current($routes);

        $route[1] = (count($route[1]) > 0) ? array_combine($route[3], $route[1]) : $route[1];

        return $route;
    }
Retrieved the specified route from the result.

@throws \UnexpectedValueException

@param  array  $routes
@param  string $uri
@return array