protected function setRoute(Route $route, array &$routes, array &$lengths): void
    {
        $requestMethod = implode(' | ', $route->getRequestMethods());
        $dispatch      = 'Closure';

        if (null !== $route->getFunction()) {
            $dispatch = $route->getFunction();
        } elseif (null !== $route->getClass()) {
            $dispatch = $route->getClass()
                . ($route->isStatic() ? '::' : '->')
                . ($route->getMethod()
                    ? $route->getMethod() . '()'
                    : $route->getProperty());
        }

        $lengths[0] = max($lengths[0], \strlen($requestMethod));
        $lengths[1] = max($lengths[1], \strlen($route->getPath()));
        $lengths[2] = max($lengths[2], \strlen($route->getName()));
        $lengths[3] = max($lengths[3], \strlen($dispatch));

        $routes[] = [
            $requestMethod,
            $route->getPath(),
            $route->getName() ?? '',
            $dispatch,
        ];
    }