src/Router/Router.php
public function addRoute(Route $route): self
    {
        foreach ($route->getMethod() as $method) {
            if (!in_array($method, $this->getAllowedMethods(), true) &&
                ZendRoute::HTTP_METHOD_ANY !== $method
            ) {
                throw new RouterException('Invalid method "' . $method . '"');
            }
        }

        $this->routes[] = $route;
        $this->router->addRoute(
            new ZendRoute(
                $route->getPath(),
                $route->getMiddlewares(),
                (0 === count($route->getMethod()) ? ZendRoute::HTTP_METHOD_ANY : $route->getMethod()),
                $route->getName()
            )
        );
        ++$this->count;

        return $this;
    }
public function addRoute(Route $route): self
    {
        foreach ($route->getMethod() as $method) {
            if (!in_array($method, $this->getAllowedMethods(), true) &&
                ZendRoute::HTTP_METHOD_ANY !== $method
            ) {
                throw new RouterException('Invalid method "' . $method . '"');
            }
        }

        $this->routes[] = $route;
        $this->router->addRoute(
            new ZendRoute(
                $route->getPath(),
                $route->getMiddlewares(),
                (0 === count($route->getMethod()) ? ZendRoute::HTTP_METHOD_ANY : $route->getMethod()),
                $route->getName()
            )
        );
        ++$this->count;

        return $this;
    }
@param Route $route

@throws RouterException

@return Router