src/Valkyrja/Routing/Annotations/NativeRouteAnnotations.php
protected function getRouteFromAnnotation(Route $route): RouterRoute
    {
        $routerRoute = new RouterRoute();

        $routerRoute
            ->setPath($route->getPath())
            ->setRegex($route->getRegex())
            ->setParams($route->getParams())
            ->setSegments($route->getSegments())
            ->setRequestMethods($route->getRequestMethods())
            ->setSecure($route->isSecure())
            ->setDynamic($route->isDynamic())
            ->setId($route->getId())
            ->setName($route->getName())
            ->setClass($route->getClass())
            ->setProperty($route->getProperty())
            ->setMethod($route->getMethod())
            ->setStatic($route->isStatic())
            ->setFunction($route->getFunction())
            ->setMatches($route->getMatches())
            ->setDependencies($route->getDependencies())
            ->setMiddleware($route->getMiddleware())
            ->setArguments($route->getArguments());

        return $routerRoute;
    }
protected function getRouteFromAnnotation(Route $route): RouterRoute
    {
        $routerRoute = new RouterRoute();

        $routerRoute
            ->setPath($route->getPath())
            ->setRegex($route->getRegex())
            ->setParams($route->getParams())
            ->setSegments($route->getSegments())
            ->setRequestMethods($route->getRequestMethods())
            ->setSecure($route->isSecure())
            ->setDynamic($route->isDynamic())
            ->setId($route->getId())
            ->setName($route->getName())
            ->setClass($route->getClass())
            ->setProperty($route->getProperty())
            ->setMethod($route->getMethod())
            ->setStatic($route->isStatic())
            ->setFunction($route->getFunction())
            ->setMatches($route->getMatches())
            ->setDependencies($route->getDependencies())
            ->setMiddleware($route->getMiddleware())
            ->setArguments($route->getArguments());

        return $routerRoute;
    }
Get a route from a route annotation.

@param Route $route The route annotation

@throws \InvalidArgumentException

@return \Valkyrja\Routing\Route